This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ld/2218 fix for powerpc64


On Fri, Feb 17, 2006 at 03:18:26PM +1030, Alan Modra wrote:
> Jakub fixed the undef weak in PIE a long time ago for powerpc-linux.
> powerpc64-linux needs the same treatment.  I also tweaked the ppc32
> code to use the same tests as ppc64.  Not that there is anything wrong
> with Jakub's code, but the simpler test (leaving out info->pie) is
> sufficient.

Ehhm.  There is one good reason to test eh->dyn_relocs again, and that
is that the SYMBOL_CALLS_LOCAL loop just above may have nulled
dyn_relocs.  In which case we don't need to make the sym dynamic.

	* elf32-ppc.c (allocate_dynrelocs): Tweak undef weak handling.
	* elf64-ppc.c (allocate_dynrelocs): Likewise.

Index: bfd/elf32-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-ppc.c,v
retrieving revision 1.186
diff -u -p -r1.186 elf32-ppc.c
--- bfd/elf32-ppc.c	17 Feb 2006 04:49:34 -0000	1.186
+++ bfd/elf32-ppc.c	17 Feb 2006 12:41:55 -0000
@@ -4546,7 +4546,8 @@ allocate_dynrelocs (struct elf_link_hash
 
       /* Also discard relocs on undefined weak syms with non-default
 	 visibility.  */
-      if (h->root.type == bfd_link_hash_undefweak)
+      if (eh->dyn_relocs != NULL
+	  && h->root.type == bfd_link_hash_undefweak)
 	{
 	  if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
 	    eh->dyn_relocs = NULL;
Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.233
diff -u -p -r1.233 elf64-ppc.c
--- bfd/elf64-ppc.c	17 Feb 2006 04:49:34 -0000	1.233
+++ bfd/elf64-ppc.c	17 Feb 2006 12:42:01 -0000
@@ -7582,7 +7582,8 @@ allocate_dynrelocs (struct elf_link_hash
 
       /* Also discard relocs on undefined weak syms with non-default
 	 visibility.  */
-      if (h->root.type == bfd_link_hash_undefweak)
+      if (eh->dyn_relocs != NULL
+	  && h->root.type == bfd_link_hash_undefweak)
 	{
 	  if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
 	    eh->dyn_relocs = NULL;


-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]