summaryrefslogtreecommitdiff
path: root/bfd/elf32-i386.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2010-10-01 04:28:01 +0000
committerH.J. Lu <hjl.tools@gmail.com>2010-10-01 04:28:01 +0000
commit9fa967a6682b2023ed6f96731ed35bca6615ee24 (patch)
treef0748dc898c098fc2c6c2972609a49aa4889ea83 /bfd/elf32-i386.c
parent4c4418063248f8b3bc2918d1cfb207641eebc790 (diff)
downloadbinutils-redhat-9fa967a6682b2023ed6f96731ed35bca6615ee24.tar.gz
Clear non_elf on ELF linker defined symbols.
2010-09-30 H.J. Lu <hongjiu.lu@intel.com> PR ld/11812 * elf32-i386.c (elf_i386_size_dynamic_sections): Don't allocate .got.plt section if there are no GOT nor PLT entries and there is no refeence to _GLOBAL_OFFSET_TABLE_. * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections): Li.kewise. * elflink.c (_bfd_elf_define_linkage_sym): Clear non_elf.
Diffstat (limited to 'bfd/elf32-i386.c')
-rw-r--r--bfd/elf32-i386.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 7a426d5127..8d8bc855c1 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -2559,10 +2559,17 @@ elf_i386_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
if (htab->elf.sgotplt)
{
+ struct elf_link_hash_entry *got;
+ got = elf_link_hash_lookup (elf_hash_table (info),
+ "_GLOBAL_OFFSET_TABLE_",
+ FALSE, FALSE, FALSE);
+
/* Don't allocate .got.plt section if there are no GOT nor PLT
- entries. */
- if ((htab->elf.sgotplt->size
- == get_elf_backend_data (output_bfd)->got_header_size)
+ entries and there is no refeence to _GLOBAL_OFFSET_TABLE_. */
+ if ((got == NULL
+ || !got->ref_regular_nonweak)
+ && (htab->elf.sgotplt->size
+ == get_elf_backend_data (output_bfd)->got_header_size)
&& (htab->elf.splt == NULL
|| htab->elf.splt->size == 0)
&& (htab->elf.sgot == NULL