This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ARM-ELF -> PE-COFF with objcopy


27.04.09, 20:33, "pps" <i-love-spam@yandex.ru>:
> Nick Clifton wrote:
> > Don't try to convert the object file, instead try converting the fully 
> > linked executable.
> > 
> > The problem is that object files contain relocations and objcopy is not 
> > really able to translate these between different file format types.
> > 
> I've seen that objcopy can't do so reliably. In my case the speech codec 
> lib has zero dependencies on any libc functions and all it has is a 
> bunch of extern "C" functions and const static tables. So, I was 
> thinking that this should be the simplest case and I decided to try it.
> Since the entire app can't be compiled by RVCT, then I need to compile 
> speech codec as a shared library and then convert that shared lib to 
> dll, right?


I'm completely lost, seems that objcopy can't do anything related to elf->coff properly.
test.cpp:
__declspec(dllexport) int add(int a, int b){ return a+b; }

then:
armcc --cpu=6 -Otime -O3 --shared --apcs=/fpic test.cpp
and 
objcopy.exe  -I elf32-littlearm -O pei-arm-wince-little __image.axf testi.dll
objcopy.exe  -I elf32-littlearm -O pe-arm-wince-little __image.axf test.dll

Then on wince app I tried to load testi.dll and test.dll and In both cases it fails 
with ERROR_BAD_EXE_FORMAT.

I also tried to open the dlls with dependencywalker and test.dll is completely corrupt, whereas test.dll can be opened, but dependencywalker shows that it doesn't export anything. test.dll doesn't even have regular MZ header. In any case, it appears that elf->conf doesn't work for binaries also.

Did I do something incorrectly?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]