vserver 1.9.3
[linux-2.6.git] / arch / x86_64 / kernel / vmlinux.lds.S
1 /* ld script to make x86-64 Linux kernel
2  * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>;
3  */
4
5 #include <asm-generic/vmlinux.lds.h>
6 #include <linux/config.h>
7
8 OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
9 OUTPUT_ARCH(i386:x86-64)
10 ENTRY(_start)
11 jiffies_64 = jiffies;
12 SECTIONS
13 {
14   . = 0xffffffff80100000;
15   _text = .;                    /* Text and read-only data */
16   .text : {
17         *(.text)
18         SCHED_TEXT
19         LOCK_TEXT
20         *(.fixup)
21         *(.gnu.warning)
22         } = 0x9090
23   .text.lock : { *(.text.lock) }        /* out-of-line lock text */
24
25   _etext = .;                   /* End of text section */
26
27   . = ALIGN(16);                /* Exception table */
28   __start___ex_table = .;
29   __ex_table : { *(__ex_table) }
30   __stop___ex_table = .;
31
32   RODATA
33
34   .data : {                     /* Data */
35         *(.data)
36         CONSTRUCTORS
37         }
38
39   _edata = .;                   /* End of data section */
40
41   __bss_start = .;              /* BSS */
42   .bss : {
43         *(.bss.page_aligned)    
44         *(.bss)
45         }
46   __bss_end = .;
47
48   . = ALIGN(64);
49   .data.cacheline_aligned : { *(.data.cacheline_aligned) }
50
51   .vsyscall_0 -10*1024*1024: AT ((LOADADDR(.data.cacheline_aligned) + SIZEOF(.data.cacheline_aligned) + 4095) & ~(4095)) { *(.vsyscall_0) }
52   __vsyscall_0 = LOADADDR(.vsyscall_0);
53   . = ALIGN(64);
54   .xtime_lock : AT ((LOADADDR(.vsyscall_0) + SIZEOF(.vsyscall_0) + 63) & ~(63)) { *(.xtime_lock) }
55   xtime_lock = LOADADDR(.xtime_lock);
56   . = ALIGN(16);
57   .vxtime : AT ((LOADADDR(.xtime_lock) + SIZEOF(.xtime_lock) + 15) & ~(15)) { *(.vxtime) }
58   vxtime = LOADADDR(.vxtime);
59   . = ALIGN(16);
60   .wall_jiffies : AT ((LOADADDR(.vxtime) + SIZEOF(.vxtime) + 15) & ~(15)) { *(.wall_jiffies) }
61   wall_jiffies = LOADADDR(.wall_jiffies);
62   . = ALIGN(16);
63   .sys_tz : AT ((LOADADDR(.wall_jiffies) + SIZEOF(.wall_jiffies) + 15) & ~(15)) { *(.sys_tz) }
64   sys_tz = LOADADDR(.sys_tz);
65   . = ALIGN(16);
66   .sysctl_vsyscall : AT ((LOADADDR(.sys_tz) + SIZEOF(.sys_tz) + 15) & ~(15)) { *(.sysctl_vsyscall) }
67   sysctl_vsyscall = LOADADDR(.sysctl_vsyscall);
68   . = ALIGN(16);
69   .jiffies : AT ((LOADADDR(.sysctl_vsyscall) + SIZEOF(.sysctl_vsyscall) + 15) & ~(15)) { *(.jiffies) }
70   jiffies = LOADADDR(.jiffies);
71   . = ALIGN(16);
72   .xtime : AT ((LOADADDR(.jiffies) + SIZEOF(.jiffies) + 15) & ~(15)) { *(.xtime) }
73   xtime = LOADADDR(.xtime);
74   .vsyscall_1 ADDR(.vsyscall_0) + 1024: AT (LOADADDR(.vsyscall_0) + 1024) { *(.vsyscall_1) }
75   . = LOADADDR(.vsyscall_0) + 4096;
76
77   . = ALIGN(8192);              /* init_task */
78   .data.init_task : { *(.data.init_task) }
79
80   . = ALIGN(4096);
81   .data.page_aligned : { *(.data.page_aligned) }
82
83   . = ALIGN(4096);              /* Init code and data */
84   __init_begin = .;
85   .init.text : { 
86         _sinittext = .;
87         *(.init.text)
88         _einittext = .;
89   }
90   .init.data : { *(.init.data) }
91   . = ALIGN(16);
92   __setup_start = .;
93   .init.setup : { *(.init.setup) }
94   __setup_end = .;
95   __initcall_start = .;
96   .initcall.init : {
97         *(.initcall1.init) 
98         *(.initcall2.init) 
99         *(.initcall3.init) 
100         *(.initcall4.init) 
101         *(.initcall5.init) 
102         *(.initcall6.init) 
103         *(.initcall7.init)
104   }
105   __initcall_end = .;
106   __con_initcall_start = .;
107   .con_initcall.init : { *(.con_initcall.init) }
108   __con_initcall_end = .;
109   SECURITY_INIT
110   . = ALIGN(8);
111   __alt_instructions = .;
112   .altinstructions : { *(.altinstructions) } 
113   __alt_instructions_end = .; 
114  .altinstr_replacement : { *(.altinstr_replacement) }
115   /* .exit.text is discard at runtime, not link time, to deal with references
116      from .altinstructions and .eh_frame */
117   .exit.text : { *(.exit.text) }
118   .exit.data : { *(.exit.data) }        
119   . = ALIGN(4096);
120   __initramfs_start = .;
121   .init.ramfs : { *(.init.ramfs) }
122   __initramfs_end = .;  
123   . = ALIGN(32);
124   __per_cpu_start = .;
125   .data.percpu  : { *(.data.percpu) }
126   __per_cpu_end = .;
127   . = ALIGN(4096);
128   __init_end = .;
129
130   . = ALIGN(4096);
131   __nosave_begin = .;
132   .data_nosave : { *(.data.nosave) }
133   . = ALIGN(4096);
134   __nosave_end = .;
135
136   _end = . ;
137
138   /* Sections to be discarded */
139   /DISCARD/ : {
140         *(.exitcall.exit)
141 #ifndef CONFIG_DEBUG_INFO
142         *(.eh_frame)
143 #endif
144         }
145
146   /* DWARF 2 */
147   .debug_info     0 : { *(.debug_info) }
148   .debug_abbrev   0 : { *(.debug_abbrev) }
149   .debug_line     0 : { *(.debug_line) }
150   .debug_frame    0 : { *(.debug_frame) }
151   .debug_str      0 : { *(.debug_str) }
152   .debug_loc      0 : { *(.debug_loc) }
153   .debug_macinfo  0 : { *(.debug_macinfo) }
154   /* SGI/MIPS DWARF 2 extensions */
155   .debug_weaknames 0 : { *(.debug_weaknames) }
156   .debug_funcnames 0 : { *(.debug_funcnames) }
157   .debug_typenames 0 : { *(.debug_typenames) }
158   .debug_varnames  0 : { *(.debug_varnames) }
159
160
161   .comment 0 : { *(.comment) }
162 }