Linking and Memory Maps (newbie question)

James Yates j.yates at quartzuk.com
Thu Nov 6 10:29:11 UTC 2003


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

	

-----Original Message-----
From: Victor V. Vengerov [mailto:vvv at oktet.ru]
Sent: 06 November 2003 10:18
To: James Yates
Cc: Rtems Users (E-mail)
Subject: Re: Linking and Memory Maps (newbie question)


James Yates wrote:

>   I am trying to run the hello_world c program for rtems, but it seems to want to link for my ROM area 0x0. I would like to link this to be placed in SRAM 0x800000 so that I can treat it like any other application I have written for this board so far, but cant work out how to make it link to RAM and not ROM.
>
>	Can anyone help?
>  
>
Most likely you need to edit linkcmds file. This is linker script which 
specify how to link your program, and, particularly,
where to locate your program sections.

To better understand what to do, I'll address you to GNU linker 
documentation
(most likely, info files installed at /usr/share/info/ld.info*). It has 
comprehensive description
of linker script file format.

Hope this helps,
Victor

-- 
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