]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tests/tcg/aarch64: Improve linker script organization
authorGustavo Romero <gustavo.romero@linaro.org>
Tue, 10 Sep 2024 17:38:59 +0000 (18:38 +0100)
committerAlex Bennée <alex.bennee@linaro.org>
Tue, 10 Sep 2024 22:33:59 +0000 (23:33 +0100)
Improve kernel.ld linker script organization by using MEMORY command.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Message-Id: <20240906143316.657436-5-gustavo.romero@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240910173900.4154726-10-alex.bennee@linaro.org>

tests/tcg/aarch64/system/kernel.ld

index 7b3a76dcbf35d4f00920262783de2dd12c06c66e..5f39258d32ed199aae5c9ec63f3fe394bfdb5c50 100644 (file)
@@ -1,23 +1,23 @@
 ENTRY(__start)
 
-SECTIONS
-{
-    /* virt machine, RAM starts at 1gb */
-    . = (1 << 30);
+MEMORY {
+    /* On virt machine RAM starts at 1 GiB. */
+
+    /* Align text and rodata to the 1st 2 MiB chunk. */
+    TXT (rx) : ORIGIN = 1 << 30, LENGTH = 2M
+    /* Align r/w data to the 2nd 2 MiB chunk. */
+    DAT (rw) : ORIGIN = (1 << 30) + 2M, LENGTH = 2M
+}
+
+SECTIONS {
     .text : {
         *(.text)
-    }
-    .rodata : {
         *(.rodata)
-    }
-    /* align r/w section to next 2mb */
-    . = ALIGN(1 << 21);
+    } >TXT
     .data : {
         *(.data)
-    }
-    .bss : {
         *(.bss)
-    }
+    } >DAT
     /DISCARD/ : {
         *(.ARM.attributes)
     }