diff options
author | Thomas Weißschuh <linux@weissschuh.net> | 2024-08-12 22:50:18 +0200 |
---|---|---|
committer | Thomas Weißschuh <linux@weissschuh.net> | 2024-08-16 17:23:13 +0200 |
commit | ff7b9abbfce985b92f71c855246508edb0980cd6 (patch) | |
tree | b5e0dbc826196661d8249bea533f42d0feb9ab4c /tools/include | |
parent | tools/nolibc: crt: mark _start_c() as used (diff) | |
download | linux-ff7b9abbfce985b92f71c855246508edb0980cd6.tar.xz linux-ff7b9abbfce985b92f71c855246508edb0980cd6.zip |
tools/nolibc: stackprotector: mark implicitly used symbols as used
During LTO the references from the compiler-generated prologue and
epilogues to the stack protector symbols are not visible and the symbols
are removed.
This will then lead to errors during linking.
As those symbols are already #ifdeffed-out if unused mark them as "used"
to prevent their removal.
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20240812-nolibc-lto-v2-2-736af7bbefa8@weissschuh.net
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Diffstat (limited to 'tools/include')
-rw-r--r-- | tools/include/nolibc/stackprotector.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/include/nolibc/stackprotector.h b/tools/include/nolibc/stackprotector.h index 13f1d0e60387..1d0d5259ec41 100644 --- a/tools/include/nolibc/stackprotector.h +++ b/tools/include/nolibc/stackprotector.h @@ -18,7 +18,7 @@ * triggering stack protector errors themselves */ -__attribute__((weak,noreturn,section(".text.nolibc_stack_chk"))) +__attribute__((weak,used,noreturn,section(".text.nolibc_stack_chk"))) void __stack_chk_fail(void) { pid_t pid; @@ -34,7 +34,7 @@ void __stack_chk_fail_local(void) __stack_chk_fail(); } -__attribute__((weak,section(".data.nolibc_stack_chk"))) +__attribute__((weak,used,section(".data.nolibc_stack_chk"))) uintptr_t __stack_chk_guard; static __no_stack_protector void __stack_chk_init(void) |