aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-i386.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1999-09-04 16:26:08 +0000
committerIan Lance Taylor <ian@airs.com>1999-09-04 16:26:08 +0000
commit7843f00e2d20477ff4fe77054c7f2c5a90a20bca (patch)
treea3b1a31ff9e27a3f9e2745611d5bfd031647b44c /bfd/elf32-i386.c
parent4fe53c9827dd950f6fac045494bb4821a40b2141 (diff)
downloadgdb-7843f00e2d20477ff4fe77054c7f2c5a90a20bca.zip
gdb-7843f00e2d20477ff4fe77054c7f2c5a90a20bca.tar.gz
gdb-7843f00e2d20477ff4fe77054c7f2c5a90a20bca.tar.bz2
* elf-bfd.h (ELF_LINK_NON_GOT_REF): Define.
* elflink.h (elf_adjust_dynamic_symbol): Copy REF_REGULAR_NONWEAK and NON_GOT_REF from weak defined symbol to real symbol. * elf32-i386.c (elf_i386_check_relocs): Set NON_GOT_REF. (elf_i386_adjust_dynamic_symbol): If NON_GOT_REF is not set, don't create a COPY reloc. * elf32-sparc.c (elf32_sparc_check_relocs): Set NON_GOT_REF. (elf32_sparc_adjust_dynamic_symbol): If NON_GOT_REF is not set, don't create a COPY reloc.
Diffstat (limited to 'bfd/elf32-i386.c')
-rw-r--r--bfd/elf32-i386.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 0790af5..33514ac 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -591,6 +591,9 @@ elf_i386_check_relocs (abfd, info, sec, relocs)
case R_386_32:
case R_386_PC32:
+ if (h != NULL)
+ h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
+
/* If we are creating a shared library, and this is a reloc
against a global symbol, or a non PC relative reloc
against a local symbol, then we need to copy the reloc
@@ -889,6 +892,11 @@ elf_i386_adjust_dynamic_symbol (info, h)
if (info->shared)
return true;
+ /* If there are no references to this symbol that do not use the
+ GOT, we don't need to generate a copy reloc. */
+ if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
+ return true;
+
/* We must allocate the symbol in our .dynbss section, which will
become part of the .bss section of the executable. There will be
an entry for this symbol in the .dynsym section. The dynamic