Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * GNU linker script for the VDSO library.
0004 *
0005  * Copyright (C) 2012 ARM Limited
0006  *
0007  * Author: Will Deacon <will.deacon@arm.com>
0008  * Heavily based on the vDSO linker scripts for other archs.
0009  */
0010 
0011 #include <linux/const.h>
0012 #include <asm/page.h>
0013 #include <asm/vdso.h>
0014 #include <asm-generic/vmlinux.lds.h>
0015 
0016 OUTPUT_FORMAT("elf64-littleaarch64", "elf64-bigaarch64", "elf64-littleaarch64")
0017 OUTPUT_ARCH(aarch64)
0018 
0019 SECTIONS
0020 {
0021     PROVIDE(_vdso_data = . - __VVAR_PAGES * PAGE_SIZE);
0022 #ifdef CONFIG_TIME_NS
0023     PROVIDE(_timens_data = _vdso_data + PAGE_SIZE);
0024 #endif
0025     . = VDSO_LBASE + SIZEOF_HEADERS;
0026 
0027     .hash       : { *(.hash) }          :text
0028     .gnu.hash   : { *(.gnu.hash) }
0029     .dynsym     : { *(.dynsym) }
0030     .dynstr     : { *(.dynstr) }
0031     .gnu.version    : { *(.gnu.version) }
0032     .gnu.version_d  : { *(.gnu.version_d) }
0033     .gnu.version_r  : { *(.gnu.version_r) }
0034 
0035     /*
0036      * Discard .note.gnu.property sections which are unused and have
0037      * different alignment requirement from vDSO note sections.
0038      */
0039     /DISCARD/   : {
0040         *(.note.GNU-stack .note.gnu.property)
0041     }
0042     .note       : { *(.note.*) }        :text   :note
0043 
0044     . = ALIGN(16);
0045 
0046     .text       : { *(.text*) }         :text   =0xd503201f
0047     PROVIDE (__etext = .);
0048     PROVIDE (_etext = .);
0049     PROVIDE (etext = .);
0050 
0051     .dynamic    : { *(.dynamic) }       :text   :dynamic
0052 
0053     .rela.dyn   : ALIGN(8) { *(.rela .rela*) }
0054 
0055     .rodata     : {
0056         *(.rodata*)
0057         *(.got)
0058         *(.got.plt)
0059         *(.plt)
0060         *(.plt.*)
0061         *(.iplt)
0062         *(.igot .igot.plt)
0063     }                       :text
0064 
0065     _end = .;
0066     PROVIDE(end = .);
0067 
0068     DWARF_DEBUG
0069     ELF_DETAILS
0070 
0071     /DISCARD/   : {
0072         *(.data .data.* .gnu.linkonce.d.* .sdata*)
0073         *(.bss .sbss .dynbss .dynsbss)
0074         *(.eh_frame .eh_frame_hdr)
0075     }
0076 }
0077 
0078 /*
0079  * We must supply the ELF program headers explicitly to get just one
0080  * PT_LOAD segment, and set the flags explicitly to make segments read-only.
0081  */
0082 PHDRS
0083 {
0084     text        PT_LOAD     FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
0085     dynamic     PT_DYNAMIC  FLAGS(4);       /* PF_R */
0086     note        PT_NOTE     FLAGS(4);       /* PF_R */
0087 }
0088 
0089 /*
0090  * This controls what symbols we export from the DSO.
0091  */
0092 VERSION
0093 {
0094     LINUX_2.6.39 {
0095     global:
0096         __kernel_rt_sigreturn;
0097         __kernel_gettimeofday;
0098         __kernel_clock_gettime;
0099         __kernel_clock_getres;
0100     local: *;
0101     };
0102 }
0103 
0104 /*
0105  * Make the sigreturn code visible to the kernel.
0106  */
0107 VDSO_sigtramp       = __kernel_rt_sigreturn;