| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* | 
| Roland McGrath | 1a43be7 | 2007-10-15 20:40:29 -0700 | [diff] [blame] | 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. | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | */ | 
|  | 7 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 |  | 
|  | 9 | #include <asm/system.h> | 
| Isaku Yamahata | e4ff5b8 | 2009-03-04 21:05:42 +0900 | [diff] [blame] | 10 | #include "paravirt_patchlist.h" | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 |  | 
|  | 12 | SECTIONS | 
|  | 13 | { | 
| Roland McGrath | 1a43be7 | 2007-10-15 20:40:29 -0700 | [diff] [blame] | 14 | . = GATE_ADDR + SIZEOF_HEADERS; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 |  | 
| Roland McGrath | 1a43be7 | 2007-10-15 20:40:29 -0700 | [diff] [blame] | 16 | .hash			: { *(.hash) }		:readable | 
|  | 17 | .gnu.hash		: { *(.gnu.hash) } | 
|  | 18 | .dynsym			: { *(.dynsym) } | 
|  | 19 | .dynstr			: { *(.dynstr) } | 
|  | 20 | .gnu.version		: { *(.gnu.version) } | 
|  | 21 | .gnu.version_d		: { *(.gnu.version_d) } | 
|  | 22 | .gnu.version_r		: { *(.gnu.version_r) } | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 |  | 
| Roland McGrath | 172c510 | 2007-10-18 15:11:08 -0700 | [diff] [blame] | 24 | .note			: { *(.note*) }		:readable	:note | 
|  | 25 |  | 
| Roland McGrath | 1a43be7 | 2007-10-15 20:40:29 -0700 | [diff] [blame] | 26 | .dynamic		: { *(.dynamic) }	:readable	:dynamic | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 |  | 
| Roland McGrath | 1a43be7 | 2007-10-15 20:40:29 -0700 | [diff] [blame] | 28 | /* | 
|  | 29 | * This linker script is used both with -r and with -shared.  For | 
|  | 30 | * the layouts to match, we need to skip more than enough space for | 
|  | 31 | * the dynamic symbol table et al.  If this amount is insufficient, | 
|  | 32 | * ld -shared will barf.  Just increase it here. | 
|  | 33 | */ | 
| Andrew Morton | 1f0abae | 2007-12-05 14:32:13 -0800 | [diff] [blame] | 34 | . = GATE_ADDR + 0x600; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 |  | 
| Roland McGrath | 1a43be7 | 2007-10-15 20:40:29 -0700 | [diff] [blame] | 36 | .data.patch		: { | 
| Isaku Yamahata | e4ff5b8 | 2009-03-04 21:05:42 +0900 | [diff] [blame] | 37 | __paravirt_start_gate_mckinley_e9_patchlist = .; | 
| Roland McGrath | 1a43be7 | 2007-10-15 20:40:29 -0700 | [diff] [blame] | 38 | *(.data.patch.mckinley_e9) | 
| Isaku Yamahata | e4ff5b8 | 2009-03-04 21:05:42 +0900 | [diff] [blame] | 39 | __paravirt_end_gate_mckinley_e9_patchlist = .; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 |  | 
| Isaku Yamahata | e4ff5b8 | 2009-03-04 21:05:42 +0900 | [diff] [blame] | 41 | __paravirt_start_gate_vtop_patchlist = .; | 
| Roland McGrath | 1a43be7 | 2007-10-15 20:40:29 -0700 | [diff] [blame] | 42 | *(.data.patch.vtop) | 
| Isaku Yamahata | e4ff5b8 | 2009-03-04 21:05:42 +0900 | [diff] [blame] | 43 | __paravirt_end_gate_vtop_patchlist = .; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 |  | 
| Isaku Yamahata | e4ff5b8 | 2009-03-04 21:05:42 +0900 | [diff] [blame] | 45 | __paravirt_start_gate_fsyscall_patchlist = .; | 
| Roland McGrath | 1a43be7 | 2007-10-15 20:40:29 -0700 | [diff] [blame] | 46 | *(.data.patch.fsyscall_table) | 
| Isaku Yamahata | e4ff5b8 | 2009-03-04 21:05:42 +0900 | [diff] [blame] | 47 | __paravirt_end_gate_fsyscall_patchlist = .; | 
| Roland McGrath | 1a43be7 | 2007-10-15 20:40:29 -0700 | [diff] [blame] | 48 |  | 
| Isaku Yamahata | e4ff5b8 | 2009-03-04 21:05:42 +0900 | [diff] [blame] | 49 | __paravirt_start_gate_brl_fsys_bubble_down_patchlist = .; | 
| Roland McGrath | 1a43be7 | 2007-10-15 20:40:29 -0700 | [diff] [blame] | 50 | *(.data.patch.brl_fsys_bubble_down) | 
| Isaku Yamahata | e4ff5b8 | 2009-03-04 21:05:42 +0900 | [diff] [blame] | 51 | __paravirt_end_gate_brl_fsys_bubble_down_patchlist = .; | 
| Roland McGrath | 1a43be7 | 2007-10-15 20:40:29 -0700 | [diff] [blame] | 52 | }						:readable | 
|  | 53 |  | 
|  | 54 | .IA_64.unwind_info	: { *(.IA_64.unwind_info*) } | 
|  | 55 | .IA_64.unwind		: { *(.IA_64.unwind*) }	:readable	:unwind | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | #ifdef HAVE_BUGGY_SEGREL | 
| Roland McGrath | 1a43be7 | 2007-10-15 20:40:29 -0700 | [diff] [blame] | 57 | .text (GATE_ADDR + PAGE_SIZE) : { *(.text) *(.text.*) }	:readable | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 58 | #else | 
| Roland McGrath | 1a43be7 | 2007-10-15 20:40:29 -0700 | [diff] [blame] | 59 | . = ALIGN(PERCPU_PAGE_SIZE) + (. & (PERCPU_PAGE_SIZE - 1)); | 
|  | 60 | .text			: { *(.text) *(.text.*) }	:epc | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 61 | #endif | 
|  | 62 |  | 
| Roland McGrath | 1a43be7 | 2007-10-15 20:40:29 -0700 | [diff] [blame] | 63 | /DISCARD/		: { | 
|  | 64 | *(.got.plt) *(.got) | 
|  | 65 | *(.data .data.* .gnu.linkonce.d.*) | 
|  | 66 | *(.dynbss) | 
|  | 67 | *(.bss .bss.* .gnu.linkonce.b.*) | 
|  | 68 | *(__ex_table) | 
|  | 69 | *(__mca_table) | 
|  | 70 | } | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 71 | } | 
|  | 72 |  | 
|  | 73 | /* | 
| Roland McGrath | 1a43be7 | 2007-10-15 20:40:29 -0700 | [diff] [blame] | 74 | * ld does not recognize this name token; use the constant. | 
|  | 75 | */ | 
|  | 76 | #define	PT_IA_64_UNWIND	0x70000001 | 
|  | 77 |  | 
|  | 78 | /* | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 79 | * We must supply the ELF program headers explicitly to get just one | 
|  | 80 | * PT_LOAD segment, and set the flags explicitly to make segments read-only. | 
|  | 81 | */ | 
|  | 82 | PHDRS | 
|  | 83 | { | 
| Roland McGrath | 1a43be7 | 2007-10-15 20:40:29 -0700 | [diff] [blame] | 84 | readable	PT_LOAD	FILEHDR	PHDRS	FLAGS(4);	/* PF_R */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 85 | #ifndef HAVE_BUGGY_SEGREL | 
| Roland McGrath | 1a43be7 | 2007-10-15 20:40:29 -0700 | [diff] [blame] | 86 | epc		PT_LOAD	FILEHDR PHDRS	FLAGS(1);	/* PF_X */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 87 | #endif | 
| Roland McGrath | 1a43be7 | 2007-10-15 20:40:29 -0700 | [diff] [blame] | 88 | dynamic		PT_DYNAMIC		FLAGS(4);	/* PF_R */ | 
| Roland McGrath | 172c510 | 2007-10-18 15:11:08 -0700 | [diff] [blame] | 89 | note		PT_NOTE			FLAGS(4);	/* PF_R */ | 
| Roland McGrath | 1a43be7 | 2007-10-15 20:40:29 -0700 | [diff] [blame] | 90 | unwind		PT_IA_64_UNWIND; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 91 | } | 
|  | 92 |  | 
|  | 93 | /* | 
|  | 94 | * This controls what symbols we export from the DSO. | 
|  | 95 | */ | 
|  | 96 | VERSION | 
|  | 97 | { | 
| Roland McGrath | 1a43be7 | 2007-10-15 20:40:29 -0700 | [diff] [blame] | 98 | LINUX_2.5 { | 
|  | 99 | global: | 
|  | 100 | __kernel_syscall_via_break; | 
|  | 101 | __kernel_syscall_via_epc; | 
|  | 102 | __kernel_sigtramp; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 103 |  | 
| Roland McGrath | 1a43be7 | 2007-10-15 20:40:29 -0700 | [diff] [blame] | 104 | local: *; | 
|  | 105 | }; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 106 | } | 
|  | 107 |  | 
|  | 108 | /* The ELF entry point can be used to set the AT_SYSINFO value.  */ | 
|  | 109 | ENTRY(__kernel_syscall_via_epc) |