#include <tls.h>
#ifndef SHARED
# include <dl-osinfo.h>
-# ifndef THREAD_SET_STACK_GUARD
-/* Only exported for architectures that don't store the stack guard canary
- in thread local area. */
+/* Also export to architectures which prefer -mstack-protector-guard=tls. */
uintptr_t __stack_chk_guard attribute_relro;
-# endif
# ifndef THREAD_SET_POINTER_GUARD
/* Only exported for architectures that don't store the pointer guard
value in thread local area. */
uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard (_dl_random);
# ifdef THREAD_SET_STACK_GUARD
THREAD_SET_STACK_GUARD (stack_chk_guard);
-# else
- __stack_chk_guard = stack_chk_guard;
# endif
+ __stack_chk_guard = stack_chk_guard;
# ifdef DL_SYSDEP_OSCHECK
{
+%if __has_include("tls.h")
+%include "tls.h"
+%endif
libc {
GLIBC_2.0 {
%ifdef EXPORT_UNWIND_FIND_FDE
}
GLIBC_2.4 {
# stack canary
+%ifndef THREAD_SET_STACK_GUARD
+ __stack_chk_guard;
+%endif
+ }
+ GLIBC_2.33 {
+ # stack canary
+%ifdef THREAD_SET_STACK_GUARD
__stack_chk_guard;
+%endif
}
GLIBC_PRIVATE {
# Those are in the dynamic linker, but used by libc.so.
#endif
rtld_hidden_data_def (_dl_argv)
-#ifndef THREAD_SET_STACK_GUARD
-/* Only exported for architectures that don't store the stack guard canary
- in thread local area. */
+/* Also export to architectures which prefer -mstack-protector-guard=tls. */
uintptr_t __stack_chk_guard attribute_relro;
-#endif
/* Only exported for architectures that don't store the pointer guard
value in thread local area. */
uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard (_dl_random);
#ifdef THREAD_SET_STACK_GUARD
THREAD_SET_STACK_GUARD (stack_chk_guard);
-#else
- __stack_chk_guard = stack_chk_guard;
#endif
+ __stack_chk_guard = stack_chk_guard;
/* Set up the pointer guard as well, if necessary. */
uintptr_t pointer_chk_guard
the SSE memory functions. */
#define STACK_ALIGN 16
+/* Set the stack guard field in TCB head. Referenced by elf/Versions. */
+#define THREAD_SET_STACK_GUARD(value) \
+ THREAD_SETMEM (THREAD_SELF, header.stack_guard, value)
+#define THREAD_COPY_STACK_GUARD(descr) \
+ ((descr)->header.stack_guard \
+ = THREAD_GETMEM (THREAD_SELF, header.stack_guard))
+
#ifndef __ASSEMBLER__
/* Get system call information. */
# include <sysdep.h>
}})
-/* Set the stack guard field in TCB head. */
-#define THREAD_SET_STACK_GUARD(value) \
- THREAD_SETMEM (THREAD_SELF, header.stack_guard, value)
-#define THREAD_COPY_STACK_GUARD(descr) \
- ((descr)->header.stack_guard \
- = THREAD_GETMEM (THREAD_SELF, header.stack_guard))
-
-
/* Set the pointer guard field in the TCB head. */
#define THREAD_SET_POINTER_GUARD(value) \
THREAD_SETMEM (THREAD_SELF, header.pointer_guard, value)
/* Alignment requirement for the stack. */
#define STACK_ALIGN 16
+/* Set the stack guard field in TCB head. Referenced by elf/Versions. */
+#define THREAD_SET_STACK_GUARD(value) \
+ (((uintptr_t *) __thread_self)[-1] = (value))
+#define THREAD_COPY_STACK_GUARD(descr) \
+ (((uintptr_t *) ((char *) (descr) + TLS_PRE_TCB_SIZE))[-1] \
+ = ((uintptr_t *) __thread_self)[-1])
+
#ifndef __ASSEMBLER__
/* Get system call information. */
# include <sysdep.h>
#define THREAD_SETMEM_NC(descr, member, idx, value) \
descr->member[idx] = (value)
-/* Set the stack guard field in TCB head. */
-#define THREAD_SET_STACK_GUARD(value) \
- (((uintptr_t *) __thread_self)[-1] = (value))
-#define THREAD_COPY_STACK_GUARD(descr) \
- (((uintptr_t *) ((char *) (descr) + TLS_PRE_TCB_SIZE))[-1] \
- = ((uintptr_t *) __thread_self)[-1])
-
/* Set the pointer guard field in TCB head. */
#define THREAD_GET_POINTER_GUARD() \
(((uintptr_t *) __thread_self)[-2])
GLIBC_2.2.6 abort F
GLIBC_2.3 ___tls_get_addr F
GLIBC_2.3 __tls_get_addr F
+GLIBC_2.33 __stack_chk_guard D 0x4
GLIBC_2.33 __x86_get_cpu_features F
"Segment Base".) On such machines, a cache line is 64 bytes. */
#define TCB_ALIGNMENT 64
+/* Set the stack guard field in TCB head. Referenced by elf/Versions. */
+#define THREAD_SET_STACK_GUARD(value) \
+ THREAD_SETMEM (THREAD_SELF, stack_guard, value)
+#define THREAD_COPY_STACK_GUARD(descr) \
+ ((descr)->stack_guard \
+ = THREAD_GETMEM (THREAD_SELF, stack_guard))
+
#ifndef __ASSEMBLER__
/* Use i386-specific RPCs to arrange that %gs segment register prefix
_dtv; })
-/* Set the stack guard field in TCB head. */
-#define THREAD_SET_STACK_GUARD(value) \
- THREAD_SETMEM (THREAD_SELF, stack_guard, value)
-#define THREAD_COPY_STACK_GUARD(descr) \
- ((descr)->stack_guard \
- = THREAD_GETMEM (THREAD_SELF, stack_guard))
-
/* Set the pointer guard field in the TCB head. */
#define THREAD_SET_POINTER_GUARD(value) \
THREAD_SETMEM (THREAD_SELF, pointer_guard, value)
# include <asm/ptrace.h>
#endif /* __ASSEMBLER__ */
+/* Set the stack guard field in TCB head. Used by elf/Versions. */
+# define THREAD_SET_STACK_GUARD(value) \
+ (((tcbhead_t *) ((char *) __thread_register \
+ - TLS_TCB_OFFSET))[-1].stack_guard = (value))
+# define THREAD_COPY_STACK_GUARD(descr) \
+ (((tcbhead_t *) ((char *) (descr) \
+ + TLS_PRE_TCB_SIZE))[-1].stack_guard \
+ = ((tcbhead_t *) ((char *) __thread_register \
+ - TLS_TCB_OFFSET))[-1].stack_guard)
+
#ifndef __powerpc64__
/* Register r2 (tp) is reserved by the ABI as "thread pointer". */
# define PT_THREAD_POINTER PT_R2
# define THREAD_SETMEM_NC(descr, member, idx, value) \
((void)(descr), (THREAD_SELF)->member[idx] = (value))
-/* Set the stack guard field in TCB head. */
-# define THREAD_SET_STACK_GUARD(value) \
- (((tcbhead_t *) ((char *) __thread_register \
- - TLS_TCB_OFFSET))[-1].stack_guard = (value))
-# define THREAD_COPY_STACK_GUARD(descr) \
- (((tcbhead_t *) ((char *) (descr) \
- + TLS_PRE_TCB_SIZE))[-1].stack_guard \
- = ((tcbhead_t *) ((char *) __thread_register \
- - TLS_TCB_OFFSET))[-1].stack_guard)
-
/* Set the stack guard field in TCB head. */
# define THREAD_GET_POINTER_GUARD() \
(((tcbhead_t *) ((char *) __thread_register \
the SSE memory functions. */
#define STACK_ALIGN 16
+/* Set the stack guard field in TCB head. Referenced by elf/Versions. */
+#define THREAD_SET_STACK_GUARD(value) \
+ do \
+ { \
+ __asm__ __volatile__ ("" : : : "a0", "a1"); \
+ THREAD_SETMEM (THREAD_SELF, header.stack_guard, value); \
+ } \
+ while (0)
+#define THREAD_COPY_STACK_GUARD(descr) \
+ ((descr)->header.stack_guard \
+ = THREAD_GETMEM (THREAD_SELF, header.stack_guard))
+
#ifndef __ASSEMBLER__
/* Get system call information. */
# include <sysdep.h>
#define THREAD_SETMEM_NC(descr, member, idx, value) \
descr->member[idx] = (value)
-/* Set the stack guard field in TCB head. */
-#define THREAD_SET_STACK_GUARD(value) \
- do \
- { \
- __asm__ __volatile__ ("" : : : "a0", "a1"); \
- THREAD_SETMEM (THREAD_SELF, header.stack_guard, value); \
- } \
- while (0)
-#define THREAD_COPY_STACK_GUARD(descr) \
- ((descr)->header.stack_guard \
- = THREAD_GETMEM (THREAD_SELF, header.stack_guard))
-
/* s390 doesn't have HP_TIMING_*, so for the time being
use stack_guard as pointer_guard. */
#define THREAD_GET_POINTER_GUARD() \
# include <tcb-offsets.h>
#endif /* __ASSEMBLER__ */
+/* Set the stack guard field in TCB head. Referenced by elf/Versions. */
+#define THREAD_SET_STACK_GUARD(value) \
+ THREAD_SETMEM (THREAD_SELF, header.stack_guard, value)
+# define THREAD_COPY_STACK_GUARD(descr) \
+ ((descr)->header.stack_guard \
+ = THREAD_GETMEM (THREAD_SELF, header.stack_guard))
#ifndef __ASSEMBLER__
/* Get system call information. */
#define THREAD_SETMEM_NC(descr, member, idx, value) \
descr->member[idx] = (value)
-/* Set the stack guard field in TCB head. */
-#define THREAD_SET_STACK_GUARD(value) \
- THREAD_SETMEM (THREAD_SELF, header.stack_guard, value)
-# define THREAD_COPY_STACK_GUARD(descr) \
- ((descr)->header.stack_guard \
- = THREAD_GETMEM (THREAD_SELF, header.stack_guard))
-
/* Get/set the stack guard field in TCB head. */
#define THREAD_GET_POINTER_GUARD() \
THREAD_GETMEM (THREAD_SELF, header.pointer_guard)
GLIBC_2.1 _dl_mcount F
GLIBC_2.3 ___tls_get_addr F
GLIBC_2.3 __tls_get_addr F
+GLIBC_2.33 __stack_chk_guard D 0x4
GLIBC_2.33 __x86_get_cpu_features F
GLIBC_2.2 _dl_mcount F
GLIBC_2.2 _r_debug D 0x28
GLIBC_2.3 __tls_get_addr F
+GLIBC_2.33 __stack_chk_guard D 0x8
GLIBC_2.22 __tls_get_addr_opt F
GLIBC_2.23 __parse_hwcap_and_convert_at_platform F
GLIBC_2.3 __tls_get_addr F
+GLIBC_2.33 __stack_chk_guard D 0x4
GLIBC_2.3 __tls_get_addr F
GLIBC_2.3 _dl_mcount F
GLIBC_2.3 _r_debug D 0x28
+GLIBC_2.33 __stack_chk_guard D 0x8
GLIBC_2.17 _r_debug D 0x28
GLIBC_2.22 __tls_get_addr_opt F
GLIBC_2.23 __parse_hwcap_and_convert_at_platform F
+GLIBC_2.33 __stack_chk_guard D 0x8
GLIBC_2.1 __libc_stack_end D 0x4
GLIBC_2.1 _dl_mcount F
GLIBC_2.3 __tls_get_offset F
+GLIBC_2.33 __stack_chk_guard D 0x4
GLIBC_2.2 _dl_mcount F
GLIBC_2.2 _r_debug D 0x28
GLIBC_2.3 __tls_get_offset F
+GLIBC_2.33 __stack_chk_guard D 0x8
GLIBC_2.1 __libc_stack_end D 0x4
GLIBC_2.1 _dl_mcount F
GLIBC_2.3 __tls_get_addr F
+GLIBC_2.33 __stack_chk_guard D 0x4
GLIBC_2.2 _dl_mcount F
GLIBC_2.2 _r_debug D 0x28
GLIBC_2.3 __tls_get_addr F
+GLIBC_2.33 __stack_chk_guard D 0x8
GLIBC_2.2.5 _dl_mcount F
GLIBC_2.2.5 _r_debug D 0x28
GLIBC_2.3 __tls_get_addr F
+GLIBC_2.33 __stack_chk_guard D 0x8
GLIBC_2.33 __x86_get_cpu_features F
GLIBC_2.16 __tls_get_addr F
GLIBC_2.16 _dl_mcount F
GLIBC_2.16 _r_debug D 0x14
+GLIBC_2.33 __stack_chk_guard D 0x4
GLIBC_2.33 __x86_get_cpu_features F
/* Alignment requirement for the stack. */
#define STACK_ALIGN 16
+/* Set the stack guard field in TCB head. Used by elf/Versions. */
+# define THREAD_SET_STACK_GUARD(value) \
+ THREAD_SETMEM (THREAD_SELF, header.stack_guard, value)
+# define THREAD_COPY_STACK_GUARD(descr) \
+ ((descr)->header.stack_guard \
+ = THREAD_GETMEM (THREAD_SELF, header.stack_guard))
+
#ifndef __ASSEMBLER__
/* Get system call information. */
}})
-/* Set the stack guard field in TCB head. */
-# define THREAD_SET_STACK_GUARD(value) \
- THREAD_SETMEM (THREAD_SELF, header.stack_guard, value)
-# define THREAD_COPY_STACK_GUARD(descr) \
- ((descr)->header.stack_guard \
- = THREAD_GETMEM (THREAD_SELF, header.stack_guard))
-
-
/* Set the pointer guard field in the TCB head. */
# define THREAD_SET_POINTER_GUARD(value) \
THREAD_SETMEM (THREAD_SELF, header.pointer_guard, value)