mirror of
https://github.com/FEX-Emu/FEX.git
synced 2025-02-05 22:16:55 +00:00
8fa27d2d9f
VDSO is heavily abused by Proton games to the point it is showing up as CPU time. Implement a guest-facing only thunk library using the hardcoded VDSO interface in Thunks. If available this will always be loaded on application load and set the auxv value to support it. This requires a bit of special treatment as our first user of linker scripts since the format of the ELF must be careful crafted to not break applications trying to parse it. This library exposes a handful of symbols: - clock_gettime - clock_getres - gettimeofday - time - getcpu - All previous with `__vdso_` prefix - LINUX_2.6 All of these symbols get routed directly to the host architecture VDSO interface if they exist. AArch64 doesn't have getcpu or time VDSO. In a microbench, VDSO improved bench times substantially x86-64 host: 3.612s -> 1.369s - 2.63x speed AArch64 host: 3.821s -> 2.284s - 1.67x speed - AArch64 isn't as improved due to missing VDSO symbols This is also our first /always/ enabled thunk as long as the file exists
53 lines
976 B
Plaintext
53 lines
976 B
Plaintext
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) }
|
|
.dynamic : { *(.dynamic) } :text :dynamic
|
|
.rodata : {
|
|
*(.rodata*)
|
|
*(.data*)
|
|
*(.sdata*)
|
|
*(.got.plt) *(.got)
|
|
*(.gnu.linkonce.d.*)
|
|
*(.bss*)
|
|
*(.dynbss*)
|
|
*(.gnu.linkonce.b.*)
|
|
} :text
|
|
|
|
/DISCARD/ : {
|
|
*(.note)
|
|
*(.note.gnu.property)
|
|
*(.eh_frame_hdr)
|
|
*(.eh_frame)
|
|
*(.symtab)
|
|
}
|
|
}
|
|
|
|
PHDRS {
|
|
text PT_LOAD FLAGS(PF_R | PF_X) FILEHDR PHDRS;
|
|
dynamic PT_DYNAMIC FLAGS(PF_R);
|
|
note PT_NOTE FLAGS(PF_R);
|
|
}
|
|
|
|
VERSION {
|
|
LINUX_2.6 {
|
|
global:
|
|
__vdso_time;
|
|
time;
|
|
__vdso_gettimeofday;
|
|
gettimeofday;
|
|
__vdso_clock_gettime;
|
|
clock_gettime;
|
|
__vdso_clock_getres;
|
|
clock_getres;
|
|
__vdso_getcpu;
|
|
getcpu;
|
|
local: *;
|
|
};
|
|
}
|