This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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: Cross debugger and load address (want download to VMA, not LMA)


Toralf:


I usually just have two linker command scripts: one for flash, one for RAM. They differ only in their specifications for LMA.


b.g.


Toralf Lund wrote:


I want to debug the software for our new board via gdb or insight built as a cross debugger. Now, the binary will usually be loaded via flash, but executed mostly from RAM, so it is linked with VMA for .text and .data set to RAM addresses, and LMA pointing to the flash area (as required by the flash routine.) However, when running through the debugger, I want to download directly to RAM, i.e. to VMA, but the debugger tries to write to LMA (of course) by default. What's the easiest way around this? Is there any way I can get the debugger to pick up the VMA for each of the sections instead, and use those as download target address? If not, is there any way to produce a version of the binary with LMA = VMA for .text and .data, besides relinking with a separate linker script? I've tried to use objcopy option "--change-section-lma", but it's not easy to find the right parameters as

  1. I don't know the VMA or LMA for .data in advance - just that it
     follows immediately after .text
  2. I can't calculate an offset as I don't know the .text LMA, either
     - in the flash .text is preceded by a separate section containing
     interrupt vectors and RAM init routines, but this is never copied
     to RAM (so .text VMA is the beginning of RAM, but its LMA is *not*
     the beginning of flash.)

Ideas, anyone?

(As usual, I'm posting to this list as I know of no other way to reach people who build apps in way similar to the one discussed - the actual questions may be slightly off-topic...)

-Toralf

------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



-- Bill Gatliff GNU-based embedded development, training and consulting services. bgat@billgatliff.com



------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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