Merge branch 'xen-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen
[sfrench/cifs-2.6.git] / arch / ia64 / kernel / gate.lds.S
1 /*
2  * Linker script for gate DSO.  The gate pages are an ELF shared object
3  * prelinked to its virtual address, with only one read-only segment and
4  * one execute-only segment (both fit in one page).  This script controls
5  * its layout.
6  */
7
8
9 #include <asm/system.h>
10
11 SECTIONS
12 {
13         . = GATE_ADDR + SIZEOF_HEADERS;
14
15         .hash                   : { *(.hash) }          :readable
16         .gnu.hash               : { *(.gnu.hash) }
17         .dynsym                 : { *(.dynsym) }
18         .dynstr                 : { *(.dynstr) }
19         .gnu.version            : { *(.gnu.version) }
20         .gnu.version_d          : { *(.gnu.version_d) }
21         .gnu.version_r          : { *(.gnu.version_r) }
22
23         .dynamic                : { *(.dynamic) }       :readable       :dynamic
24
25         /*
26          * This linker script is used both with -r and with -shared.  For
27          * the layouts to match, we need to skip more than enough space for
28          * the dynamic symbol table et al.  If this amount is insufficient,
29          * ld -shared will barf.  Just increase it here.
30          */
31         . = GATE_ADDR + 0x500;
32
33         .data.patch             : {
34                 __start_gate_mckinley_e9_patchlist = .;
35                 *(.data.patch.mckinley_e9)
36                 __end_gate_mckinley_e9_patchlist = .;
37
38                 __start_gate_vtop_patchlist = .;
39                 *(.data.patch.vtop)
40                 __end_gate_vtop_patchlist = .;
41
42                 __start_gate_fsyscall_patchlist = .;
43                 *(.data.patch.fsyscall_table)
44                 __end_gate_fsyscall_patchlist = .;
45
46                 __start_gate_brl_fsys_bubble_down_patchlist = .;
47                 *(.data.patch.brl_fsys_bubble_down)
48                 __end_gate_brl_fsys_bubble_down_patchlist = .;
49         }                                               :readable
50
51         .IA_64.unwind_info      : { *(.IA_64.unwind_info*) }
52         .IA_64.unwind           : { *(.IA_64.unwind*) } :readable       :unwind
53 #ifdef HAVE_BUGGY_SEGREL
54         .text (GATE_ADDR + PAGE_SIZE) : { *(.text) *(.text.*) } :readable
55 #else
56         . = ALIGN(PERCPU_PAGE_SIZE) + (. & (PERCPU_PAGE_SIZE - 1));
57         .text                   : { *(.text) *(.text.*) }       :epc
58 #endif
59
60         /DISCARD/               : {
61                 *(.got.plt) *(.got)
62                 *(.data .data.* .gnu.linkonce.d.*)
63                 *(.dynbss)
64                 *(.bss .bss.* .gnu.linkonce.b.*)
65                 *(__ex_table)
66                 *(__mca_table)
67         }
68 }
69
70 /*
71  * ld does not recognize this name token; use the constant.
72  */
73 #define PT_IA_64_UNWIND 0x70000001
74
75 /*
76  * We must supply the ELF program headers explicitly to get just one
77  * PT_LOAD segment, and set the flags explicitly to make segments read-only.
78  */
79 PHDRS
80 {
81         readable        PT_LOAD FILEHDR PHDRS   FLAGS(4);       /* PF_R */
82 #ifndef HAVE_BUGGY_SEGREL
83         epc             PT_LOAD FILEHDR PHDRS   FLAGS(1);       /* PF_X */
84 #endif
85         dynamic         PT_DYNAMIC              FLAGS(4);       /* PF_R */
86         unwind          PT_IA_64_UNWIND;
87 }
88
89 /*
90  * This controls what symbols we export from the DSO.
91  */
92 VERSION
93 {
94         LINUX_2.5 {
95         global:
96                 __kernel_syscall_via_break;
97                 __kernel_syscall_via_epc;
98                 __kernel_sigtramp;
99
100         local: *;
101         };
102 }
103
104 /* The ELF entry point can be used to set the AT_SYSINFO value.  */
105 ENTRY(__kernel_syscall_via_epc)