This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.
See the CrossGCC FAQ for lots more information.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Does somebody could give me some advice to organize memory sections with an ld script for a flash/RAM based system?
Everything is dled in flash at startup. ASM routines take care of copying RAM functions from flash to RAM and zero-ing .bss sections.
The problems is that we want to include code of certain objects files in the RAM zone so we have to declare them first. Otherwise, the * takes precedence and they are wrongly located.
The problem that arises is that I have lots of "Relocation truncated to fit" errors and I do not understand why.
As it is in fact ADS->GNU conversion, I wonder about how to convert the ARE statement. Suppose we have the [AREA BOOT, CODE] statement to translate. Should I replace it with a [.section "BOOT", "x"] or with [.section "BOOT"\n .text]. I chose the second solution. If I switch to the first one, then I have "Literal referenced across section boundary" error (If I remember well)
********************************************************************************* Here is my script (which is a translation of ADS scatter file btw) *********************************************************************************
*except.o (.text .rodata) *irqisr.o (.text .rodata) *irqctrl.o (.text .rodata) *HW_BT_iip.o (.text .rodata) *os_context_arm.o (.text .rodata) *os_int_prim.o (.text .rodata) *nvdslowlevel.o (.text .rodata) */uart2.o (.text .rodata) */usb.o (.text .rodata) *USB_int.o (.text .rodata) *sleepfromram.o (.text .rodata)
Image$$IRAM$$Length = . - Image$$IRAM$$Base ; Iram_Text_End = . ; }
Image$$IRAMDATA$$Base = . ; Load$$IRAMDATA$$Base = 0x00000000 + SIZEOF(.iram_text) ;
*lm_memory_manager.o (.data) *.o (.data) Iram_Data_End = . ; Image$$IRAMDATA$$Length = . - Image$$IRAMDATA$$Base ;
} /* Same stuff for BSS */ .bss 0x00000000 + SIZEOF(.iram_text) + SIZEOF(.data) : AT (Iram_Data_End) { Image$$IRAMDATA$$ZI$$Base = . ; *lm_memory_manager.o (.bss) *.o (.bss) Iram_Bss_End = . ; Image$$IRAMDATA$$ZI$$Length = Iram_Bss_End - Image$$IRAMDATA$$ZI$$Base ;
/* GNU : The entry point of our application. This label is located in boot.o */ ENTRY(entry_point)
/* Code section at the beginnign of the ROM .text 0x01000080 : { */boot.o (.text .rodata) /* Make sure the code for booting is first */ *.o (.text .rodata) Code_End = . ; } > CODE
------ Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |