1 /* ld script to make x86-64 Linux kernel
2 * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>;
5 #include <asm-generic/vmlinux.lds.h>
6 #include <linux/config.h>
8 OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
9 OUTPUT_ARCH(i386:x86-64)
14 . = 0xffffffff80100000;
15 _text = .; /* Text and read-only data */
23 .text.lock : { *(.text.lock) } /* out-of-line lock text */
25 _etext = .; /* End of text section */
27 . = ALIGN(16); /* Exception table */
28 __start___ex_table = .;
29 __ex_table : { *(__ex_table) }
30 __stop___ex_table = .;
39 _edata = .; /* End of data section */
41 __bss_start = .; /* BSS */
48 . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
49 .data.cacheline_aligned : { *(.data.cacheline_aligned) }
51 #define AFTER(x) BINALIGN(LOADADDR(x) + SIZEOF(x), 16)
52 #define BINALIGN(x,y) (((x) + (y) - 1) & ~((y) - 1))
53 #define CACHE_ALIGN(x) BINALIGN(x, CONFIG_X86_L1_CACHE_BYTES)
55 .vsyscall_0 -10*1024*1024: AT ((LOADADDR(.data.cacheline_aligned) + SIZEOF(.data.cacheline_aligned) + 4095) & ~(4095)) { *(.vsyscall_0) }
56 __vsyscall_0 = LOADADDR(.vsyscall_0);
57 . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
58 .xtime_lock : AT CACHE_ALIGN(AFTER(.vsyscall_0)) { *(.xtime_lock) }
59 xtime_lock = LOADADDR(.xtime_lock);
60 .vxtime : AT AFTER(.xtime_lock) { *(.vxtime) }
61 vxtime = LOADADDR(.vxtime);
62 .wall_jiffies : AT AFTER(.vxtime) { *(.wall_jiffies) }
63 wall_jiffies = LOADADDR(.wall_jiffies);
64 .sys_tz : AT AFTER(.wall_jiffies) { *(.sys_tz) }
65 sys_tz = LOADADDR(.sys_tz);
66 .sysctl_vsyscall : AT AFTER(.sys_tz) { *(.sysctl_vsyscall) }
67 sysctl_vsyscall = LOADADDR(.sysctl_vsyscall);
68 .xtime : AT AFTER(.sysctl_vsyscall) { *(.xtime) }
69 xtime = LOADADDR(.xtime);
70 . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
71 .jiffies : AT CACHE_ALIGN(AFTER(.xtime)) { *(.jiffies) }
72 jiffies = LOADADDR(.jiffies);
73 .vsyscall_1 ADDR(.vsyscall_0) + 1024: AT (LOADADDR(.vsyscall_0) + 1024) { *(.vsyscall_1) }
74 . = LOADADDR(.vsyscall_0) + 4096;
76 . = ALIGN(8192); /* init_task */
77 .data.init_task : { *(.data.init_task) }
80 .data.page_aligned : { *(.data.page_aligned) }
82 . = ALIGN(4096); /* Init code and data */
90 .init.data : { *(.init.data) }
94 .init.setup : { *(.init.setup) }
107 __con_initcall_start = .;
108 .con_initcall.init : { *(.con_initcall.init) }
109 __con_initcall_end = .;
112 __alt_instructions = .;
113 .altinstructions : { *(.altinstructions) }
114 __alt_instructions_end = .;
115 .altinstr_replacement : { *(.altinstr_replacement) }
116 /* .exit.text is discard at runtime, not link time, to deal with references
117 from .altinstructions and .eh_frame */
118 .exit.text : { *(.exit.text) }
119 .exit.data : { *(.exit.data) }
121 __initramfs_start = .;
122 .init.ramfs : { *(.init.ramfs) }
126 .data.percpu : { *(.data.percpu) }
133 .data_nosave : { *(.data.nosave) }
139 /* Sections to be discarded */
142 #ifndef CONFIG_DEBUG_INFO
148 .debug_info 0 : { *(.debug_info) }
149 .debug_abbrev 0 : { *(.debug_abbrev) }
150 .debug_line 0 : { *(.debug_line) }
151 .debug_frame 0 : { *(.debug_frame) }
152 .debug_str 0 : { *(.debug_str) }
153 .debug_loc 0 : { *(.debug_loc) }
154 .debug_macinfo 0 : { *(.debug_macinfo) }
155 /* SGI/MIPS DWARF 2 extensions */
156 .debug_weaknames 0 : { *(.debug_weaknames) }
157 .debug_funcnames 0 : { *(.debug_funcnames) }
158 .debug_typenames 0 : { *(.debug_typenames) }
159 .debug_varnames 0 : { *(.debug_varnames) }
162 .comment 0 : { *(.comment) }