Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
torvalds
GitHub Repository: torvalds/linux
Path: blob/master/arch/x86/entry/vdso/common/vdso-layout.lds.S
121848 views
1
/* SPDX-License-Identifier: GPL-2.0 */
2
#include <asm/vdso.h>
3
#include <asm/vdso/vsyscall.h>
4
#include <vdso/datapage.h>
5
6
/*
7
* Linker script for vDSO. This is an ELF shared object prelinked to
8
* its virtual address, and with only one read-only segment.
9
* This script controls its layout.
10
*/
11
12
SECTIONS
13
{
14
/*
15
* User/kernel shared data is before the vDSO. This may be a little
16
* uglier than putting it after the vDSO, but it avoids issues with
17
* non-allocatable things that dangle past the end of the PT_LOAD
18
* segment.
19
*/
20
21
VDSO_VVAR_SYMS
22
23
vclock_pages = VDSO_VCLOCK_PAGES_START(vdso_u_data);
24
pvclock_page = vclock_pages + VDSO_PAGE_PVCLOCK_OFFSET * PAGE_SIZE;
25
hvclock_page = vclock_pages + VDSO_PAGE_HVCLOCK_OFFSET * PAGE_SIZE;
26
27
. = SIZEOF_HEADERS;
28
29
.hash : { *(.hash) } :text
30
.gnu.hash : { *(.gnu.hash) }
31
.dynsym : { *(.dynsym) }
32
.dynstr : { *(.dynstr) }
33
.gnu.version : { *(.gnu.version) }
34
.gnu.version_d : { *(.gnu.version_d) }
35
.gnu.version_r : { *(.gnu.version_r) }
36
37
.dynamic : { *(.dynamic) } :text :dynamic
38
39
.rodata : {
40
*(.rodata*)
41
*(.data*)
42
*(.sdata*)
43
*(.got.plt) *(.got)
44
*(.gnu.linkonce.d.*)
45
*(.bss*)
46
*(.dynbss*)
47
*(.gnu.linkonce.b.*)
48
} :text
49
50
.note.gnu.property : {
51
*(.note.gnu.property)
52
} :text :note :gnu_property
53
.note : {
54
*(.note*)
55
} :text :note
56
57
.eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
58
.eh_frame : {
59
KEEP (*(.eh_frame))
60
*(.eh_frame.*)
61
} :text
62
63
/*
64
* Text is well-separated from actual data: there's plenty of
65
* stuff that isn't used at runtime in between.
66
*/
67
68
.text : {
69
*(.text*)
70
} :text =0x90909090,
71
72
73
74
.altinstructions : { *(.altinstructions) } :text
75
.altinstr_replacement : { *(.altinstr_replacement) } :text
76
77
__ex_table : { *(__ex_table) } :text
78
79
/DISCARD/ : {
80
*(.discard)
81
*(.discard.*)
82
*(__bug_table)
83
}
84
}
85
86
/*
87
* Very old versions of ld do not recognize this name token; use the constant.
88
*/
89
#define PT_GNU_EH_FRAME 0x6474e550
90
#define PT_GNU_STACK 0x6474e551
91
#define PT_GNU_PROPERTY 0x6474e553
92
93
/*
94
* We must supply the ELF program headers explicitly to get just one
95
* PT_LOAD segment, and set the flags explicitly to make segments read-only.
96
*/
97
#define PF_R FLAGS(4)
98
#define PF_RW FLAGS(6)
99
#define PF_RX FLAGS(5)
100
101
PHDRS
102
{
103
text PT_LOAD PF_RX FILEHDR PHDRS;
104
dynamic PT_DYNAMIC PF_R;
105
note PT_NOTE PF_R;
106
eh_frame_hdr PT_GNU_EH_FRAME PF_R;
107
gnu_stack PT_GNU_STACK PF_RW;
108
gnu_property PT_GNU_PROPERTY PF_R;
109
}
110
111