Problem with gnu objcopy, trying to translate from MSVC to gcc
I have a specific problem and a general problem, and I'm hoping someone here can help with at least one of them.
My overall task is to convert some .obj files generated under MSVC/Windows (from masm, specifically), to a format that can be linked in under gcc. Objcopy looks like the right tool for that, but I'm having issues.
I'm running objcopy in a command prompt under WinXP at the moment, though I could try it under Linux if that looked useful.
Anyway, if I look at a .obj file from MSVC using objdump, I get interesting information. My plan was to compare this to what objdump shows about a gcc ".o" file and then work out what needs to be converted with objcopy.
However, when I (under Windows, still) run objcopy on the .o file, I get
>objdump -t linux.o
objdump: linux.o: Permission denied
Now, the permissions on this file are identical to those in the .obj file, which worked fine. If I run objdump on a random file, it tells me it can't recognize the file format, so that's not the problem either. I get the same result running objcopy and "size" on this file, though the tool "strings" ran fine on it. So question #2 is what the heck is going on there?
I'll note that this is an old version of the gnu binutils, if that's relevent:
GNU objdump 2.8-B19
Copyright 1997 Free Software Foundation, Inc.
And here's what this install of objcopy knows about:
objcopy: supported targets: pe-i386 pei-i386 srec symbolsrec tekhex binary ihex
I'm new at this, and I'm not even sure what the "correct" formats here are, though this is entirely for use on modern Intel chips.
Thank you all for any help you can provide. I've had virtually no luck in finding out more information about these tools beyond the man pages. (and if anyone knows how to solve the overall task easily, that would be even better!)