sys_ni: Fix cond_syscall() alias for LTO
When using LTO, the conditional syscall aliases aren't weak, and instead override implemented syscalls rather than serve as a fallback for missing syscalls. Fix the cond_syscall() alias using an attribute so that it gets properly evaluated at link time. Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
This commit is contained in:
parent
23055407dc
commit
da7364b282
@ -23,10 +23,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef cond_syscall
|
#ifndef cond_syscall
|
||||||
#define cond_syscall(x) asm( \
|
#define cond_syscall(x) \
|
||||||
".weak " __stringify(x) "\n\t" \
|
long __attribute__((weak, alias("sys_ni_syscall"))) x(void);
|
||||||
".set " __stringify(x) "," \
|
|
||||||
__stringify(sys_ni_syscall))
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SYSCALL_ALIAS
|
#ifndef SYSCALL_ALIAS
|
||||||
|
@ -32,11 +32,6 @@ KCOV_INSTRUMENT_kcov.o := n
|
|||||||
KASAN_SANITIZE_kcov.o := n
|
KASAN_SANITIZE_kcov.o := n
|
||||||
CFLAGS_kcov.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector)
|
CFLAGS_kcov.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector)
|
||||||
|
|
||||||
ifndef CONFIG_CFI_CLANG
|
|
||||||
# cond_syscall is currently not gcc LTO compatible
|
|
||||||
CFLAGS_sys_ni.o = $(DISABLE_LTO)
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Don't instrument error handlers
|
# Don't instrument error handlers
|
||||||
CFLAGS_cfi.o = $(DISABLE_CFI_CLANG)
|
CFLAGS_cfi.o = $(DISABLE_CFI_CLANG)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user