creating binaries by objcopy
Nick Clifton
nickc@redhat.com
Mon Jun 6 14:06:00 GMT 2005
Hi Bahadir,
> The binutils manual says:
>
> "When objcopy generates a raw binary file, it will essentially produce
> a memory dump of the contents of the input object file. All symbols
> and relocation information will be discarded."
First of all, just to be sure that there is no confusion here: when the
binutils manual talks about a "raw binary" file it is talking about a
file in one particular specific format. It is not talking about any
arbitrary binary file such as an ELF executable file, or an IHEX binary
file. It is talking about a *raw* binary file where essentially the
only structuring is that the file could be loaded/mapped into memory and
then executed by jumping to an address which the host OS must have found
out through some other means.
> b) Do I need to define routines that copy the scattered sections, zero
> out the bss etc if I want to have such services of a loader?
> Is there a better way to do this?
Yes - do not use the raw binary format. Stick with the ELF format. Or
if you must, choose a simpler format like IHEX or SREC.
Cheers
Nick
More information about the Binutils
mailing list