pe-i386 reloc overflow

Sigbjorn Finne sof@galois.com
Wed Feb 6 13:00:00 GMT 2002


For posterity and/or in the hope that this will sufficiently
pique someone's interest to have a go at properly fixing
this, here's how to repro the bug:

   foo$ wget http://galois.com/~sof/libHSstd.a.gz
   foo$ gzip -d libHSstd.a.gz
   foo$ ld -r -o mound.o --whole-archive libHSstd.a
   foo$ objdump -r mound.o

which will cause objdump to crash on the (ill-formed)
object file.

This is with HEAD built with either
--host=i386-pc-mingw32 or --host=i386-pc-cygwin

--sigbjorn

----- Original Message ----- 
From: "Sigbjorn Finne" <sof@galois.com>
To: <binutils@sources.redhat.com>
Sent: Tuesday, January 29, 2002 23:46
Subject: Re: pe-i386 reloc overflow


> I believe I've located the cause of the 'ld -r' misbehaviour
> re: extended relocs - bfd/cofflink.c:_bfd_coff_final_link()
> fails to emit a reloc table containing the extra first
> entry - attached is a patch to cofflink.c which adds
> the missing bits.
> 
> Now, bfd/cofflink.c contains generic COFFery, so
> injecting backend (PE in this case) specific portions
> like this is not the right way to go about it. If someone
> would be willing to work with me and/or point me in
> the right direction for this 'ld -r' fix to be in a shape
> worthy of consideration for inclusion, I'd really
> appreciate it.
> 
> thanks,
> --sigbjorn
> 
> 



More information about the Binutils mailing list