File tree Expand file tree Collapse file tree 1 file changed +26
-8
lines changed Expand file tree Collapse file tree 1 file changed +26
-8
lines changed Original file line number Diff line number Diff line change @@ -30,9 +30,15 @@ SECTIONS
3030 *(.rdata .rodata .rodata .*)
3131 }
3232
33- . = ALIGN (PAGE_SIZE); /* start RW sections in separate page */
34-
35- .data : {
33+ . = ALIGN (PAGE_SIZE); /* start RW sections in separate page */
34+ _data_lma_start = .;
35+
36+ #ifdef MEM_NON_UNIFIED
37+ . = PLAT_DATA_MEM; /* Changed location counter to VMA address */
38+ _data_vma_start = .;
39+ #endif
40+
41+ .data : AT (_data_lma_start) {
3642 *(.data .data .*)
3743 PROVIDE (__global_pointer$ = . + 0x800 );
3844 *(.sdata .sdata .* .sdata2 .*)
@@ -51,15 +57,27 @@ SECTIONS
5157
5258 . = ALIGN (PAGE_SIZE);
5359 _image_load_end = .;
60+ #ifdef MEM_NON_UNIFIED
61+ /* Save the current location counter (VMA) and switch to LMA for .vm_images */
62+ _vma_before_vm_images = .;
63+ _image_load_end = _data_lma_start + (_image_load_end - _data_vma_start);
64+ . = _image_load_end;
65+ #endif
5466
5567 /* Sections to be allocated only in physical memory, not in VA space */
5668
57- .vm_images : SUBALIGN (PAGE_SIZE) {
58- _vm_image_start = .;
59- KEEP (*(.vm_image *))
60- }
69+ .vm_images : AT(_image_load_end) SUBALIGN (PAGE_SIZE) {
70+ _vm_image_start = .;
71+ KEEP (*(.vm_image *))
72+ }
73+
74+ #ifdef MEM_NON_UNIFIED
75+ /* Restore the location counter (VMA) */
76+ . = _vma_before_vm_images;
77+ #endif
78+
6179 . = ALIGN (PAGE_SIZE);
62- _vm_image_end = . ;
80+ _vm_image_end = _vm_image_start + SIZEOF (. vm_images ) ;
6381 _image_noload_start = .;
6482 extra_allocated_phys_mem = _image_noload_start - _image_load_end;
6583
You can’t perform that action at this time.
0 commit comments