diff options
author | Alan Modra <amodra@gmail.com> | 2003-05-13 14:09:51 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2003-05-13 14:09:51 +0000 |
commit | 586119b38f8802cb7ba21961aaa381dd6061c3b2 (patch) | |
tree | c88ea86487b39f8f22cca48d6eb8dfbbac836851 /bfd/elf-bfd.h | |
parent | 04e534c39ae6d32ec36643b0f3c71a2fa47b4ce8 (diff) | |
download | gdb-586119b38f8802cb7ba21961aaa381dd6061c3b2.zip gdb-586119b38f8802cb7ba21961aaa381dd6061c3b2.tar.gz gdb-586119b38f8802cb7ba21961aaa381dd6061c3b2.tar.bz2 |
* elf-bfd.h (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Move from
elf32-ppc.c. Add ELF_LINK_FORCED_LOCAL check.
* elf32-ppc.c: (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Delete.
(allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL for dynreloc check.
(ppc_elf_relocate_section): Likewise.
* elf64-ppc.c (allocate_dynrelocs): Likewise.
(ppc64_elf_relocate_section): Likewise. Use for .got relocs too.
(ppc64_elf_adjust_dynamic_symbol): Don't assume symbols with .plt
relocs need no other types.
* elf32-i386.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL for
dynreloc check.
(elf_i386_relocate_section): Likewise. Use for .got relocs too.
(elf_i386_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL for
.got relocs.
Diffstat (limited to 'bfd/elf-bfd.h')
-rw-r--r-- | bfd/elf-bfd.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 073aee8..46f612a 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -210,6 +210,30 @@ struct elf_link_hash_entry #define ELF_LINK_DYNAMIC_WEAK 040000 }; +/* Will references to this symbol always reference the symbol + in this object? STV_PROTECTED is excluded from the visibility test + here so that function pointer comparisons work properly. Since + function symbols not defined in an app are set to their .plt entry, + it's necessary for shared libs to also reference the .plt even + though the symbol is really local to the shared lib. */ +#define SYMBOL_REFERENCES_LOCAL(INFO, H) \ + ((! (INFO)->shared \ + || (INFO)->symbolic \ + || (H)->dynindx == -1 \ + || ELF_ST_VISIBILITY ((H)->other) == STV_INTERNAL \ + || ELF_ST_VISIBILITY ((H)->other) == STV_HIDDEN \ + || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0) \ + && ((H)->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0) + +/* Will _calls_ to this symbol always call the version in this object? */ +#define SYMBOL_CALLS_LOCAL(INFO, H) \ + ((! (INFO)->shared \ + || (INFO)->symbolic \ + || (H)->dynindx == -1 \ + || ELF_ST_VISIBILITY ((H)->other) != STV_DEFAULT \ + || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0) \ + && ((H)->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0) + /* Records local symbols to be emitted in the dynamic symbol table. */ struct elf_link_local_dynamic_entry |