public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* ARM-ELF -> PE-COFF with objcopy
@ 2009-04-27  9:45 pps
  2009-04-27 14:33 ` Nick Clifton
  0 siblings, 1 reply; 27+ messages in thread
From: pps @ 2009-04-27  9:45 UTC (permalink / raw)
  To: binutils

Hello everybody,
I have source for a voice codec and I want to evaluate performance 
difference if compiled with different compilers. Target device is WinCE 
6.0 HTC smartphone (which is arm11).
I decided to try RVCT which produces elf objects, but for wince I need coff.
So, one of the options I have is to convert elf to coff with objcopy.
I downloaded latest binutils and compiled it with support for all 
targets. Then I did this:
objcopy.exe -I elf32-littlearm -O pe-arm-wince-little test.o test.obj
test.cpp was just extern "C" int add(int a, int b) { return a + b; }
Then I tried to link produced test.obj and it doesn't work.

I use VS2008 and the error is: test.obj : fatal error LNK1136: invalid 
or corrupt file

Then I tried to do it different way. First I converted test.o to 
symbolsrec format and then from symbolsrec I converted to 
pe-arm-wince-little. In this case I was able to link to the test.obj, 
but the executable crashes:
         int X2 = add(X, Y);
00011068  ldr         r1, Y, #0x28
0001106C  ldr         r0, X, #0x2C
00011070  bl          |WinMain + 0xfffff000 ( 10000h )|  <- crash

Other than that I tried to use objcopy from gnuarm, codesourcery and 
cegcc distributions hoping that it would work with other binaries but in 
all cases I couldn't get it working.

I also noticed that after I tried to remove some symbols from 
pe-arm-wince-little with strip VS linker would reject updated object 
file as currupted. SO, I think there is some problem in arm-coff part of 
BFD.

Can anybody comment on that, or suggest what I should try?
Thanks

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2009-05-09 17:20 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-27  9:45 ARM-ELF -> PE-COFF with objcopy pps
2009-04-27 14:33 ` Nick Clifton
2009-04-27 16:26   ` pps
2009-04-27 21:21     ` i-love-spam
2009-04-27 22:49       ` Ian Lance Taylor
2009-04-28  7:24         ` i-love-spam
2009-04-28  7:45           ` Nick Clifton
2009-04-28  8:31             ` i-love-spam
2009-04-28 10:44               ` Nick Clifton
2009-05-08 20:55               ` i-love-spam
2009-05-09 17:20                 ` Dave Korn
2009-04-28 14:15           ` Ian Lance Taylor
2009-04-28 14:25             ` Dave Korn
2009-04-28 15:46               ` pps
2009-04-28 16:07                 ` Dave Korn
2009-04-28 16:56                   ` Daniel Jacobowitz
2009-04-28 17:29                   ` Pedro Alves
2009-04-28 17:33                     ` Daniel Jacobowitz
2009-04-28 21:09                       ` Dave Korn
2009-05-07  6:58                         ` pps
2009-05-07  9:38                           ` Vincent R.
2009-05-07 12:27                             ` Dave Korn
2009-05-07 12:34                               ` Vincent R.
2009-05-08  8:31                             ` pps
2009-05-08  8:32                             ` pps
2009-04-28 16:44                 ` Ian Lance Taylor
2009-04-28 16:52                   ` pps

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).