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]

Re: How to create object from binary?


Hi Michael,

> However, this places the image data in the .data section, which I
> can not change - this leads to problems because I can't put it in
> the memory section  where it needs to be (in flash, not in RAM like
> the .data sections from my code).
> 
> Is there an easy solution which I overlooked?

Yes - you can use a linker script to change the section.  For example
with a script like this:

  SECTIONS
  {
	.flash :
	{
		*(.data)
	}
  }

You can do "ld -T conv.t image image.flash" to move all of the
contents of the .data section in the "image" file into a section
called ".flash" in "image.flash".

Cheers
        Nick


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