aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-i386.c
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@imgtec.com>2016-05-16 08:51:26 +0100
committerMaciej W. Rozycki <macro@imgtec.com>2016-05-17 12:21:40 +0100
commita43942db49b07a457ee4f960d0f118b23641ec38 (patch)
tree8a3c5749955ec8b7fa004c78ed7758d3eb0fde7c /bfd/elf32-i386.c
parentfcdad592cd1f76046c5e4b7a2b0337e146d1e796 (diff)
downloadgdb-a43942db49b07a457ee4f960d0f118b23641ec38.zip
gdb-a43942db49b07a457ee4f960d0f118b23641ec38.tar.gz
gdb-a43942db49b07a457ee4f960d0f118b23641ec38.tar.bz2
LD/ELF: Unify STB_GNU_UNIQUE handling
Take STB_GNU_UNIQUE handling scattered across targets and gather it in the generic ELF linker. Update test suite infrastructure accordingly. bfd/ * elf-s390-common.c (elf_s390_add_symbol_hook): Remove STB_GNU_UNIQUE handling. * elf32-arc.c (elf_arc_add_symbol_hook): Likewise. * elf32-arm.c (elf32_arm_add_symbol_hook): Likewise. * elf32-m68k.c (elf_m68k_add_symbol_hook): Likewise. * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise. * elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise. * elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise. * elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise. * elf64-x86-64.c (elf_x86_64_add_symbol_hook): Likewise. * elfxx-aarch64.c (_bfd_aarch64_elf_add_symbol_hook): Likewise. * elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Likewise. * elf32-i386.c (elf_i386_add_symbol_hook): Remove function. (elf_backend_add_symbol_hook): Remove macro. * elflink.c (elf_link_add_object_symbols): Set `has_gnu_symbols' for STB_GNU_UNIQUE symbols. binutils/ * testsuite/lib/binutils-common.exp (supports_gnu_unique): New procedure. * testsuite/binutils-all/objcopy.exp: Use `supports_gnu_unique' with the `strip-10' test. ld/ * testsuite/ld-unique/unique.exp: Use `is_elf_format' and `supports_gnu_unique' to qualify testing.
Diffstat (limited to 'bfd/elf32-i386.c')
-rw-r--r--bfd/elf32-i386.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index df08dd4..fcb22c4 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -5795,27 +5795,6 @@ elf_i386_hash_symbol (struct elf_link_hash_entry *h)
return _bfd_elf_hash_symbol (h);
}
-/* Hook called by the linker routine which adds symbols from an object
- file. */
-
-static bfd_boolean
-elf_i386_add_symbol_hook (bfd * abfd,
- struct bfd_link_info * info,
- Elf_Internal_Sym * sym,
- const char ** namep ATTRIBUTE_UNUSED,
- flagword * flagsp ATTRIBUTE_UNUSED,
- asection ** secp ATTRIBUTE_UNUSED,
- bfd_vma * valp ATTRIBUTE_UNUSED)
-{
- if (ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE
- && (abfd->flags & DYNAMIC) == 0
- && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour)
- elf_tdata (info->output_bfd)->has_gnu_symbols
- |= elf_gnu_symbol_unique;
-
- return TRUE;
-}
-
#define TARGET_LITTLE_SYM i386_elf32_vec
#define TARGET_LITTLE_NAME "elf32-i386"
#define ELF_ARCH bfd_arch_i386
@@ -5863,7 +5842,6 @@ elf_i386_add_symbol_hook (bfd * abfd,
#define elf_backend_omit_section_dynsym \
((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true)
#define elf_backend_hash_symbol elf_i386_hash_symbol
-#define elf_backend_add_symbol_hook elf_i386_add_symbol_hook
#define elf_backend_fixup_symbol elf_i386_fixup_symbol
#include "elf32-target.h"
@@ -6053,9 +6031,6 @@ elf32_iamcu_elf_object_p (bfd *abfd)
#undef elf_backend_strtab_flags
#undef elf_backend_copy_special_section_fields
-#undef elf_backend_add_symbol_hook
-#define elf_backend_add_symbol_hook elf_i386_add_symbol_hook
-
#include "elf32-target.h"
/* Restore defaults. */