RustForge

rust-kernel

Rustbelt: a hobby x86_64 kernel written in Rust

rust-kernel / vdso / vdso.lds
1329 bytes ยท raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
 * Linker script for the vDSO (see vdso.c). One read+execute segment that
 * starts with the ELF header, so the kernel maps the file's bytes as they
 * are. Modeled on Linux's arch/x86/entry/vdso/vdso-layout.lds.S.
 */
SECTIONS
{
	/* The vvar page is mapped right in front of us. */
	vvar_page = . - 4096;

	. = SIZEOF_HEADERS;

	.hash           : { *(.hash) }            :text
	.gnu.hash       : { *(.gnu.hash) }
	.dynsym         : { *(.dynsym) }
	.dynstr         : { *(.dynstr) }
	.gnu.version    : { *(.gnu.version) }
	.gnu.version_d  : { *(.gnu.version_d) }
	.gnu.version_r  : { *(.gnu.version_r) }
	.dynamic        : { *(.dynamic) }         :text :dynamic
	.rodata         : { *(.rodata*) }         :text
	.note           : { *(.note.*) }          :text
	.eh_frame_hdr   : { *(.eh_frame_hdr) }
	.eh_frame       : { KEEP (*(.eh_frame)) }
	.text           : { *(.text*) }

	/DISCARD/ : { *(.data*) *(.bss*) *(.got*) *(.plt*) *(.comment) }
}

PHDRS
{
	text    PT_LOAD    FLAGS(5) FILEHDR PHDRS; /* R + X */
	dynamic PT_DYNAMIC FLAGS(4);              /* R */
}

/* Every exported function carries the version LINUX_2.6, like Linux's. */
VERSION
{
	LINUX_2.6 {
	global:
		clock_gettime; __vdso_clock_gettime;
		gettimeofday;  __vdso_gettimeofday;
		time;          __vdso_time;
		getcpu;        __vdso_getcpu;
	local: *;
	};
}