diff options
author | Johannes Stoelp <johannes.stoelp@gmail.com> | 2025-03-30 01:46:26 +0100 |
---|---|---|
committer | Johannes Stoelp <johannes.stoelp@gmail.com> | 2025-03-30 01:51:58 +0100 |
commit | ab04f8876eef5e9da79573368d440da067293c2e (patch) | |
tree | 287482f68f0ac49317adbb0f4b7c27c7f9e81cd4 /src/development/ld/data.S | |
parent | 916b73bee95494c205ba67e4a50e6a525afc3a3c (diff) | |
download | notes-ab04f8876eef5e9da79573368d440da067293c2e.tar.gz notes-ab04f8876eef5e9da79573368d440da067293c2e.zip |
ld: linker script example
Diffstat (limited to 'src/development/ld/data.S')
-rw-r--r-- | src/development/ld/data.S | 23 |
1 files changed, 23 insertions, 0 deletions
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 |