[PATCH] fix objcopy PE -> ELF conversion
Christian Franke
Christian.Franke@t-online.de
Mon Oct 22 19:19:00 GMT 2007
Objcopy cannot convert pe-i386 to elf32-i386. The offsets of the
pc-relative relocation entries are not converted properly.
(http://sourceware.org/bugzilla/show_bug.cgi?id=970)
I need some PE to ELF conversion for the Cygwin port of GRUB2. The first
working Cygwin patch for GRUB2 includes a workaround to load the broken
ELF modules produced by objcopy. It would be desirable to fix this in
objcopy itself.
The attached patch was tested with latest Cygwin binutils-20060817-1.
Also applies to current CVS without conflict (but was not actually
tested with this version).
Christian
2007-10-21 Christian Franke <franke@computer.org>
* objcopy.c (fix_relocation): New function to
fix pc-relative relocation offset, for PE to ELF only.
(copy_section): Call fix_relocation for section data.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: objcopy-fix-pe-relocation.patch
Type: text/x-patch
Size: 1686 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20071022/87ae7ae6/attachment.bin>
More information about the Binutils
mailing list