summaryrefslogtreecommitdiff
path: root/kernel/ldscript
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/ldscript')
-rw-r--r--kernel/ldscript69
1 files changed, 69 insertions, 0 deletions
diff --git a/kernel/ldscript b/kernel/ldscript
new file mode 100644
index 0000000..2f1e1f4
--- /dev/null
+++ b/kernel/ldscript
@@ -0,0 +1,69 @@
+ENTRY(_launch)
+
+PHDRS
+{
+ text PT_LOAD;
+ rodata PT_LOAD;
+ data PT_LOAD;
+ eh_frame PT_LOAD;
+ dynamic PT_LOAD;
+}
+
+SECTIONS
+{
+ /* Load in upper, you know the drill */
+ . = 0xFFFFFFFF80000000;
+
+ _kernel_start = .;
+
+ .text : {
+ *(.text .text.*)
+ } :text
+
+ . += CONSTANT(MAXPAGESIZE);
+
+ .rodata : {
+ *(.rodata, .rodata.*)
+ *(.srodata, .srodata.*)
+ } :rodata
+
+ .init_array : {
+ _ctors_start = .;
+ KEEP(*(SORT(.init_array.*)))
+ KEEP(*(.init_array))
+ _ctors_end = .;
+ } :rodata
+
+ .fini_array : {
+ _dtors_start = .;
+ KEEP(*(SORT(.fini_array)))
+ KEEP(*(.fini_array))
+ _dtors_end = .;
+ } :rodata
+
+ . += CONSTANT(MAXPAGESIZE);
+
+ .data : {
+ *(.data .data.*)
+ *(.sdata .sdata.*)
+
+ KEEP(*(.requests_start))
+ KEEP(*(.requests))
+ KEEP(*(.requests_end))
+ } :data
+
+ .dynamic : {
+ *(.dynamic)
+ } :data :dynamic
+
+ .bss : {
+ *(.bss .bss.*)
+ *(.sbss .sbss.*)
+ *(COMMON)
+ } :data
+
+ /DISCARD/ : {
+ *(.eh_frame*)
+ *(.note .note.*)
+ }
+}