diff options
author | Ian Lance Taylor <ian@airs.com> | 1995-07-10 17:31:31 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1995-07-10 17:31:31 +0000 |
commit | 951fe66d6208b801aaeedda3bf4b380a89b1feac (patch) | |
tree | 9692d5bf044b8b59160838f8e818a935053df18b /bfd/elflink.h | |
parent | 5b2c2b363d6934687df22c9280aa84a8b1fba03b (diff) | |
download | gdb-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/elflink.h')
-rw-r--r-- | bfd/elflink.h | 16 |
1 files changed, 16 insertions, 0 deletions
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 |