aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-07-10 17:31:31 +0000
committerIan Lance Taylor <ian@airs.com>1995-07-10 17:31:31 +0000
commit951fe66d6208b801aaeedda3bf4b380a89b1feac (patch)
tree9692d5bf044b8b59160838f8e818a935053df18b /bfd
parent5b2c2b363d6934687df22c9280aa84a8b1fba03b (diff)
downloadgdb-951fe66d6208b801aaeedda3bf4b380a89b1feac.zip
gdb-951fe66d6208b801aaeedda3bf4b380a89b1feac.tar.gz
gdb-951fe66d6208b801aaeedda3bf4b380a89b1feac.tar.bz2
Based on patches from Eric Youngdale <eric@aib.com>:
* elflink.h (NAME(bfd_elf,size_dynamic_sections)): If -Bsymbolic, output a DT_SYMBOLIC dynamic entry. (elf_adjust_dynamic_symbol): If -Bsymbolic, don't require a PLT entry for a locally defined symbol. * elf32-i386.c (elf_i386_relocate_section): If -Bsymbolic, do warn about undefined symbols, and fill in the GOT entry for a symbol defined in a regular object file. (elf_i386_finish_dynamic_symbol): If -Bsymbolic, output a RELATIVE reloc rather than a GLOB_DAT reloc for a symbol defined in a regular object file. * elf32-m68k.c (elf_m68k_relocate_section): If -Bsymbolic, do warn about undefined symbols, and fill in the GOT entry for a symbol defined in a regular object file. (elf_m68k_finish_dynamic_symbol): If -Bsymbolic, output a RELATIVE reloc rather than a GLOB_DAT reloc for a symbol defined in a regular object file. * elf32-sparc.c (elf32_sparc_relocate_section): If -Bsymbolic, do warn about undefined symbols, and fill in the GOT entry for a symbol defined in a regular object file. (elf32_sparc_finish_dynamic_symbol): If -Bsymbolic, output a RELATIVE reloc rather than a GLOB_DAT reloc for a symbol defined in a regular object file.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog24
-rw-r--r--bfd/elflink.h16
2 files changed, 40 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index eea1b29..e006596 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -5,6 +5,30 @@ Mon Jul 10 11:45:55 1995 Ken Raeburn <raeburn@cygnus.com>
Mon Jul 10 11:09:58 1995 Ian Lance Taylor <ian@cygnus.com>
+ Based on patches from Eric Youngdale <eric@aib.com>:
+ * elflink.h (NAME(bfd_elf,size_dynamic_sections)): If -Bsymbolic,
+ output a DT_SYMBOLIC dynamic entry.
+ (elf_adjust_dynamic_symbol): If -Bsymbolic, don't require a PLT
+ entry for a locally defined symbol.
+ * elf32-i386.c (elf_i386_relocate_section): If -Bsymbolic, do warn
+ about undefined symbols, and fill in the GOT entry for a symbol
+ defined in a regular object file.
+ (elf_i386_finish_dynamic_symbol): If -Bsymbolic, output a RELATIVE
+ reloc rather than a GLOB_DAT reloc for a symbol defined in a
+ regular object file.
+ * elf32-m68k.c (elf_m68k_relocate_section): If -Bsymbolic, do warn
+ about undefined symbols, and fill in the GOT entry for a symbol
+ defined in a regular object file.
+ (elf_m68k_finish_dynamic_symbol): If -Bsymbolic, output a RELATIVE
+ reloc rather than a GLOB_DAT reloc for a symbol defined in a
+ regular object file.
+ * elf32-sparc.c (elf32_sparc_relocate_section): If -Bsymbolic, do
+ warn about undefined symbols, and fill in the GOT entry for a
+ symbol defined in a regular object file.
+ (elf32_sparc_finish_dynamic_symbol): If -Bsymbolic, output a
+ RELATIVE reloc rather than a GLOB_DAT reloc for a symbol defined
+ in a regular object file.
+
* config/m68k-coff.mt (SELECT_VECS): Rename from SELECT_VECTORS.
Correct elements to be actual BFD vector names.
diff --git a/bfd/elflink.h b/bfd/elflink.h
index 9ba2bed..b9cb000 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -1273,6 +1273,12 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
return false;
}
+ if (info->symbolic)
+ {
+ if (! elf_add_dynamic_entry (info, DT_SYMBOLIC, 0))
+ return false;
+ }
+
if (rpath != NULL)
{
bfd_size_type indx;
@@ -1431,6 +1437,16 @@ elf_adjust_dynamic_symbol (h, data)
bfd *dynobj;
struct elf_backend_data *bed;
+ /* If -Bsymbolic was used (which means to bind references to global
+ symbols to the definition within the shared object), and this
+ symbol was defined in a regular object, then it actually doesn't
+ need a PLT entry. */
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0
+ && eif->info->shared
+ && eif->info->symbolic
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
+ h->elf_link_hash_flags &=~ ELF_LINK_HASH_NEEDS_PLT;
+
/* If this symbol does not require a PLT entry, and it is not
defined by a dynamic object, or is not referenced by a regular
object, ignore it. FIXME: Do we need to worry about symbols