This is the mail archive of the
mailing list for the binutils project.
How to tell objcopy to create ELF program header
- From: "David Hovemeyer" <david dot hovemeyer at gmail dot com>
- To: binutils at sourceware dot org
- Date: Thu, 5 Oct 2006 12:07:50 -0400
- Subject: How to tell objcopy to create ELF program header
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".