This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 06/14] tile: support stackguard-macros.h header


---
 ChangeLog.tile                       |    5 +++++
 sysdeps/tile/elf/stackguard-macros.h |    3 +++
 sysdeps/tile/stackguard-macros.h     |    7 +++++++
 3 files changed, 15 insertions(+), 0 deletions(-)
 create mode 100644 sysdeps/tile/elf/stackguard-macros.h
 create mode 100644 sysdeps/tile/stackguard-macros.h

diff --git a/ChangeLog.tile b/ChangeLog.tile
index 46336a5..2ce98e9 100644
--- a/ChangeLog.tile
+++ b/ChangeLog.tile
@@ -1,5 +1,10 @@
 2012-05-12  Chris Metcalf  <cmetcalf@tilera.com>
 
+	* sysdeps/tile/stackguard-macros.h: New file.
+	* sysdeps/tile/elf/stackguard-macros.h: New stub include file.
+
+2012-05-12  Chris Metcalf  <cmetcalf@tilera.com>
+
 	* sysdeps/tile/Makefile (ELF_MACHINE_PLTREL_OVERLAP):
 	Remove variable no longer used by core.
 
diff --git a/sysdeps/tile/elf/stackguard-macros.h b/sysdeps/tile/elf/stackguard-macros.h
new file mode 100644
index 0000000..606ad58
--- /dev/null
+++ b/sysdeps/tile/elf/stackguard-macros.h
@@ -0,0 +1,3 @@
+/* Tests in nptl/ look for <elf/stackguard-macros.h> while tests
+   in elf/ look for <stackguard-macros.h>.  Provide both.  */
+#include "../stackguard-macros.h"
diff --git a/sysdeps/tile/stackguard-macros.h b/sysdeps/tile/stackguard-macros.h
new file mode 100644
index 0000000..7679c0a
--- /dev/null
+++ b/sysdeps/tile/stackguard-macros.h
@@ -0,0 +1,7 @@
+#ifdef __tilegx__
+# define STACK_CHK_GUARD \
+  ({ uintptr_t x; asm ("addi %0, tp, -16; ld %0, %0" : "=r" (x)); x; })
+#else
+# define STACK_CHK_GUARD \
+  ({ uintptr_t x; asm ("addi %0, tp, -8; lw %0, %0" : "=r" (x)); x; })
+#endif
-- 
1.6.5.2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]