uCrouter project forum


shuwn yuan,2006\03\15 08:48:17,2208 bytes

Answer

Forum

How to convert ADS assembly that is auto generate by the linker?

hi,

For ADS assembly code, it has this part of code:

------------------------------------------------------------------------------
;- Initialise C variables
;------------------------
;- Following labels are automatically generated by the linker.
;- RO: Read-only = the 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.
;------------------------------------------------------------------------------

add r2, pc,#-(8+.-CInitData) ; @ where to read relative)
ldmia r2, {r0, r1, r3, r4}

cmp r0, r1 ; Check that they are different
beq EndRW
LoopRW
cmp r1, r3 ; Copy init data
ldrcc r2, [r0], #4
strcc r2, [r1], #4
bcc LoopRW
EndRW

mov r2, #0
LoopZI
cmp r3, r4 ; Zero init
strcc r2, [r3], #4
bcc LoopZI

b EndInitC

CInitData
IMPORT |Image$$| ; End of ROM code (=start of ROM data)
IMPORT |Image$$| ; Base of RAM to initialise
IMPORT |Image$$| ; Base and limit of area
IMPORT |Image$$| ; Top of zero init segment

DCD |Image$$| ; End of ROM code (=start of ROM data)
DCD |Image$$| ; Base of RAM to initialise
DCD |Image$$| ; Base and limit of area
DCD |Image$$| ; Top of zero init segment
EndInitC

If this is converted into gcc assembly, this whole part should be deleted right?
Since it can"t be converted just like this. I will need to generate a linker script
for it is it? Any guide on how to generate the linker script for this?

Thanks :-)

  • How to convert ADS assembly that is auto generate by the linker? - shuwn yuan, 2006\03\15 08:48:17, 2208 bytes

Register Forgot passwd Top

Answer

Name:
Passwd:
Subject:
Message:
Input number : 3736


ARM®и Thumb® зарегистрированные торговые марки ARM Limited.
Linux® зарегистрированная торговая марка Linus Torvalds.
µClinux и uClinux торговые марки Arcturus Networks Inc.