This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
RE: [Bug] ld aborts linking large ieee file
- From: "Smith, Gene" <gene dot smith at siemens dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 13 Mar 2003 17:03:22 -0500
- Subject: 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*/