1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Adapted from arm64 version.
4 *
5 * GNU linker script for the VDSO library.
6 * Heavily based on the vDSO linker scripts for other archs.
7 *
8 * Copyright (C) 2012-2018 ARM Limited
9 */
10
11#include <linux/const.h>
12#include <asm/page.h>
13#include <asm/vdso.h>
14#include <asm-generic/vmlinux.lds.h>
15
16OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
17OUTPUT_ARCH(arm)
18
19SECTIONS
20{
21	PROVIDE_HIDDEN(_vdso_data = . - __VVAR_PAGES * PAGE_SIZE);
22#ifdef CONFIG_TIME_NS
23	PROVIDE_HIDDEN(_timens_data = _vdso_data + PAGE_SIZE);
24#endif
25	. = VDSO_LBASE + SIZEOF_HEADERS;
26
27	.hash		: { *(.hash) }			:text
28	.gnu.hash	: { *(.gnu.hash) }
29	.dynsym		: { *(.dynsym) }
30	.dynstr		: { *(.dynstr) }
31	.gnu.version	: { *(.gnu.version) }
32	.gnu.version_d	: { *(.gnu.version_d) }
33	.gnu.version_r	: { *(.gnu.version_r) }
34
35	.note		: { *(.note.*) }		:text	:note
36
37	.dynamic	: { *(.dynamic) }		:text	:dynamic
38
39	.rodata		: {
40		*(.rodata*)
41		*(.got)
42		*(.got.plt)
43		*(.plt)
44		*(.rel.iplt)
45		*(.iplt)
46		*(.igot.plt)
47	}						:text
48
49	.text		: {
50		*(.text*)
51		*(.glue_7)
52		*(.glue_7t)
53		*(.vfp11_veneer)
54		*(.v4_bx)
55	}						:text	=0xe7f001f2
56
57	.rel.dyn	: { *(.rel*) }
58
59	.ARM.exidx : { *(.ARM.exidx*) }
60	DWARF_DEBUG
61	ELF_DETAILS
62	.ARM.attributes 0 : { *(.ARM.attributes) }
63
64	/DISCARD/	: {
65		*(.note.GNU-stack)
66		*(.data .data.* .gnu.linkonce.d.* .sdata*)
67		*(.bss .sbss .dynbss .dynsbss)
68	}
69}
70
71/*
72 * We must supply the ELF program headers explicitly to get just one
73 * PT_LOAD segment, and set the flags explicitly to make segments read-only.
74 */
75PHDRS
76{
77	text		PT_LOAD		FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
78	dynamic		PT_DYNAMIC	FLAGS(4);		/* PF_R */
79	note		PT_NOTE		FLAGS(4);		/* PF_R */
80}
81
82VERSION
83{
84	LINUX_2.6 {
85	global:
86		__vdso_clock_gettime;
87		__vdso_gettimeofday;
88		__vdso_clock_getres;
89		__vdso_clock_gettime64;
90	local: *;
91	};
92}
93