Will Deacon | 9031fef | 2012-03-05 11:49:31 +0000 | [diff] [blame] | 1 | /* |
| 2 | * GNU linker script for the VDSO library. |
| 3 | * |
| 4 | * Copyright (C) 2012 ARM Limited |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License version 2 as |
| 8 | * published by the Free Software Foundation. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | * |
| 18 | * Author: Will Deacon <will.deacon@arm.com> |
| 19 | * Heavily based on the vDSO linker scripts for other archs. |
| 20 | */ |
| 21 | |
| 22 | #include <linux/const.h> |
| 23 | #include <asm/page.h> |
| 24 | #include <asm/vdso.h> |
| 25 | |
| 26 | OUTPUT_FORMAT("elf64-littleaarch64", "elf64-bigaarch64", "elf64-littleaarch64") |
| 27 | OUTPUT_ARCH(aarch64) |
| 28 | |
| 29 | SECTIONS |
| 30 | { |
| 31 | . = VDSO_LBASE + SIZEOF_HEADERS; |
| 32 | |
| 33 | .hash : { *(.hash) } :text |
| 34 | .gnu.hash : { *(.gnu.hash) } |
| 35 | .dynsym : { *(.dynsym) } |
| 36 | .dynstr : { *(.dynstr) } |
| 37 | .gnu.version : { *(.gnu.version) } |
| 38 | .gnu.version_d : { *(.gnu.version_d) } |
| 39 | .gnu.version_r : { *(.gnu.version_r) } |
| 40 | |
| 41 | .note : { *(.note.*) } :text :note |
| 42 | |
| 43 | . = ALIGN(16); |
| 44 | |
| 45 | .text : { *(.text*) } :text =0xd503201f |
| 46 | PROVIDE (__etext = .); |
| 47 | PROVIDE (_etext = .); |
| 48 | PROVIDE (etext = .); |
| 49 | |
| 50 | .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr |
| 51 | .eh_frame : { KEEP (*(.eh_frame)) } :text |
| 52 | |
| 53 | .dynamic : { *(.dynamic) } :text :dynamic |
| 54 | |
| 55 | .rodata : { *(.rodata*) } :text |
| 56 | |
| 57 | _end = .; |
| 58 | PROVIDE(end = .); |
| 59 | |
| 60 | . = ALIGN(PAGE_SIZE); |
| 61 | PROVIDE(_vdso_data = .); |
| 62 | |
| 63 | /DISCARD/ : { |
| 64 | *(.note.GNU-stack) |
| 65 | *(.data .data.* .gnu.linkonce.d.* .sdata*) |
| 66 | *(.bss .sbss .dynbss .dynsbss) |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | /* |
| 71 | * We must supply the ELF program headers explicitly to get just one |
| 72 | * PT_LOAD segment, and set the flags explicitly to make segments read-only. |
| 73 | */ |
| 74 | PHDRS |
| 75 | { |
| 76 | text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */ |
| 77 | dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ |
| 78 | note PT_NOTE FLAGS(4); /* PF_R */ |
| 79 | eh_frame_hdr PT_GNU_EH_FRAME; |
| 80 | } |
| 81 | |
| 82 | /* |
| 83 | * This controls what symbols we export from the DSO. |
| 84 | */ |
| 85 | VERSION |
| 86 | { |
| 87 | LINUX_2.6.39 { |
| 88 | global: |
| 89 | __kernel_rt_sigreturn; |
| 90 | __kernel_gettimeofday; |
| 91 | __kernel_clock_gettime; |
| 92 | __kernel_clock_getres; |
| 93 | local: *; |
| 94 | }; |
| 95 | } |
| 96 | |
| 97 | /* |
| 98 | * Make the sigreturn code visible to the kernel. |
| 99 | */ |
| 100 | VDSO_sigtramp = __kernel_rt_sigreturn; |