This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
fix weak sym breakage on ppc64
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sources dot redhat dot com
- Cc: Steve Munroe <sjmunroe at us dot ibm dot com>, Peter Bergner <bergner at vnet dot ibm dot com>, Olaf Hering <olh at suse dot de>, Anton Blanchard <antonb at au1 dot ibm dot com>
- Date: Thu, 6 Feb 2003 02:20:20 +1030
- Subject: fix weak sym breakage on ppc64
Oops, put new code in the wrong place, breaking weak sym handling.
* elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't copy got and
plt info when called to transfer weak sym info.
Committed.
Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.80
diff -u -p -r1.80 elf64-ppc.c
--- bfd/elf64-ppc.c 4 Feb 2003 14:50:50 -0000 1.80
+++ bfd/elf64-ppc.c 5 Feb 2003 15:41:36 -0000
@@ -3286,7 +3286,24 @@ ppc64_elf_copy_indirect_symbol (bed, dir
eind->dyn_relocs = NULL;
}
- /* Do the same for got entries. */
+ edir->is_func |= eind->is_func;
+ edir->is_func_descriptor |= eind->is_func_descriptor;
+ edir->is_entry |= eind->is_entry;
+
+ /* Copy down any references that we may have already seen to the
+ symbol which just became indirect. */
+ edir->elf.elf_link_hash_flags |=
+ (eind->elf.elf_link_hash_flags
+ & (ELF_LINK_HASH_REF_DYNAMIC
+ | ELF_LINK_HASH_REF_REGULAR
+ | ELF_LINK_HASH_REF_REGULAR_NONWEAK
+ | ELF_LINK_NON_GOT_REF));
+
+ /* If we were called to copy over info for a weak sym, that's all. */
+ if (eind->elf.root.type != bfd_link_hash_indirect)
+ return;
+
+ /* Copy over got entries. */
if (eind->elf.got.glist != NULL)
{
if (edir->elf.got.glist != NULL)
@@ -3345,22 +3362,6 @@ ppc64_elf_copy_indirect_symbol (bed, dir
eind->elf.plt.plist = NULL;
}
- edir->is_func |= eind->is_func;
- edir->is_func_descriptor |= eind->is_func_descriptor;
- edir->is_entry |= eind->is_entry;
-
- /* Copy down any references that we may have already seen to the
- symbol which just became indirect. */
- edir->elf.elf_link_hash_flags |=
- (eind->elf.elf_link_hash_flags
- & (ELF_LINK_HASH_REF_DYNAMIC
- | ELF_LINK_HASH_REF_REGULAR
- | ELF_LINK_HASH_REF_REGULAR_NONWEAK
- | ELF_LINK_NON_GOT_REF));
-
- if (eind->elf.root.type != bfd_link_hash_indirect)
- return;
-
if (edir->elf.dynindx == -1)
{
edir->elf.dynindx = eind->elf.dynindx;
--
Alan Modra
IBM OzLabs - Linux Technology Centre