aboutsummaryrefslogtreecommitdiff
path: root/conf/link-amd64.ld
diff options
context:
space:
mode:
Diffstat (limited to 'conf/link-amd64.ld')
-rw-r--r--conf/link-amd64.ld47
1 files changed, 47 insertions, 0 deletions
diff --git a/conf/link-amd64.ld b/conf/link-amd64.ld
new file mode 100644
index 0000000..454f1f8
--- /dev/null
+++ b/conf/link-amd64.ld
@@ -0,0 +1,47 @@
+OUTPUT_FORMAT(elf64-x86-64)
+OUTPUT_ARCH(i386:x86-64)
+ENTRY(main)
+
+PHDRS
+{
+ text PT_LOAD FLAGS((1 << 0) | (1 << 2)) ; /* Execute + Read */
+ rodata PT_LOAD FLAGS((1 << 2)) ; /* Read only */
+ data PT_LOAD FLAGS((1 << 1) | (1 << 2)) ; /* Write + Read */
+}
+
+SECTIONS
+{
+ . = 0xFFFFFFFF80000000;
+
+ .text : {
+ *(.text .text.*)
+ } :text
+
+ . += CONSTANT(MAXPAGESIZE);
+
+ .rodata : {
+ *(.rodata .rodata.*)
+ } :rodata
+
+ .modules : {
+ __modules_init_start = .;
+ *(.modules .modules)
+ __modules_init_end = .;
+ } :rodata
+
+ . += CONSTANT(MAXPAGESIZE);
+
+ .data : {
+ *(.data .data.*)
+ } :data
+
+ .bss : {
+ *(COMMON)
+ *(.bss .bss.*)
+ } :data
+
+ /DISCARD/ : {
+ *(.eh_frame)
+ *(.note .note.*)
+ }
+}