Path: blob/master/arch/x86/entry/vdso/common/vdso-layout.lds.S
121848 views
/* SPDX-License-Identifier: GPL-2.0 */1#include <asm/vdso.h>2#include <asm/vdso/vsyscall.h>3#include <vdso/datapage.h>45/*6* Linker script for vDSO. This is an ELF shared object prelinked to7* its virtual address, and with only one read-only segment.8* This script controls its layout.9*/1011SECTIONS12{13/*14* User/kernel shared data is before the vDSO. This may be a little15* uglier than putting it after the vDSO, but it avoids issues with16* non-allocatable things that dangle past the end of the PT_LOAD17* segment.18*/1920VDSO_VVAR_SYMS2122vclock_pages = VDSO_VCLOCK_PAGES_START(vdso_u_data);23pvclock_page = vclock_pages + VDSO_PAGE_PVCLOCK_OFFSET * PAGE_SIZE;24hvclock_page = vclock_pages + VDSO_PAGE_HVCLOCK_OFFSET * PAGE_SIZE;2526. = SIZEOF_HEADERS;2728.hash : { *(.hash) } :text29.gnu.hash : { *(.gnu.hash) }30.dynsym : { *(.dynsym) }31.dynstr : { *(.dynstr) }32.gnu.version : { *(.gnu.version) }33.gnu.version_d : { *(.gnu.version_d) }34.gnu.version_r : { *(.gnu.version_r) }3536.dynamic : { *(.dynamic) } :text :dynamic3738.rodata : {39*(.rodata*)40*(.data*)41*(.sdata*)42*(.got.plt) *(.got)43*(.gnu.linkonce.d.*)44*(.bss*)45*(.dynbss*)46*(.gnu.linkonce.b.*)47} :text4849.note.gnu.property : {50*(.note.gnu.property)51} :text :note :gnu_property52.note : {53*(.note*)54} :text :note5556.eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr57.eh_frame : {58KEEP (*(.eh_frame))59*(.eh_frame.*)60} :text6162/*63* Text is well-separated from actual data: there's plenty of64* stuff that isn't used at runtime in between.65*/6667.text : {68*(.text*)69} :text =0x90909090,70717273.altinstructions : { *(.altinstructions) } :text74.altinstr_replacement : { *(.altinstr_replacement) } :text7576__ex_table : { *(__ex_table) } :text7778/DISCARD/ : {79*(.discard)80*(.discard.*)81*(__bug_table)82}83}8485/*86* Very old versions of ld do not recognize this name token; use the constant.87*/88#define PT_GNU_EH_FRAME 0x6474e55089#define PT_GNU_STACK 0x6474e55190#define PT_GNU_PROPERTY 0x6474e5539192/*93* We must supply the ELF program headers explicitly to get just one94* PT_LOAD segment, and set the flags explicitly to make segments read-only.95*/96#define PF_R FLAGS(4)97#define PF_RW FLAGS(6)98#define PF_RX FLAGS(5)99100PHDRS101{102text PT_LOAD PF_RX FILEHDR PHDRS;103dynamic PT_DYNAMIC PF_R;104note PT_NOTE PF_R;105eh_frame_hdr PT_GNU_EH_FRAME PF_R;106gnu_stack PT_GNU_STACK PF_RW;107gnu_property PT_GNU_PROPERTY PF_R;108}109110111