This is the mail archive of the binutils@sources.redhat.com 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: [Bug] ld aborts linking large ieee file


> -----Original Message-----
> From: Nick Clifton [mailto:nickc at redhat dot com]
> Sent: Thursday, March 13, 2003 1:48 PM
> 
> Hi Gene,
> 
> > When I ld the modified 3rd-p file (with many other files) 
> it works without
> > the abort and does not complain about the empty table entries.
> 
> Ok - can you post the patch you used ?  If it is small/simple enough
> then we can accept it as "obvious" and so not need a copyright
> assignment.  It may be a bit of a hack, but if allows the tools to
> work and not seg-fault then it is a good thing.
> 
> Cheers
>         Nick

I also tried the latest stable binutils-2.13.2.1 and got the same problem in
objcopy. Did not try ld.

The patch is against bfd/ieee.c 1.27 in cvs (from binutils-2.13) and it
prevents objcopy from crashing when copying the original 3rd-party ieee
file. With this patch applied the transformed 3rd-p file can then be linked
without causing an abort() in ld. I have not touched the ld code.

It could be that ieee_write_expression() should not even be called if symb
pointer is null; not sure.(Sorry for the goto, just trying to get it to work
with minimal line changes.) 

--- ieee.c	Thu Mar 13 16:27:23 2003
+++ ieee.c.new	Wed Mar 12 09:44:41 2003
@@ -322,6 +322,9 @@ ieee_write_expression (abfd, value, symb
       term_count++;
     }
 
+  if (symbol == (asymbol *)NULL)
+    goto ck_pcrel;
+
   if (bfd_is_com_section (symbol->section)
       || bfd_is_und_section (symbol->section))
     {
@@ -369,7 +372,9 @@ ieee_write_expression (abfd, value, symb
 	  return false;
 	}
     }
-
+  
+ck_pcrel:
+  
   if (pcrel)
     {
       /* subtract the pc from here by asking for PC of this section*/


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