]> Git Repo - J-linux.git/commitdiff
tools/nolibc: stackprotector: mark implicitly used symbols as used
authorThomas Weißschuh <[email protected]>
Mon, 12 Aug 2024 20:50:18 +0000 (22:50 +0200)
committerThomas Weißschuh <[email protected]>
Fri, 16 Aug 2024 15:23:13 +0000 (17:23 +0200)
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]>
tools/include/nolibc/stackprotector.h

index 13f1d0e603875134378ec52710b93eabe56a5126..1d0d5259ec417ca7c853aba55519c65aa504b52b 100644 (file)
@@ -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)
This page took 0.273301 seconds and 4 git commands to generate.