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
|
||||
|
||||
#ifndef cond_syscall
|
||||
#define cond_syscall(x) asm( \
|
||||
".weak " __stringify(x) "\n\t" \
|
||||
".set " __stringify(x) "," \
|
||||
__stringify(sys_ni_syscall))
|
||||
#define cond_syscall(x) \
|
||||
long __attribute__((weak, alias("sys_ni_syscall"))) x(void);
|
||||
#endif
|
||||
|
||||
#ifndef SYSCALL_ALIAS
|
||||
|
@ -32,11 +32,6 @@ KCOV_INSTRUMENT_kcov.o := n
|
||||
KASAN_SANITIZE_kcov.o := n
|
||||
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
|
||||
CFLAGS_cfi.o = $(DISABLE_CFI_CLANG)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user