aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-ppc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2003-05-13 14:09:51 +0000
committerAlan Modra <amodra@gmail.com>2003-05-13 14:09:51 +0000
commit586119b38f8802cb7ba21961aaa381dd6061c3b2 (patch)
treec88ea86487b39f8f22cca48d6eb8dfbbac836851 /bfd/elf32-ppc.c
parent04e534c39ae6d32ec36643b0f3c71a2fa47b4ce8 (diff)
downloadgdb-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/elf32-ppc.c')
-rw-r--r--bfd/elf32-ppc.c31
1 files changed, 3 insertions, 28 deletions
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 64c2839..ca9fbd9 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -147,27 +147,6 @@ static bfd_boolean ppc_elf_grok_psinfo
#define TP_OFFSET 0x7000
#define DTP_OFFSET 0x8000
-/* 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_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_HASH_DEF_REGULAR) != 0)
/* The PPC linker needs to keep track of the number of relocs that it
decides to copy as dynamic relocs in check_relocs for each symbol.
@@ -2817,11 +2796,10 @@ allocate_dynrelocs (h, inf)
defined in regular objects. For the normal shared case, discard
space for relocs that have become local due to symbol visibility
changes. */
+
if (info->shared)
{
- if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
- && ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0
- || info->symbolic))
+ if (SYMBOL_REFERENCES_LOCAL (info, h))
{
struct ppc_elf_dyn_relocs **pp;
@@ -5013,10 +4991,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|| h->root.type != bfd_link_hash_undefweak)
&& (MUST_BE_DYN_RELOC (r_type)
|| (h != NULL
- && h->dynindx != -1
- && (!info->symbolic
- || (h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_REGULAR) == 0))))
+ && !SYMBOL_REFERENCES_LOCAL (info, h))))
|| (ELIMINATE_COPY_RELOCS
&& !info->shared
&& (input_section->flags & SEC_ALLOC) != 0