summaryrefslogtreecommitdiff
path: root/applications/link.ld
diff options
context:
space:
mode:
authorBenji Dial <benji@benjidial.net>2024-01-13 16:43:49 -0500
committerBenji Dial <benji@benjidial.net>2024-01-13 16:43:49 -0500
commit4130562b1555cabe441efe9420cebe12e7ed8d39 (patch)
treebeaf0012373aab2c3a13fe0147a5cda4af28ef78 /applications/link.ld
parent882e74b2191c059a9226cbd8bcb51c97da36247c (diff)
downloadhilbert-os-4130562b1555cabe441efe9420cebe12e7ed8d39.tar.gz
application loading
Diffstat (limited to 'applications/link.ld')
-rw-r--r--applications/link.ld38
1 files changed, 38 insertions, 0 deletions
diff --git a/applications/link.ld b/applications/link.ld
new file mode 100644
index 0000000..eaba220
--- /dev/null
+++ b/applications/link.ld
@@ -0,0 +1,38 @@
+OUTPUT_FORMAT(elf64-x86-64)
+OUTPUT_ARCH(i386:x86-64)
+
+ENTRY(_entry)
+
+PHDRS {
+ rx PT_LOAD FLAGS(5);
+ ro PT_LOAD FLAGS(4);
+ rw PT_LOAD FLAGS(6);
+}
+
+SECTIONS {
+
+ /* see also ../documentation/memory.txt */
+ . = 0x200000;
+
+ .text : {
+ *(.text .text.*)
+ } : rx
+
+ . = ALIGN(0x200000);
+
+ .rodata : {
+ *(.rodata .rodata.*)
+ } : ro
+
+ . = ALIGN(0x200000);
+
+ .data : {
+ *(.data .data.*)
+ } : rw
+
+ .bss : {
+ *(.bss .bss.*)
+ *(COMMON)
+ } : rw
+
+}