This is the mail archive of the binutils@sources.redhat.com 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: creating binaries by objcopy


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




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