aboutsummaryrefslogtreecommitdiff
path: root/arch/x86.ld
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86.ld')
-rw-r--r--arch/x86.ld74
1 files changed, 74 insertions, 0 deletions
diff --git a/arch/x86.ld b/arch/x86.ld
new file mode 100644
index 0000000..440e513
--- /dev/null
+++ b/arch/x86.ld
@@ -0,0 +1,74 @@
+ENTRY (_start)
+
+KERNEL_PMA = 0x00100000;
+KERNEL_VMA = 0xC0000000;
+
+SECTIONS
+{
+ . = KERNEL_PMA;
+
+
+ .multiboot.data : {
+ *(.multiboot2.header)
+ *(.boot32.rodata)
+ }
+
+ .multiboot.text : {
+ *(.multiboot.text)
+ }
+
+ . += KERNEL_VMA;
+
+ .text ALIGN (4K) : AT (ADDR (.text) - KERNEL_VMA)
+ {
+ *(.text)
+ }
+
+ .got ALIGN (4K) : AT (ADDR (.got) - KERNEL_VMA)
+ {
+ *(.got)
+ }
+
+ .got.plt ALIGN (4K) : AT (ADDR (.got.plt) - KERNEL_VMA)
+ {
+ *(.got.plt)
+ }
+
+ .rodata ALIGN(4K) : AT (ADDR (.rodata) - KERNEL_VMA)
+ {
+ *(.rodata)
+ }
+
+ .data ALIGN (4K) : AT (ADDR (.data) - KERNEL_VMA)
+ {
+ *(.data)
+ }
+
+ .bss ALIGN (4K) : AT (ADDR (.bss) - KERNEL_VMA)
+ {
+ *(COMMON)
+ *(.bss)
+ *(.bootstrap_stack)
+ }
+
+ /DISCARD/ :
+ {
+ *(.debug_abbrev)
+ *(.debug_aranges)
+ *(.debug_frame)
+ *(.debug_gdb_scripts)
+ *(.debug_info)
+ *(.debug_line)
+ *(.debug_line_str)
+ *(.debug_loc)
+ *(.debug_pubnames)
+ *(.debug_pubtypes)
+ *(.debug_ranges)
+ *(.debug_str)
+
+ *(.comment)
+ *(.note.*)
+ }
+
+ _kernel_end = .;
+}