IA64 linker is totally broken (Re: PATCH: ELF linker is broken)

Alan Modra amodra@bigpond.net.au
Wed Feb 2 01:12:00 GMT 2005


On Tue, Feb 01, 2005 at 04:39:25PM -0800, H. J. Lu wrote:
> On Wed, Feb 02, 2005 at 10:27:01AM +1030, Alan Modra wrote:
> > On Tue, Feb 01, 2005 at 02:45:50PM -0800, H. J. Lu wrote:
> > > There are quite a few failures on ia64. I am not sure if they can be
> > > fixed by a single change. I am enclosing the cause of all the problems
> > > I have seen so far on ia64. IA64 linker has a relaxation pass, which
> > > seems to be the problem. Dos it ring a bell to you? If not, I will
> > > send you a bunch of ia64 binaries as a testcase.
> > 
> > Please send me the binaries!  I can only make wild guesses otherwise.
> > BTW, I still can't send email to you directly.  Your anti-spam filters
> > don't like my ISP's mail hub, nor do they like smtp directly from my
> 
> I will see what I can do.
> 
> > dynamic ip address.  :-(  Hmm, a bounce through gcc.gnu.org might
> > work.
> > 
> 
> I have sent you a testcase. I think this patch should do the trick.
> We have to keep the next pointer. Otherwise, out hash table may be
> screwed up.

But that shouldn't be zapped.  The lowest level hash newfunc doesn't
clear any of it's fields.  Ah!  But ia64 newfunc clears the whole
hash entry!  That would lose the string too.

	* elfxx-ia64.c (elfNN_ia64_new_elf_hash_entry): Don't clear
	everything, just the field specific to ia64.

Index: bfd/elfxx-ia64.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-ia64.c,v
retrieving revision 1.144
diff -u -p -r1.144 elfxx-ia64.c
--- bfd/elfxx-ia64.c	28 Oct 2004 14:55:41 -0000	1.144
+++ bfd/elfxx-ia64.c	2 Feb 2005 01:10:26 -0000
@@ -1616,15 +1616,12 @@ elfNN_ia64_new_elf_hash_entry (entry, ta
   if (!ret)
     return 0;
 
-  /* Initialize our local data.  All zeros, and definitely easier
-     than setting a handful of bit fields.  */
-  memset (ret, 0, sizeof (*ret));
-
   /* Call the allocation method of the superclass.  */
   ret = ((struct elfNN_ia64_link_hash_entry *)
 	 _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret,
 				     table, string));
 
+  ret->info = 0;
   return (struct bfd_hash_entry *) ret;
 }
 
-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list