summaryrefslogtreecommitdiff
path: root/src/user_bootstrap/linker.ld
diff options
context:
space:
mode:
authordzwdz2022-07-23 17:57:56 +0200
committerdzwdz2022-07-23 17:57:56 +0200
commitcd12cbc75564fafd9c2519cdf1085e651c9d7cfd (patch)
treeacc02960280b4e360a932e48c228a46b78070574 /src/user_bootstrap/linker.ld
parent6cd59ad0124d8a22e8cbb77f87e8f0aa20633c59 (diff)
create a bootstrap ELF loader, that'll load init
Diffstat (limited to 'src/user_bootstrap/linker.ld')
-rw-r--r--src/user_bootstrap/linker.ld31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/user_bootstrap/linker.ld b/src/user_bootstrap/linker.ld
new file mode 100644
index 0000000..f2c9d24
--- /dev/null
+++ b/src/user_bootstrap/linker.ld
@@ -0,0 +1,31 @@
+ENTRY(main)
+OUTPUT_FORMAT("binary")
+
+SECTIONS
+{
+ . = 2M;
+ .text BLOCK(4K) : ALIGN(4K)
+ {
+ *(.text.startup)
+ *(.text)
+ }
+ .rodata BLOCK(4K) : ALIGN(4K)
+ {
+ *(.rodata)
+ }
+ .data BLOCK(4K) : ALIGN(4K)
+ {
+ *(.data)
+ }
+
+ _initrd = .; /* is just appended onto the end of the binary */
+ . += 2M;
+
+ _bss_start = .;
+ .bss BLOCK(4K) : ALIGN(4K)
+ {
+ *(COMMON)
+ *(.bss)
+ }
+ _bss_end = .;
+}