This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
another powerpc64 shared lib fix
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sources dot redhat dot com
- Date: Fri, 18 Jan 2002 11:51:28 +1030
- Subject: another powerpc64 shared lib fix
PowerPC64 libs export function descriptors, not function code syms;
The function code sym will never be marked DEF_DYNAMIC. So..
* elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Test for a
dynamic function descriptor symbol, not the associated function
symbol.
--
Alan Modra
IBM OzLabs - Linux Technology Centre
Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.17
diff -u -p -r1.17 elf64-ppc.c
--- elf64-ppc.c 2002/01/16 07:32:04 1.17
+++ elf64-ppc.c 2002/01/18 00:28:45
@@ -2384,16 +2384,8 @@ ppc64_elf_adjust_dynamic_symbol (info, h
if (h->plt.refcount <= 0
|| h->root.root.string[0] != '.'
- || h->root.root.string[1] == '\0'
- || (! info->shared
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
- && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0))
+ || h->root.root.string[1] == '\0')
{
- /* This case can occur if we saw a PLT reloc in an input
- file, but the symbol was never referred to by a dynamic
- object, or if all references were garbage collected. In
- such a case, we don't actually need to build a procedure
- linkage table entry. */
h->plt.offset = (bfd_vma) -1;
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
return true;
@@ -2426,6 +2418,25 @@ ppc64_elf_adjust_dynamic_symbol (info, h
return false;
}
}
+
+ while (fdh->root.type == bfd_link_hash_indirect
+ || fdh->root.type == bfd_link_hash_warning)
+ fdh = (struct elf_link_hash_entry *) fdh->root.u.i.link;
+
+ if (! info->shared
+ && (fdh->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
+ && (fdh->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0)
+ {
+ /* This case can occur if we saw a PLT reloc in an input
+ file, but the symbol was never referred to by a dynamic
+ object, or if all references were garbage collected. In
+ such a case, we don't actually need to build a procedure
+ linkage table entry. */
+ h->plt.offset = (bfd_vma) -1;
+ h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
+ return true;
+ }
+
return true;
}
else