|
From: | Ken |
Subject: | Does the linker really generate these labels? (arm-elf-ld) |
Date: | Thu, 27 Mar 2003 10:01:12 +0800 |
HI, respectable fighter:
I'm now using Cygnus to build
program on ARM architecture, but i meet a problem that the variable(s) will
not be initialized by the system, so i take a
look at the startup file provided by ATMEL, it used some external
functions to do that thing, and remarked these labels are automatically
generated by the linker, and i do so, but the linker tell me that it can't find
such symbles:
cstartup_flash.o:cstartup_flash.s:339: undefined
reference to `Image$$RO$$Limit'
cstartup_flash.o:cstartup_flash.s:339: undefined
reference to `Image$$RW$$Base'
cstartup_flash.o:cstartup_flash.s:339: undefined reference to `Image$$ZI$$Base' cstartup_flash.o:cstartup_flash.s:339: undefined reference to `Image$$ZI$$Limit' Does the linker really generate these
labels?
Here is the part of startup
file: ;------------------------------------------------------------------------------
;- Initialise C variables ;------------------------ ;- Following labels are automatically generated by the linker. ;- RO: Read- code ;- RW: Read Write = the data pre-initialized and zero-initialized. ;- ZI: Zero-Initialized. ;- Pre-initialization values are located after the code area in the image. ;- Zero-initialized datas are mapped after the pre-initialized. ;- Note on the Data position : ;- If using the ARMSDT, when no -rw-base option is used for the linker, the ;- data area is mapped after the code. You can map the data either in internal ;- SRAM ( -rw-base=0x40 or 0x34) or in external SRAM ( -rw-base=0x2000000 ). ;- Note also that to improve the code density, the pre_initialized data must ;- be limited to a minimum. ;------------------------------------------------------------------------------ IMPORT |Image$$RO$$Limit| ; End of ROM code (=start of ROM data) IMPORT |Image$$RW$$Base| ; Base of RAM to initialise IMPORT |Image$$ZI$$Base| ; Base and limit of area IMPORT |Image$$ZI$$Limit| ; to zero initialise
ldr r0, =|Image$$RO$$Limit| ;
Get pointer to ROM
data
ldr r1, =|Image$$RW$$Base| ; and RAM copy ldr r3, =|Image$$ZI$$Base| ; Zero init base => top of initialised data cmp r0, r1 ; Check that they are different beq NoRW LoopRw cmp r1, r3 ; Copy init data ldrcc r2, [r0], #4 strcc r2, [r1], #4 bcc LoopRw NoRW ldr r1, =|Image$$ZI$$Limit| ; Top of zero init segment mov r2, #0 LoopZI cmp r3, r1 ; Zero init strcc r2, [r3], #4 bcc LoopZI Best
regards -------------------------------------- Justin Zhang R&D Dept Tel: 62385599-5809 Fax: 62389059 Mail: address@hidden Beijing Comsys Tech. Co., Ltd. |
[Prev in Thread] | Current Thread | [Next in Thread] |