summaryrefslogtreecommitdiff
path: root/src/kernel/linker.ld
diff options
context:
space:
mode:
authordzwdz2021-07-18 14:27:45 +0200
committerdzwdz2021-07-18 14:27:45 +0200
commitb38298319411965cbb7e9ed1312b24ba36cc7c44 (patch)
tree375c5a426d178b0c0f9190a44d0f7e9ee6216278 /src/kernel/linker.ld
parented12953042ec38244f3ab93d67f4c2dea6f1fee3 (diff)
move the kernel linker script to src/kernel/
Diffstat (limited to 'src/kernel/linker.ld')
-rw-r--r--src/kernel/linker.ld30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/kernel/linker.ld b/src/kernel/linker.ld
new file mode 100644
index 0000000..650ecd7
--- /dev/null
+++ b/src/kernel/linker.ld
@@ -0,0 +1,30 @@
+ENTRY(_start)
+
+SECTIONS
+{
+ . = 1M;
+ .text BLOCK(4K) : ALIGN(4K)
+ {
+ *(.multiboot)
+ *(.text)
+ }
+ .rodata BLOCK(4K) : ALIGN(4K)
+ {
+ *(.rodata)
+ }
+ .data BLOCK(4K) : ALIGN(4K)
+ {
+ *(.data)
+ }
+ _data_end = .;
+ .bss BLOCK(4K) : ALIGN(4K)
+ {
+ *(COMMON)
+ *(.bss)
+
+ stack_bottom = .;
+ . += 16K;
+ stack_top = .;
+ }
+ _bss_end = (. + 0xFFF) & ~0xFFF; /* aligned to 4K */
+}