xref: /linux/arch/sparc/vdso/vdso-layout.lds.S (revision 53597deca0e38c30e6cd4ba2114fa42d2bcd85bb)
1/*
2 * Linker script for vDSO.  This is an ELF shared object prelinked to
3 * its virtual address, and with only one read-only segment.
4 * This script controls its layout.
5 */
6
7#include <vdso/datapage.h>
8#include <vdso/page.h>
9#include <asm/vdso/vsyscall.h>
10
11SECTIONS
12{
13	/*
14	 * User/kernel shared data is before the vDSO.  This may be a little
15	 * uglier than putting it after the vDSO, but it avoids issues with
16	 * non-allocatable things that dangle past the end of the PT_LOAD
17	 * segment. Page size is 8192 for both 64-bit and 32-bit vdso binaries
18	 */
19
20	VDSO_VVAR_SYMS
21
22	. = SIZEOF_HEADERS;
23
24	.hash		: { *(.hash) }			:text
25	.gnu.hash	: { *(.gnu.hash) }
26	.dynsym		: { *(.dynsym) }
27	.dynstr		: { *(.dynstr) }
28	.gnu.version	: { *(.gnu.version) }
29	.gnu.version_d	: { *(.gnu.version_d) }
30	.gnu.version_r	: { *(.gnu.version_r) }
31
32	.dynamic	: { *(.dynamic) }		:text	:dynamic
33
34	.rodata		: {
35		*(.rodata*)
36		*(.data*)
37		*(.sdata*)
38		*(.got.plt) *(.got)
39		*(.gnu.linkonce.d.*)
40		*(.bss*)
41		*(.dynbss*)
42		*(.gnu.linkonce.b.*)
43	}						:text
44
45	.note		: { *(.note.*) }		:text	:note
46
47	.eh_frame_hdr	: { *(.eh_frame_hdr) }		:text	:eh_frame_hdr
48	.eh_frame	: { KEEP (*(.eh_frame)) }	:text
49
50
51	/*
52	 * Text is well-separated from actual data: there's plenty of
53	 * stuff that isn't used at runtime in between.
54	 */
55
56	.text		: { *(.text*) }			:text	=0x90909090,
57
58	/DISCARD/ : {
59		*(.discard)
60		*(.discard.*)
61		*(__bug_table)
62	}
63}
64
65/*
66 * Very old versions of ld do not recognize this name token; use the constant.
67 */
68#define PT_GNU_EH_FRAME	0x6474e550
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 */
74PHDRS
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