[Patch] Convert PE relocatable modules to ELF with objcopy
Christian Franke
Christian.Franke@t-online.de
Sun Oct 21 20:30:00 GMT 2007
objcopy from binutils-20060817-1 cannot convert pe-i396 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 recently started a Cygwin port of GRUB2 ([Maybe ITP later]-).
(http://lists.gnu.org/archive/html/grub-devel/2007-10/msg00071.html)
GRUB2 loadable modules use ELF format, therefore, some PE to ELF
conversion is required to build on Cygwin.
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.
A patch is attached.
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.
Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: objcopy-fix-pe-relocation.patch
Type: text/x-patch
Size: 1687 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20071021/b5eac804/attachment.bin>
-------------- next part --------------
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
More information about the Cygwin
mailing list