Skip to content

Commit ff7b9ab

Browse files
committed
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Thomas Weißschuh <[email protected]>
1 parent 0021d66 commit ff7b9ab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/include/nolibc/stackprotector.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* triggering stack protector errors themselves
1919
*/
2020

21-
__attribute__((weak,noreturn,section(".text.nolibc_stack_chk")))
21+
__attribute__((weak,used,noreturn,section(".text.nolibc_stack_chk")))
2222
void __stack_chk_fail(void)
2323
{
2424
pid_t pid;
@@ -34,7 +34,7 @@ void __stack_chk_fail_local(void)
3434
__stack_chk_fail();
3535
}
3636

37-
__attribute__((weak,section(".data.nolibc_stack_chk")))
37+
__attribute__((weak,used,section(".data.nolibc_stack_chk")))
3838
uintptr_t __stack_chk_guard;
3939

4040
static __no_stack_protector void __stack_chk_init(void)

0 commit comments

Comments
 (0)