Hi, I have a doubt in using different LMA and VMA for .data, .sdata sections. I have logically splitted my 256MB RAM in my embedded system into two regions as follows: MEMORY { swimage(rwx) : ORIGIN = 0x0, LENGTH = 0x3000000 rtarea (rwx) : ORIGIN = 0x3000000, LENGTH = 0xD000000 } SECTIONS { /* swimage region starts */ .text : { *(.init) *(.text) *(.fini) ... } > swimage __code_end = .; /* rtarea region starts */ __runtime_area_start = 0x3000000; __data_start = __runtime_area_start; .data __runtime_area_start { *(.data) } > rtarea AT > swimage .sdata { *(.sdata) } > rtarea AT > swimage __data_end = .; __data_size = __data_end - __data_start ; .sbss { *(.sbss) } > rtarea .bss : { *(.bss) } > rtarea /* allocation of space for heap/stack goes here ... */ ... ... ... } I do copying of .data from LMA to VMA as follows: memcpy(__data_start, __code_end, (__data_end - __data_start)); I'm using the following command to specify LMA region of .data. .data __runtime_area_start { *(.data) } > rtarea AT > swimage After copying, if I refer to a global variable at VMA, it has garbage value. Using --print-map option to linker, I generated map file of symbols. I found the LMA of .data section in map file. VMA of my .data is 0x3000000(as per above skeleton script). Assume my LMA is 0x2000000 (__code_end). I calculated the offset of that global variable with respect to LMA region. I found in my LMA region itself, the global variables are not loaded properly. i.e the global variable has the same junk value in LMA region. I found from map file that some additional section are generated in between .data and .sdata. .eh_frame, .jcr, .data.rel.local, .data.rel.ro.local, .data.rel. Are these sections needed? Is my LMA region corrupted my any other section? On seeing the map file, I found that many additional section .text._ZN6DArray***, .rela.text._ZN6DArray***, .rela.sdata.__ZTIS***, .rela.rodata.__ZTIS***. Apparently there is no overlapping of .data in LMA with other section. I'm really not able to guess the cause of the problem. I'm struggling for more than a week. Please tell me what can cause of the problem and how to rectify. Thanks and regards, Jeffi -- View this message in context: http://old.nabble.com/Garbage-values-in-LMA-of-.data-section-tp27140436p27140436.html Sent from the gcc - Help mailing list archive at Nabble.com.