Skip to content

Commit 0a9f2a6

Browse files
andreas-schwabpalmer-dabbelt
authored andcommitted
riscv: add Linux note to vdso
The Linux note in the vdso allows glibc to check the running kernel version without having to issue the uname syscall. Signed-off-by: Andreas Schwab <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent c749bb2 commit 0a9f2a6

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

arch/riscv/kernel/vdso/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ vdso-syms += getcpu
1212
vdso-syms += flush_icache
1313

1414
# Files to link into the vdso
15-
obj-vdso = $(patsubst %, %.o, $(vdso-syms))
15+
obj-vdso = $(patsubst %, %.o, $(vdso-syms)) note.o
1616

1717
# Build rules
1818
targets := $(obj-vdso) vdso.so vdso.so.dbg vdso.lds vdso-dummy.o

arch/riscv/kernel/vdso/note.S

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* SPDX-License-Identifier: GPL-2.0-or-later */
2+
/*
3+
* This supplies .note.* sections to go into the PT_NOTE inside the vDSO text.
4+
* Here we can supply some information useful to userland.
5+
*/
6+
7+
#include <linux/elfnote.h>
8+
#include <linux/version.h>
9+
10+
ELFNOTE_START(Linux, 0, "a")
11+
.long LINUX_VERSION_CODE
12+
ELFNOTE_END

0 commit comments

Comments
 (0)