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] |
Daniel Lidsten wrote: > Hi, > > I have a special problem that has to do with the linker script. In my > application i want to add a CRC value to the binary image so that i can > check the code segment for errors during runtime. I cannot put the CRC > over the entire image since some segment are changing during execution > so instead i want to calculate it based on the text segment only. > However, the segment is of different size each time i link which means > that i have to communicate the size to the CRC calcualtion routine. I > think that it should be done in the linker script by something like > this: > > .text 0x5000 : { _stext = .; *(.text*) *(.gnu.warning) > *(.gnu.linkonce*) *(.init) } > ram _etext = .; PROVIDE > > The text segment specifies where the end is in the variable _etext. > > I need the above value to be place on a fixed location by something like > this: > > .TextEnd 0x004DFFFC : { etext } > > The above dones work but can any see a way for this to work? > > Regards, Daniel Lidsten > > ------ > Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ > Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com Your special problem does not appear so special to me. It is common to require a CRC of selective linker sections. As a general solution, the linker script language associated with compiler conventions (which code goes into which section), **plus an .elf format parser utility** is likely to do the job. The CRC calculation routine is in the .elf parser utility, and the CRC verification routine is within the program/system startup sequence. The .elf parser utility can easily recoginze the length of any program section. Perhaps you can solve your problem with a simpler solution, see the linker script excerpt below. If you are patient, the solution under development for the ABCD Proto-Kernel should be available as an example (under the GPL license). -- - Thierry Moreau CONNOTECH Experts-conseils inc. 9130 Place de Montgolfier Montreal, Qc H2M 2A1 Tel.: (514)385-5691 Fax: (514)385-5900 e-mail: thierry.moreau@connotech.com /****************************************/ /* Load image sections in the Flash memory. */ /* - - - - - - - - - - - - - - - - - - - */ /* Flash memory contents located here due to execution prior to memory subsystem initialization */ . = ( (~(1M-1))+7*128K ) ; .reset_follow_up : { LONG(start_of_flash_segments_desc) /* <<<<<<<<<<<<< */ LONG(nb_flash_segments_desc) /* <<<<<<<<<<<<< */ *(.reset_follow_up) . = ALIGN(4); } :flash_memory .flash_text : { abcd_init_c1.o(.text .stub .text.*) ppcmb850_pio_debug.o(.text .stub .text.*) abcd_init_c2.o(.text .stub .text.*) crc_1632_init.o(.text .stub .text.*) crc_1632.o(.text .stub .text.*) abcd_flash_pic_fncs.o(.text .text.* .rodata) /* - - - - - - - - - - - - - - - - - - - */ /* Flash memory contents located here due to ther explicit selection (e.g. code used only once) */ *(.flash_text) . = ALIGN(4); } :flash_memory ------ 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] |