xref: /linux/arch/arm/vdso/vdso.lds.S (revision fcc79e1714e8c2b8e216dc3149812edd37884eef)
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Adapted from arm64 version.
4 *
5 * GNU linker script for the VDSO library.
6 *
7 * Copyright (C) 2012 ARM Limited
8 *
9 * Author: Will Deacon <will.deacon@arm.com>
10 * Heavily based on the vDSO linker scripts for other archs.
11 */
12
13#include <linux/const.h>
14#include <asm/asm-offsets.h>
15#include <asm/page.h>
16#include <asm/vdso.h>
17
18OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
19OUTPUT_ARCH(arm)
20
21SECTIONS
22{
23	PROVIDE(_vdso_data = . - VDSO_DATA_SIZE);
24
25	. = 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
38	.eh_frame_hdr	: { *(.eh_frame_hdr) }		:text	:eh_frame_hdr
39	.eh_frame	: { KEEP (*(.eh_frame)) }	:text
40
41	.dynamic	: { *(.dynamic) }		:text	:dynamic
42
43	.rodata		: { *(.rodata*) }		:text
44
45	.text		: { *(.text*) }			:text	=0xe7f001f2
46
47	.got		: { *(.got) }
48	.rel.plt	: { *(.rel.plt) }
49
50	/DISCARD/	: {
51		*(.note.GNU-stack)
52		*(.data .data.* .gnu.linkonce.d.* .sdata*)
53		*(.bss .sbss .dynbss .dynsbss)
54	}
55}
56
57/*
58 * We must supply the ELF program headers explicitly to get just one
59 * PT_LOAD segment, and set the flags explicitly to make segments read-only.
60 */
61PHDRS
62{
63	text		PT_LOAD		FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
64	dynamic		PT_DYNAMIC	FLAGS(4);		/* PF_R */
65	note		PT_NOTE		FLAGS(4);		/* PF_R */
66	eh_frame_hdr	PT_GNU_EH_FRAME;
67}
68
69VERSION
70{
71	LINUX_2.6 {
72	global:
73		__vdso_clock_gettime;
74		__vdso_gettimeofday;
75		__vdso_clock_getres;
76		__vdso_clock_gettime64;
77	local: *;
78	};
79}
80