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]

How to tell objcopy to create ELF program header


Hello again,

Is there some way that I can force objcopy to construct an ELF program
header when converting an executable file from PECOFF to ELF formats?

As I mentioned in an earlier email, the version of objcopy I'm using
(under cygwin) issues warning messages like

warning: allocated section `.text' not in segment

whenever I try to convert from PECOFF to ELF, and I end up with an
ELF file with no program header.

I have played around with using --set-section-flags to set flags for
each section, and while this shuts up the warnings it still generates
an ELF file without a program header.

I also tried to use the option "--oformat elf32-i386" when linking the
executables in the first place, but then I get the error message

ld: cannot perform PE operations on non PE output file 'user/null.exe'.

I even get the above error message when all of the individual .o files
being linked have been converted to ELF first.

Any ideas about how to generate ELF executable files with program headers
using binutils on cygwin would be greatly appreciated.

objcopy --version says "GNU objcopy 2.17.50 20060817".

-Dave


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