Linking and Memory Maps (newbie question)
Victor V. Vengerov
vvv at oktet.ru
Thu Nov 6 11:48:45 UTC 2003
James,
check your load address. Load address (LMA) and "virtual" address (VMA -
address
where section expect to be located when executed) are conceptually
different. Apply
<target>-objdump -x <object-file> to see VMA and LMA addresses. (It is
assumed
that your .srec generated from <object-file>
As a last resort, you may try to play with --change-section-lma /
--change-section-vma options of objcopy when generated srec.
Victor
James Yates wrote:
>I believe that I have modified the existing linker scripts correctly. In fact I have modified those for ROM and RAM builds both to link to RAM since I never need to link for ROM and to save any confusion in builds.
>
>I have looked at the tests that were built when I built rtems for my BSP. The map file for the test hello looks like this, only showing a few lines:
>.text 0x00804000 0x136d0
> *(.text)
> .text 0x00804000 0xc0 ../../../../../fu0018/lib/start.o
> 0x00804000 _start
> .text 0x008040c0 0x90 o-optimize/init.o
> 0x00804110 _Init
> .text 0x00804150 0xb0 ../../../../../fu0018/lib/no-dpmem.rel
> 0x008041a0 _rtems_port_delete
> 0x008041e0 _rtems_port_external_to_internal
> 0x00804150 __Dual_ported_memory_Manager_initialization
> 0x00804180 _rtems_port_ident
> 0x00804160 _rtems_port_create
> 0x008041c0 _rtems_port_internal_to_external
> .text 0x00804200 0x50 ../../../../../fu0018/lib/no-event.rel
> 0x00804210 _rtems_event_send
> 0x00804230 _rtems_event_receive
> 0x00804200 __Event_Manager_initialization
> .text 0x00804250 0x170 ../../../../../fu0018/lib/no-msg.rel
>
>
>
>So it says that it's linking into SRAM (0x800000) but when I try to produce a motorola SREC using sh-rtems-objcopy.exe -O srec hello.o hello.sr and look at the srecord, the code is addresses from 0x0. Any ideas what I am doing wrong?
>
>
> James Yates
>
>
>
>
>
--
Victor V. Vengerov
OKTET Ltd.
Ulianovskaya st., 1, office 533, St.-Petersburg 198504 Russia
phone: +7 812 4284384(work),+7 812 9389372(mobile),+7 812 4281653(home)
More information about the users
mailing list