|
From: | Nick Clifton |
Subject: | Re: objcopy elf32-i386 to pe-i386 breaks R_386_32 relocations |
Date: | Fri, 30 May 2008 17:02:48 +0100 |
User-agent: | Thunderbird 1.5.0.12 (X11/20080213) |
Hi Dave,
I think there's a bug in the way objcopy handles R_386_32 (absolute 32-bit) relocation entries when translating from elf to pe-i386 (windows) object files.
The symptom is that R_386_32 relocations in elf get translated into DIR16 entries in the pe-i386. (Or perhaps just not translated, since I think DIR16 is numerical value 1, which I think is the same numerical value as R_386_REL, and possibly also the same value as bfd uses internally, though that part is pure speculation from a very quick look at the source.)
Your speculation is correct. Objcopy does not perform *any* translation of relocations. This is why it very rarely works when translating object files. Your best bet is to link the elf32-i386 object files into a fully linked program first and then use objcopy to translate it into a pe-i386 executable. (But beware of shared libraries/DLLs. Objcopy will not translate between uses of shared library functions and uses of DLL functions either).
Cheers Nick
[Prev in Thread] | Current Thread | [Next in Thread] |