Sync with trunk r58740.
[reactos.git] / ntoskrnl / ntoskrnl_amd64.lds
1 OUTPUT_FORMAT(pei-x86-64)
2 ENTRY(_mainCRTStartup)
3 SECTIONS
4 {
5 .text __image_base__ + __section_alignment__ :
6 {
7 __text_start__ = .;
8 *(.init)
9 *(.text)
10 *(SORT(.text$*))
11 *(.glue_7t)
12 *(.glue_7)
13 ___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
14 LONG (-1); *(.ctors); *(.ctor); LONG (0);
15 ___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
16 LONG (-1); *(.dtors); *(.dtor); LONG (0);
17 *(.fini)
18 /* ??? Why is .gcc_exc here? */
19 *(.gcc_exc)
20 __text_end__ = .;
21 *(.gcc_except_table)
22 }
23 init BLOCK(__section_alignment__) :
24 {
25 __init_start__ = . ;
26 *(init)
27 __init_end__ = . ;
28 }
29 /* The Cygwin32 library uses a section to avoid copying certain data
30 on fork. This used to be named ".data". The linker used
31 to include this between __data_start__ and __data_end__, but that
32 breaks building the cygwin32 dll. Instead, we name the section
33 ".data_cygwin_nocopy" and explictly include it after __data_end__. */
34 .data BLOCK(__section_alignment__) :
35 {
36 __data_start__ = . ;
37 *(.data)
38 *(.data2)
39 *(SORT(.data$*))
40 __data_end__ = . ;
41 *(.data_cygwin_nocopy)
42 }
43 .rdata BLOCK(__section_alignment__) :
44 {
45 *(.rdata)
46 *(SORT(.rdata$*))
47 /* For some reason mingw likes to merge it here. I don't! */
48 /* *(.eh_frame) */
49 }
50 .edata BLOCK(__section_alignment__) :
51 {
52 *(.edata)
53 }
54 /DISCARD/ :
55 {
56 *(.debug$S)
57 *(.debug$T)
58 *(.debug$F)
59 *(.drectve)
60 }
61
62 .idata BLOCK(__section_alignment__) :
63 {
64 /* This cannot currently be handled with grouped sections.
65 See pe.em:sort_sections. */
66 SORT(*)(.idata$2)
67 SORT(*)(.idata$3)
68 /* These zeroes mark the end of the import list. */
69 LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
70 SORT(*)(.idata$4)
71 SORT(*)(.idata$5)
72 SORT(*)(.idata$6)
73 SORT(*)(.idata$7)
74 }
75 .CRT BLOCK(__section_alignment__) :
76 {
77 *(SORT(.CRT$*))
78 }
79 .rsrc BLOCK(__section_alignment__) :
80 {
81 *(.rsrc)
82 *(SORT(.rsrc$*))
83 }
84 .bss BLOCK(__section_alignment__) :
85 {
86 __bss_start__ = . ;
87 *(.bss)
88 *(COMMON)
89 __bss_end__ = . ;
90 }
91 .reloc BLOCK(__section_alignment__) :
92 {
93 *(.reloc)
94 /* These zeroes mark the end of the reloc section. */
95 LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
96 }
97 .stab BLOCK(__section_alignment__) (NOLOAD) :
98 {
99 [ .stab ]
100 }
101 .stabstr BLOCK(__section_alignment__) (NOLOAD) :
102 {
103 [ .stabstr ]
104 }
105 /* DWARF debug sections.
106 Symbols in the DWARF debugging sections are relative to the beginning
107 of the section. Unlike other targets that fake this by putting the
108 section VMA at 0, the PE format will not allow it. */
109 /* DWARF 1.1 and DWARF 2. */
110 .debug_aranges BLOCK(__section_alignment__) (NOLOAD) :
111 {
112 *(.debug_aranges)
113 }
114 .debug_pubnames BLOCK(__section_alignment__) (NOLOAD) :
115 {
116 *(.debug_pubnames)
117 }
118 /* DWARF 2. */
119 .debug_info BLOCK(__section_alignment__) (NOLOAD) :
120 {
121 *(.debug_info) *(.gnu.linkonce.wi.*)
122 }
123 .debug_abbrev BLOCK(__section_alignment__) (NOLOAD) :
124 {
125 *(.debug_abbrev)
126 }
127 .debug_line BLOCK(__section_alignment__) (NOLOAD) :
128 {
129 *(.debug_line)
130 }
131 .debug_frame BLOCK(__section_alignment__) (NOLOAD) :
132 {
133 *(.debug_frame)
134 }
135 .debug_str BLOCK(__section_alignment__) (NOLOAD) :
136 {
137 *(.debug_str)
138 }
139 .debug_loc BLOCK(__section_alignment__) (NOLOAD) :
140 {
141 *(.debug_loc)
142 }
143 .debug_macinfo BLOCK(__section_alignment__) (NOLOAD) :
144 {
145 *(.debug_macinfo)
146 }
147 /* SGI/MIPS DWARF 2 extensions. */
148 .debug_weaknames BLOCK(__section_alignment__) (NOLOAD) :
149 {
150 *(.debug_weaknames)
151 }
152 .debug_funcnames BLOCK(__section_alignment__) (NOLOAD) :
153 {
154 *(.debug_funcnames)
155 }
156 .debug_typenames BLOCK(__section_alignment__) (NOLOAD) :
157 {
158 *(.debug_typenames)
159 }
160 .debug_varnames BLOCK(__section_alignment__) (NOLOAD) :
161 {
162 *(.debug_varnames)
163 }
164 /* DWARF 3. */
165 .debug_ranges BLOCK(__section_alignment__) (NOLOAD) :
166 {
167 *(.debug_ranges)
168 }
169 .eh_frame BLOCK(__section_alignment__) :
170 {
171 *(.eh_frame)
172 }
173 }
174