mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-23 03:29:47 +08:00
C-SKY: Fix machine flag.
* elf32-csky.c (elf32_csky_merge_attributes): Don't save and restore the ARCH attribute, it will actually clear the ARCH attribute. (csky_elf_merge_private_bfd_data): Store the machine flag correctly.
This commit is contained in:

committed by
Nick Clifton

parent
1609cd6c5b
commit
fd1b3e0e8d
@ -1,3 +1,11 @@
|
|||||||
|
2023-01-17 Xianmiao Qu <cooper.qu@linux.alibaba.com>
|
||||||
|
|
||||||
|
* elf32-csky.c (elf32_csky_merge_attributes): Don't save
|
||||||
|
and restore the ARCH attribute, it will actually clear
|
||||||
|
the ARCH attribute.
|
||||||
|
(csky_elf_merge_private_bfd_data): Store the machine flag
|
||||||
|
correctly.
|
||||||
|
|
||||||
2023-01-13 Nick Clifton <nickc@redhat.com>
|
2023-01-13 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
* po/ro.po: Updated Romainian translation.
|
* po/ro.po: Updated Romainian translation.
|
||||||
|
@ -2892,16 +2892,8 @@ elf32_csky_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
|
|||||||
/* This is the first object. Copy the attributes. */
|
/* This is the first object. Copy the attributes. */
|
||||||
out_attr = elf_known_obj_attributes_proc (obfd);
|
out_attr = elf_known_obj_attributes_proc (obfd);
|
||||||
|
|
||||||
/* If Tag_CSKY_CPU_NAME is already set, save it. */
|
|
||||||
memcpy (&tattr, &out_attr[Tag_CSKY_ARCH_NAME], sizeof (tattr));
|
|
||||||
|
|
||||||
_bfd_elf_copy_obj_attributes (ibfd, obfd);
|
_bfd_elf_copy_obj_attributes (ibfd, obfd);
|
||||||
|
|
||||||
out_attr = elf_known_obj_attributes_proc (obfd);
|
|
||||||
|
|
||||||
/* Restore Tag_CSKY_CPU_NAME. */
|
|
||||||
memcpy (&out_attr[Tag_CSKY_ARCH_NAME], &tattr, sizeof (tattr));
|
|
||||||
|
|
||||||
/* Use the Tag_null value to indicate the attributes have been
|
/* Use the Tag_null value to indicate the attributes have been
|
||||||
initialized. */
|
initialized. */
|
||||||
out_attr[0].i = 1;
|
out_attr[0].i = 1;
|
||||||
@ -3066,12 +3058,14 @@ csky_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
|
|||||||
old_flags = elf_elfheader (obfd)->e_flags;
|
old_flags = elf_elfheader (obfd)->e_flags;
|
||||||
out_attr = elf_known_obj_attributes_proc (obfd);
|
out_attr = elf_known_obj_attributes_proc (obfd);
|
||||||
|
|
||||||
/* the flags like"e , f ,g ..." , we take collection. */
|
/* The flags like "e , f ,g ..." , we take collection. */
|
||||||
newest_flag = (old_flags & (~CSKY_ARCH_MASK))
|
newest_flag = old_flags | new_flags;
|
||||||
| (new_flags & (~CSKY_ARCH_MASK));
|
|
||||||
|
|
||||||
sec_name = get_elf_backend_data (ibfd)->obj_attrs_section;
|
sec_name = get_elf_backend_data (ibfd)->obj_attrs_section;
|
||||||
if (bfd_get_section_by_name (ibfd, sec_name) == NULL)
|
|
||||||
|
if (bfd_get_section_by_name (ibfd, sec_name) == NULL
|
||||||
|
|| (new_flags & (CSKY_ARCH_MASK | CSKY_ABI_MASK) !=
|
||||||
|
old_flags & (CSKY_ARCH_MASK | CSKY_ABI_MASK)))
|
||||||
{
|
{
|
||||||
/* Input BFDs have no ".csky.attribute" section. */
|
/* Input BFDs have no ".csky.attribute" section. */
|
||||||
new_arch = csky_find_arch_with_eflag (new_flags & CSKY_ARCH_MASK);
|
new_arch = csky_find_arch_with_eflag (new_flags & CSKY_ARCH_MASK);
|
||||||
@ -3110,9 +3104,6 @@ csky_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
|
|||||||
out_attr[Tag_CSKY_ARCH_NAME].s =
|
out_attr[Tag_CSKY_ARCH_NAME].s =
|
||||||
_bfd_elf_attr_strdup (obfd, newest_arch->name);
|
_bfd_elf_attr_strdup (obfd, newest_arch->name);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
newest_flag |= ((new_flags & (CSKY_ARCH_MASK | CSKY_ABI_MASK))
|
|
||||||
| (old_flags & (CSKY_ARCH_MASK | CSKY_ABI_MASK)));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user