9931033bbf
The vDSO (virtual dynamic shared object) is a small shared library that the kernel maps R/O into the address space of all Linux processes on image activation. The vDSO is a fully formed ELF image, shared by all processes with the same ABI, has no process private data. The primary purpose of the vDSO: - non-executable stack, signal trampolines not copied to the stack; - signal trampolines unwind, mandatory for the NPTL; - to avoid contex-switch overhead frequently used system calls can be implemented in the vDSO: for now gettimeofday, clock_gettime. The first two have been implemented, so add the implementation of system calls. System calls implemenation based on a native timekeeping code with some limitations: - ifunc can't be used, as vDSO r/o mapped to the process VA and rtld can't relocate symbols; - reading HPET memory is not implemented for now (TODO). In case on any error vDSO system calls fallback to the kernel system calls. For unimplemented vDSO system calls added prototypes which call corresponding kernel system call. Tested by: trasz (arm64) Differential revision: https://reviews.freebsd.org/D30900 MFC after: 2 weeks
74 lines
1.4 KiB
ArmAsm
74 lines
1.4 KiB
ArmAsm
/*
|
|
* Linker script for 64-bit vDSO.
|
|
* Copied from Linux kernel arch/x86/vdso/vdso-layout.lds.S
|
|
*
|
|
* $FreeBSD$
|
|
*/
|
|
|
|
SECTIONS
|
|
{
|
|
. = . + 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) }
|
|
|
|
.note : { *(.note.*) } :text :note
|
|
|
|
.eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
|
|
.eh_frame : { KEEP (*(.eh_frame)) } :text
|
|
|
|
.dynamic : { *(.dynamic) } :text :dynamic
|
|
|
|
.rodata : { *(.rodata*) } :text
|
|
.data : {
|
|
*(.data*)
|
|
*(.sdata*)
|
|
*(.got.plt) *(.got)
|
|
*(.gnu.linkonce.d.*)
|
|
*(.bss*)
|
|
*(.dynbss*)
|
|
*(.gnu.linkonce.b.*)
|
|
}
|
|
|
|
.altinstructions : { *(.altinstructions) }
|
|
.altinstr_replacement : { *(.altinstr_replacement) }
|
|
|
|
. = ALIGN(0x100);
|
|
.text : { *(.test .text*) } :text =0x90909090
|
|
}
|
|
|
|
PHDRS
|
|
{
|
|
text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
|
|
dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
|
|
note PT_NOTE FLAGS(4); /* PF_R */
|
|
eh_frame_hdr PT_GNU_EH_FRAME;
|
|
}
|
|
|
|
/*
|
|
* This controls what symbols we export from the DSO.
|
|
*/
|
|
VERSION
|
|
{
|
|
LINUX_2.6.39 {
|
|
global:
|
|
__kernel_rt_sigreturn;
|
|
__kernel_gettimeofday;
|
|
__kernel_clock_gettime;
|
|
__kernel_clock_getres;
|
|
local: *;
|
|
};
|
|
|
|
LINUX_0.0 {
|
|
global:
|
|
linux_platform;
|
|
kern_timekeep_base;
|
|
local: *;
|
|
};
|
|
}
|