Commit ff7b9abb authored by Thomas Weißschuh's avatar Thomas Weißschuh

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: default avatarWilly Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20240812-nolibc-lto-v2-2-736af7bbefa8@weissschuh.netSigned-off-by: default avatarThomas Weißschuh <linux@weissschuh.net>
parent 0021d667
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
* triggering stack protector errors themselves * 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) void __stack_chk_fail(void)
{ {
pid_t pid; pid_t pid;
...@@ -34,7 +34,7 @@ void __stack_chk_fail_local(void) ...@@ -34,7 +34,7 @@ void __stack_chk_fail_local(void)
__stack_chk_fail(); __stack_chk_fail();
} }
__attribute__((weak,section(".data.nolibc_stack_chk"))) __attribute__((weak,used,section(".data.nolibc_stack_chk")))
uintptr_t __stack_chk_guard; uintptr_t __stack_chk_guard;
static __no_stack_protector void __stack_chk_init(void) static __no_stack_protector void __stack_chk_init(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment