debuggers.hg

view xen/arch/x86/xen.lds.S @ 20852:4a54c794bfd4

x86: Fix and clarify 20803:50bd4235f486

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jan 14 11:46:53 2010 +0000 (2010-01-14)
parents 10c0942ed240
children 3ffdb094c2c0 924f54145fda
line source
1 /* Excerpts written by Martin Mares <mj@atrey.karlin.mff.cuni.cz> */
2 /* Modified for i386/x86-64 Xen by Keir Fraser */
4 #include <xen/config.h>
5 #include <xen/cache.h>
6 #include <asm/page.h>
7 #include <asm/percpu.h>
8 #undef ENTRY
9 #undef ALIGN
11 #ifdef __x86_64__
12 OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
13 OUTPUT_ARCH(i386:x86-64)
14 #else
15 OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
16 OUTPUT_ARCH(i386)
17 #endif
19 ENTRY(start)
20 PHDRS
21 {
22 text PT_LOAD ;
23 }
24 SECTIONS
25 {
26 . = __XEN_VIRT_START + 0x100000;
27 _start = .;
28 .text : {
29 _stext = .; /* Text and read-only data */
30 *(.text)
31 *(.fixup)
32 *(.gnu.warning)
33 _etext = .; /* End of text section */
34 } :text = 0x9090
36 .rodata : {
37 *(.rodata)
38 *(.rodata.*)
39 } :text
41 . = ALIGN(32); /* Exception table */
42 __ex_table : {
43 __start___ex_table = .;
44 *(__ex_table)
45 __stop___ex_table = .;
46 } :text
48 . = ALIGN(32); /* Pre-exception table */
49 __pre_ex_table : {
50 __start___pre_ex_table = .;
51 *(__pre_ex_table)
52 __stop___pre_ex_table = .;
53 } :text
55 .data : { /* Data */
56 *(.data)
57 CONSTRUCTORS
58 } :text
60 . = ALIGN(128);
61 .data.read_mostly : {
62 *(.data.read_mostly)
63 } :text
65 #ifdef LOCK_PROFILE
66 . = ALIGN(32);
67 __lock_profile_start = .;
68 .lockprofile.data : { *(.lockprofile.data) } :text
69 __lock_profile_end = .;
70 #endif
72 . = ALIGN(4096); /* Init code and data */
73 __init_begin = .;
74 .init.text : {
75 _sinittext = .;
76 *(.init.text)
77 _einittext = .;
78 } :text
79 .init.data : {
80 *(.init.data)
81 } :text
82 . = ALIGN(32);
83 .init.setup : {
84 __setup_start = .;
85 *(.init.setup)
86 __setup_end = .;
87 } :text
88 .initcall.init : {
89 __initcall_start = .;
90 *(.initcall1.init)
91 __initcall_end = .;
92 } :text
93 .xsm_initcall.init : {
94 __xsm_initcall_start = .;
95 *(.xsm_initcall.init)
96 __xsm_initcall_end = .;
97 } :text
98 . = ALIGN(PAGE_SIZE);
99 __init_end = .;
101 __per_cpu_shift = PERCPU_SHIFT; /* kdump assist */
102 .data.percpu : {
103 __per_cpu_start = .;
104 *(.data.percpu)
105 . = ALIGN(SMP_CACHE_BYTES);
106 *(.data.percpu.read_mostly)
107 . = ALIGN(PAGE_SIZE);
108 __per_cpu_data_end = .;
109 } :text
110 . = __per_cpu_start + (NR_CPUS << PERCPU_SHIFT);
111 . = ALIGN(PAGE_SIZE);
113 /*
114 * Do not insert anything here - the unused portion of .data.percpu
115 * will be freed/unmapped up to __bss_start (defined below).
116 */
118 .bss : { /* BSS */
119 . = ALIGN(STACK_SIZE);
120 __bss_start = .;
121 *(.bss.stack_aligned)
122 . = ALIGN(PAGE_SIZE);
123 *(.bss.page_aligned)
124 *(.bss)
125 } :text
126 _end = . ;
128 /* Sections to be discarded */
129 /DISCARD/ : {
130 *(.exit.text)
131 *(.exit.data)
132 *(.exitcall.exit)
133 *(.eh_frame)
134 }
136 /* Stabs debugging sections. */
137 .stab 0 : { *(.stab) }
138 .stabstr 0 : { *(.stabstr) }
139 .stab.excl 0 : { *(.stab.excl) }
140 .stab.exclstr 0 : { *(.stab.exclstr) }
141 .stab.index 0 : { *(.stab.index) }
142 .stab.indexstr 0 : { *(.stab.indexstr) }
143 .comment 0 : { *(.comment) }
144 }