Cross debugger and load address (want download to VMA, not LMA)

Toralf Lund toralf@procaptura.com
Mon Apr 19 15:02:00 GMT 2004


Grant Edwards wrote:

>>toralf>> 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?
>>    
>>
>
>You can use objcopy to change both the LMA and VMA of sections.
>  
>
Yep.

The problem in my case is knowing what values to use, since .data is 
specified relative to .text rather than on an absulte adress. And the 
.text LMA is relative to a different section, too, so the offset between 
LMA and VMA isn't known, either.

>  
>
>>You might want to try something like this: Note that the MY_ROM_START
>>is a SYMBOL - and it is not defined in the linker script, instead
>>define it on the linker command line.
>>
>>    
>>
>>>>  SECTIONS {
>>>>    . = MY_ROM_START;
>>>>    .vectors : { *(.vectors) }
>>>>    . = MY_TEXT_START;
>>>>   
>>>>    [snip]
>>>>  }
>>>>        
>>>>
>
>If maintaining two separate linker scripts is the concern, you
>can put the common stuff in third file that is included by the
>ram-specific file and the rom-specific file.
>
>  
>


-- 
Toralf Lund <toralf@procaptura.com> +47 66 85 51 22
ProCaptura AS                       +47 66 85 51 00 (switchboard)
http://www.procaptura.com/~toralf   +47 66 85 51 01 (fax)


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



More information about the crossgcc mailing list