diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2016-04-06 18:55:23 +0100 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2016-04-14 17:15:42 +0100 |
commit | 33cbe6c07ed7e66d65c106cffb496eff5d7e8fb5 (patch) | |
tree | f87aa89d105e40ccaa5683fe23279e31ee9ba0e1 /bfd | |
parent | cb040366b36ca624874e036805ca1fca740dae9f (diff) | |
download | gdb-33cbe6c07ed7e66d65c106cffb496eff5d7e8fb5.zip gdb-33cbe6c07ed7e66d65c106cffb496eff5d7e8fb5.tar.gz gdb-33cbe6c07ed7e66d65c106cffb496eff5d7e8fb5.tar.bz2 |
bfd/arc: Rename enum entries to avoid conflicts
In bfd/elf32-arc.c an enum is created that contains entries with generic
names like 'NONE' and 'OFF'. This has been fine for now, but I had a
need to include opcode/arc.h into bfd/elf32-arc.c. Unfortunately
opcode/arc.h includes a different enum with identical generic names.
Given that changing the enum in the header file could mean wide-ranging
changes, while changing the enum in the .c file is limited to only
changing the one file, I've added a prefix to the enum in the .c file.
This commit does not add the new include, that will come later. There
should be no functional change with this commit.
bfd/ChangeLog:
* elf32-arc.c (tls_got_entries): Add 'TLS_GOT_' prefix to all
entries.
(elf_arc_relocate_section): Update enum uses.
(elf_arc_check_relocs): Likewise.
(elf_arc_finish_dynamic_symbol): Likewise.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 8 | ||||
-rw-r--r-- | bfd/elf32-arc.c | 34 |
2 files changed, 25 insertions, 17 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index ac8e8c8..3d04690 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,11 @@ +2016-04-14 Andrew Burgess <andrew.burgess@embecosm.com> + + * elf32-arc.c (tls_got_entries): Add 'TLS_GOT_' prefix to all + entries. + (elf_arc_relocate_section): Update enum uses. + (elf_arc_check_relocs): Likewise. + (elf_arc_finish_dynamic_symbol): Likewise. + 2016-04-14 H.J. Lu <hongjiu.lu@intel.com> * elf.c (_bfd_elf_copy_private_bfd_data): Replace "link" with diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c index 323f65d..d67e88c 100644 --- a/bfd/elf32-arc.c +++ b/bfd/elf32-arc.c @@ -127,10 +127,10 @@ enum tls_type_e enum tls_got_entries { - NONE = 0, - MOD, - OFF, - MOD_AND_OFF + TLS_GOT_NONE = 0, + TLS_GOT_MOD, + TLS_GOT_OFF, + TLS_GOT_MOD_AND_OFF }; struct got_entry @@ -1401,7 +1401,7 @@ elf_arc_relocate_section (bfd * output_bfd, bfd_put_32 (output_bfd, sym_value - sec_vma, htab->sgot->contents + entry->offset - + (entry->existing_entries == MOD_AND_OFF ? 4 : 0)); + + (entry->existing_entries == TLS_GOT_MOD_AND_OFF ? 4 : 0)); ARC_DEBUG ("arc_info: FIXED -> %s value = 0x%x " "@ 0x%x, for symbol %s\n", @@ -1409,7 +1409,7 @@ elf_arc_relocate_section (bfd * output_bfd, "GOT_TLS_IE"), sym_value - sec_vma, htab->sgot->contents + entry->offset - + (entry->existing_entries == MOD_AND_OFF ? 4 : 0), + + (entry->existing_entries == TLS_GOT_MOD_AND_OFF ? 4 : 0), h->root.root.string); entry->processed = TRUE; @@ -1806,7 +1806,7 @@ elf_arc_check_relocs (bfd * abfd, bfd_link_pic (info), NULL); new_got_entry_to_list (&(local_got_ents[r_symndx]), - GOT_NORMAL, offset, NONE); + GOT_NORMAL, offset, TLS_GOT_NONE); } } else @@ -1818,7 +1818,7 @@ elf_arc_check_relocs (bfd * abfd, bfd_vma offset = ADD_SYMBOL_REF_SEC_AND_RELOC (got, TRUE, h); new_got_entry_to_list (&h->got.glist, - GOT_NORMAL, offset, NONE); + GOT_NORMAL, offset, TLS_GOT_NONE); } } } @@ -1847,7 +1847,7 @@ elf_arc_check_relocs (bfd * abfd, if (type != GOT_UNKNOWN && !symbol_has_entry_of_type (*list, type)) { - enum tls_got_entries entries = NONE; + enum tls_got_entries entries = TLS_GOT_NONE; bfd_vma offset = ADD_SYMBOL_REF_SEC_AND_RELOC (got, TRUE, h); @@ -1855,11 +1855,11 @@ elf_arc_check_relocs (bfd * abfd, { bfd_vma ATTRIBUTE_UNUSED notneeded = ADD_SYMBOL_REF_SEC_AND_RELOC (got, TRUE, h); - entries = MOD_AND_OFF; + entries = TLS_GOT_MOD_AND_OFF; } - if (entries == NONE) - entries = OFF; + if (entries == TLS_GOT_NONE) + entries = TLS_GOT_OFF; new_got_entry_to_list (list, type, offset, entries); } @@ -2256,16 +2256,16 @@ elf_arc_finish_dynamic_symbol (bfd * output_bfd, } list->created_dyn_relocation = TRUE; } - else if (list->existing_entries != NONE) + else if (list->existing_entries != TLS_GOT_NONE) { struct elf_link_hash_table *htab = elf_hash_table (info); enum tls_got_entries e = list->existing_entries; BFD_ASSERT (list->type != GOT_TLS_GD - || list->existing_entries == MOD_AND_OFF); + || list->existing_entries == TLS_GOT_MOD_AND_OFF); bfd_vma dynindx = h->dynindx == -1 ? 0 : h->dynindx; - if (e == MOD_AND_OFF || e == MOD) + if (e == TLS_GOT_MOD_AND_OFF || e == TLS_GOT_MOD) { ADD_RELA (output_bfd, got, got_offset, dynindx, R_ARC_TLS_DTPMOD, 0); @@ -2277,7 +2277,7 @@ GOT_OFFSET = 0x%x, GOT_VMA = 0x%x, INDEX = %d, ADDEND = 0x%x\n", + htab->sgot->output_offset + got_offset, dynindx, 0); } - if (e == MOD_AND_OFF || e == OFF) + if (e == TLS_GOT_MOD_AND_OFF || e == TLS_GOT_OFF) { bfd_vma addend = 0; if (list->type == GOT_TLS_IE) @@ -2285,7 +2285,7 @@ GOT_OFFSET = 0x%x, GOT_VMA = 0x%x, INDEX = %d, ADDEND = 0x%x\n", htab->sgot->contents + got_offset); ADD_RELA (output_bfd, got, - got_offset + (e == MOD_AND_OFF ? 4 : 0), + got_offset + (e == TLS_GOT_MOD_AND_OFF ? 4 : 0), dynindx, (list->type == GOT_TLS_IE ? R_ARC_TLS_TPOFF : R_ARC_TLS_DTPOFF), |