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