aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Romero <gustavo.romero@linaro.org>2024-09-10 18:38:59 +0100
committerAlex Bennée <alex.bennee@linaro.org>2024-09-10 23:33:59 +0100
commitf0ef6c35acc0439ef081f7ef18643ba56888ddae (patch)
tree6fbba0c24f8e3b604453477274a1834482f2fade
parent3848409eb0f83fda5eb47e31d7deec5ae5ca46a1 (diff)
downloadqemu-f0ef6c35acc0439ef081f7ef18643ba56888ddae.zip
qemu-f0ef6c35acc0439ef081f7ef18643ba56888ddae.tar.gz
qemu-f0ef6c35acc0439ef081f7ef18643ba56888ddae.tar.bz2
tests/tcg/aarch64: Improve linker script organization
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>
-rw-r--r--tests/tcg/aarch64/system/kernel.ld24
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/tcg/aarch64/system/kernel.ld b/tests/tcg/aarch64/system/kernel.ld
index 7b3a76d..5f39258 100644
--- a/tests/tcg/aarch64/system/kernel.ld
+++ b/tests/tcg/aarch64/system/kernel.ld
@@ -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)
}