* [hurd,commited] hurd: Add stack guard support
@ 2020-06-06 0:06 Samuel Thibault
0 siblings, 0 replies; only message in thread
From: Samuel Thibault @ 2020-06-06 0:06 UTC (permalink / raw
To: libc-alpha; +Cc: commit-hurd
* sysdeps/mach/hurd/i386/tls.h (THREAD_SET_STACK_GUARD,
THREAD_COPY_STACK_GUARD): New macros
* sysdeps/mach/hurd/i386/ld.abilist (__stack_chk_guard): Remove symbol.
---
sysdeps/mach/hurd/i386/ld.abilist | 1 -
sysdeps/mach/hurd/i386/tls.h | 9 +++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/sysdeps/mach/hurd/i386/ld.abilist b/sysdeps/mach/hurd/i386/ld.abilist
index 6f591b2496..b2be75cbff 100644
--- a/sysdeps/mach/hurd/i386/ld.abilist
+++ b/sysdeps/mach/hurd/i386/ld.abilist
@@ -18,4 +18,3 @@ GLIBC_2.2.6 _r_debug D 0x14
GLIBC_2.2.6 abort F
GLIBC_2.3 ___tls_get_addr F
GLIBC_2.3 __tls_get_addr F
-GLIBC_2.4 __stack_chk_guard D 0x4
diff --git a/sysdeps/mach/hurd/i386/tls.h b/sysdeps/mach/hurd/i386/tls.h
index 0c2de054d8..03a894bd35 100644
--- a/sysdeps/mach/hurd/i386/tls.h
+++ b/sysdeps/mach/hurd/i386/tls.h
@@ -295,6 +295,15 @@ out:
asm ("movl %%gs:%P1,%0" : "=q" (_dtv) : "i" (offsetof (tcbhead_t, dtv)));\
_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))
+
+
# include <mach/machine/thread_status.h>
/* Set up TLS in the new thread of a fork child, copying from the original. */
--
2.26.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-06-06 0:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-06 0:06 [hurd,commited] hurd: Add stack guard support Samuel Thibault
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).