blob: 3cb1abc00e24f585119def5e51cc72da0d47ea37 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Roland McGrath1a43be72007-10-15 20:40:29 -07002 * 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.
Linus Torvalds1da177e2005-04-16 15:20:36 -07006 */
7
Linus Torvalds1da177e2005-04-16 15:20:36 -07008
9#include <asm/system.h>
10
11SECTIONS
12{
Roland McGrath1a43be72007-10-15 20:40:29 -070013 . = GATE_ADDR + SIZEOF_HEADERS;
Linus Torvalds1da177e2005-04-16 15:20:36 -070014
Roland McGrath1a43be72007-10-15 20:40:29 -070015 .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) }
Linus Torvalds1da177e2005-04-16 15:20:36 -070022
Roland McGrath172c5102007-10-18 15:11:08 -070023 .note : { *(.note*) } :readable :note
24
Roland McGrath1a43be72007-10-15 20:40:29 -070025 .dynamic : { *(.dynamic) } :readable :dynamic
Linus Torvalds1da177e2005-04-16 15:20:36 -070026
Roland McGrath1a43be72007-10-15 20:40:29 -070027 /*
28 * This linker script is used both with -r and with -shared. For
29 * the layouts to match, we need to skip more than enough space for
30 * the dynamic symbol table et al. If this amount is insufficient,
31 * ld -shared will barf. Just increase it here.
32 */
Andrew Morton1f0abae2007-12-05 14:32:13 -080033 . = GATE_ADDR + 0x600;
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
Roland McGrath1a43be72007-10-15 20:40:29 -070035 .data.patch : {
36 __start_gate_mckinley_e9_patchlist = .;
37 *(.data.patch.mckinley_e9)
38 __end_gate_mckinley_e9_patchlist = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -070039
Roland McGrath1a43be72007-10-15 20:40:29 -070040 __start_gate_vtop_patchlist = .;
41 *(.data.patch.vtop)
42 __end_gate_vtop_patchlist = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -070043
Roland McGrath1a43be72007-10-15 20:40:29 -070044 __start_gate_fsyscall_patchlist = .;
45 *(.data.patch.fsyscall_table)
46 __end_gate_fsyscall_patchlist = .;
47
48 __start_gate_brl_fsys_bubble_down_patchlist = .;
49 *(.data.patch.brl_fsys_bubble_down)
50 __end_gate_brl_fsys_bubble_down_patchlist = .;
51 } :readable
52
53 .IA_64.unwind_info : { *(.IA_64.unwind_info*) }
54 .IA_64.unwind : { *(.IA_64.unwind*) } :readable :unwind
Linus Torvalds1da177e2005-04-16 15:20:36 -070055#ifdef HAVE_BUGGY_SEGREL
Roland McGrath1a43be72007-10-15 20:40:29 -070056 .text (GATE_ADDR + PAGE_SIZE) : { *(.text) *(.text.*) } :readable
Linus Torvalds1da177e2005-04-16 15:20:36 -070057#else
Roland McGrath1a43be72007-10-15 20:40:29 -070058 . = ALIGN(PERCPU_PAGE_SIZE) + (. & (PERCPU_PAGE_SIZE - 1));
59 .text : { *(.text) *(.text.*) } :epc
Linus Torvalds1da177e2005-04-16 15:20:36 -070060#endif
61
Roland McGrath1a43be72007-10-15 20:40:29 -070062 /DISCARD/ : {
63 *(.got.plt) *(.got)
64 *(.data .data.* .gnu.linkonce.d.*)
65 *(.dynbss)
66 *(.bss .bss.* .gnu.linkonce.b.*)
67 *(__ex_table)
68 *(__mca_table)
69 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070070}
71
72/*
Roland McGrath1a43be72007-10-15 20:40:29 -070073 * ld does not recognize this name token; use the constant.
74 */
75#define PT_IA_64_UNWIND 0x70000001
76
77/*
Linus Torvalds1da177e2005-04-16 15:20:36 -070078 * We must supply the ELF program headers explicitly to get just one
79 * PT_LOAD segment, and set the flags explicitly to make segments read-only.
80 */
81PHDRS
82{
Roland McGrath1a43be72007-10-15 20:40:29 -070083 readable PT_LOAD FILEHDR PHDRS FLAGS(4); /* PF_R */
Linus Torvalds1da177e2005-04-16 15:20:36 -070084#ifndef HAVE_BUGGY_SEGREL
Roland McGrath1a43be72007-10-15 20:40:29 -070085 epc PT_LOAD FILEHDR PHDRS FLAGS(1); /* PF_X */
Linus Torvalds1da177e2005-04-16 15:20:36 -070086#endif
Roland McGrath1a43be72007-10-15 20:40:29 -070087 dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
Roland McGrath172c5102007-10-18 15:11:08 -070088 note PT_NOTE FLAGS(4); /* PF_R */
Roland McGrath1a43be72007-10-15 20:40:29 -070089 unwind PT_IA_64_UNWIND;
Linus Torvalds1da177e2005-04-16 15:20:36 -070090}
91
92/*
93 * This controls what symbols we export from the DSO.
94 */
95VERSION
96{
Roland McGrath1a43be72007-10-15 20:40:29 -070097 LINUX_2.5 {
98 global:
99 __kernel_syscall_via_break;
100 __kernel_syscall_via_epc;
101 __kernel_sigtramp;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102
Roland McGrath1a43be72007-10-15 20:40:29 -0700103 local: *;
104 };
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105}
106
107/* The ELF entry point can be used to set the AT_SYSINFO value. */
108ENTRY(__kernel_syscall_via_epc)