]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
elf: Fix abort localplt issue with clang
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 25 Mar 2025 14:08:44 +0000 (11:08 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 28 Oct 2025 16:54:20 +0000 (13:54 -0300)
sysdeps/generic/symbol-hacks.h

index 58398d33a5f81001c8cb6b7180b33d3fdb07cad9..cd5589db9da44a197cea1422c9cf2c3a97939c47 100644 (file)
@@ -21,6 +21,15 @@ asm ("strcpy = __GI_strcpy");
 asm ("strncpy = __GI_strncpy");
 asm ("strcat = __GI_strcat");
 
+#ifdef __clang__
+/* clang might generate an abort call when cleanup functions (set by
+   __attribute__ ((cleanup)) calls functions not marked as nothrow.
+   We can mitigate by marking some internal functions as __THROW,
+   but it is not possible for functions that issue used-provided
+   callbacks (for instance pthread_once).  */
+asm ("abort = __GI_abort");
+#endif
+
 /* Some targets do not use __stack_chk_fail_local.  In libc.so,
    redirect __stack_chk_fail to a hidden reference
    __stack_chk_fail_local, to avoid the PLT reference.