From ab04f8876eef5e9da79573368d440da067293c2e Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Sun, 30 Mar 2025 01:46:26 +0100 Subject: ld: linker script example --- src/development/ld/data.S | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/development/ld/data.S (limited to 'src/development/ld/data.S') diff --git a/src/development/ld/data.S b/src/development/ld/data.S new file mode 100644 index 0000000..d76adcf --- /dev/null +++ b/src/development/ld/data.S @@ -0,0 +1,23 @@ +.section .text, "ax", @progbits +.global _entry +_entry: + mov $_stack_top, %rsp + mov $asm_array, %rax + mov (asm_len), %eax + + hlt + jmp _entry + +.section .data.asm, "aw", @progbits +asm_array: + .4byte 0xa + .4byte 0xb + .4byte 0xc + .4byte 0xd +.rept 4 + .4byte 0xff +.endr + +.section .rodata.asm, "a", @progbits +asm_len: + .4byte 8 -- cgit v1.2.3