]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libssp: Change __stack_chk_guard to uintptr_t
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 5 May 2026 20:56:32 +0000 (04:56 +0800)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 5 May 2026 21:25:46 +0000 (05:25 +0800)
Since the only test of __stack_chk_guard in GCC is declared as an integer:

 #ifdef __LP64__
 const unsigned long int __stack_chk_guard = 0x2d853605a4d9a09cUL;
 #else
 const unsigned long int __stack_chk_guard = 0xdd2cc927UL;
 #endif

and it is natural to assign an integer to __stack_chk_guard,

commit c05b5e5d8cb660ed43159d66fd669c20746d6bea
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Sep 12 18:52:39 2025 -0700

    c/c++: Declare stack protection guard as a global symbol

declared __stack_chk_guard as uintptr_t if it is an internal global
symbol.  Change __stack_chk_guard in libssp to match the internal
symbol type.

PR c/121911
* ssp.c: Include <stdint.h>.  Change __stack_chk_guard to
uintptr_t.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
libssp/ssp.c

index 3f497dcc1370c3e1d478a569f1c963dcc2fa18eb..47abdf4e13d6493ce2c08552ea770e51a298adcf 100644 (file)
@@ -66,8 +66,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #ifdef HAVE_SYSLOG_H
 # include <syslog.h>
 #endif
+#include <stdint.h>
 
-void *__stack_chk_guard = 0;
+uintptr_t __stack_chk_guard = 0;
 
 static void __attribute__ ((constructor))
 __guard_setup (void)