diff mbox

[roland/arm-ptr-mangle] ARM: Move PTR_MANGLE et al out of Linux-specific file.

Message ID 20140731213617.8817B2C39F0@topped-with-meat.com
State Committed
Headers show

Commit Message

Roland McGrath July 31, 2014, 9:36 p.m. UTC
Verified no code changes on arm-linux-gnueabihf.

OK?


Thanks,
Roland


	* sysdeps/unix/sysv/linux/arm/sysdep.h (PTR_MANGLE_LOAD, PTR_MANGLE)
	(PTR_MANGLE2, PTR_DEMANGLE, PTR_DEMANGLE2): Move these macros...
	* sysdeps/arm/sysdep.h: ... here.
	[!__ASSEMBLER__]: Include <stdint.h>.

Comments

Joseph Myers July 31, 2014, 11:30 p.m. UTC | #1
On Thu, 31 Jul 2014, Roland McGrath wrote:

> Verified no code changes on arm-linux-gnueabihf.
> 
> OK?

OK.
Roland McGrath Aug. 1, 2014, 6:29 p.m. UTC | #2
Committed.

Thanks,
Roland
diff mbox

Patch

--- a/sysdeps/arm/sysdep.h
+++ b/sysdeps/arm/sysdep.h
@@ -19,6 +19,10 @@ 
 #include <sysdeps/generic/sysdep.h>
 #include <features.h>
 
+#ifndef __ASSEMBLER__
+# include <stdint.h>
+#endif
+
 /* The __ARM_ARCH define is provided by gcc 4.8.  Construct it otherwise.  */
 #ifndef __ARM_ARCH
 # ifdef __ARM_ARCH_2__
@@ -286,3 +290,47 @@ 
 #else
 # define PC_OFS  8
 #endif
+
+/* Pointer mangling support.  */
+#if (defined NOT_IN_libc && defined IS_IN_rtld) || \
+  (!defined SHARED && (!defined NOT_IN_libc || defined IS_IN_libpthread))
+# ifdef __ASSEMBLER__
+#  define PTR_MANGLE_LOAD(guard, tmp)					\
+  LDST_PCREL(ldr, guard, tmp, C_SYMBOL_NAME(__pointer_chk_guard_local));
+#  define PTR_MANGLE(dst, src, guard, tmp)				\
+  PTR_MANGLE_LOAD(guard, tmp);						\
+  PTR_MANGLE2(dst, src, guard)
+/* Use PTR_MANGLE2 for efficiency if guard is already loaded.  */
+#  define PTR_MANGLE2(dst, src, guard)		\
+  eor dst, src, guard
+#  define PTR_DEMANGLE(dst, src, guard, tmp)	\
+  PTR_MANGLE (dst, src, guard, tmp)
+#  define PTR_DEMANGLE2(dst, src, guard)	\
+  PTR_MANGLE2 (dst, src, guard)
+# else
+extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
+#  define PTR_MANGLE(var) \
+  (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
+#  define PTR_DEMANGLE(var)     PTR_MANGLE (var)
+# endif
+#else
+# ifdef __ASSEMBLER__
+#  define PTR_MANGLE_LOAD(guard, tmp)					\
+  LDST_GLOBAL(ldr, guard, tmp, C_SYMBOL_NAME(__pointer_chk_guard));
+#  define PTR_MANGLE(dst, src, guard, tmp)				\
+  PTR_MANGLE_LOAD(guard, tmp);						\
+  PTR_MANGLE2(dst, src, guard)
+/* Use PTR_MANGLE2 for efficiency if guard is already loaded.  */
+#  define PTR_MANGLE2(dst, src, guard)		\
+  eor dst, src, guard
+#  define PTR_DEMANGLE(dst, src, guard, tmp)	\
+  PTR_MANGLE (dst, src, guard, tmp)
+#  define PTR_DEMANGLE2(dst, src, guard)	\
+  PTR_MANGLE2 (dst, src, guard)
+# else
+extern uintptr_t __pointer_chk_guard attribute_relro;
+#  define PTR_MANGLE(var) \
+  (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard)
+#  define PTR_DEMANGLE(var)     PTR_MANGLE (var)
+# endif
+#endif
--- a/sysdeps/unix/sysv/linux/arm/sysdep.h
+++ b/sysdeps/unix/sysv/linux/arm/sysdep.h
@@ -435,48 +435,4 @@  __local_syscall_error:						\
 
 #endif	/* __ASSEMBLER__ */
 
-/* Pointer mangling support.  */
-#if (defined NOT_IN_libc && defined IS_IN_rtld) || \
-  (!defined SHARED && (!defined NOT_IN_libc || defined IS_IN_libpthread))
-# ifdef __ASSEMBLER__
-#  define PTR_MANGLE_LOAD(guard, tmp)					\
-  LDST_PCREL(ldr, guard, tmp, C_SYMBOL_NAME(__pointer_chk_guard_local));
-#  define PTR_MANGLE(dst, src, guard, tmp)				\
-  PTR_MANGLE_LOAD(guard, tmp);						\
-  PTR_MANGLE2(dst, src, guard)
-/* Use PTR_MANGLE2 for efficiency if guard is already loaded.  */
-#  define PTR_MANGLE2(dst, src, guard)		\
-  eor dst, src, guard
-#  define PTR_DEMANGLE(dst, src, guard, tmp)	\
-  PTR_MANGLE (dst, src, guard, tmp)
-#  define PTR_DEMANGLE2(dst, src, guard)	\
-  PTR_MANGLE2 (dst, src, guard)
-# else
-extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
-#  define PTR_MANGLE(var) \
-  (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
-#  define PTR_DEMANGLE(var)     PTR_MANGLE (var)
-# endif
-#else
-# ifdef __ASSEMBLER__
-#  define PTR_MANGLE_LOAD(guard, tmp)					\
-  LDST_GLOBAL(ldr, guard, tmp, C_SYMBOL_NAME(__pointer_chk_guard));
-#  define PTR_MANGLE(dst, src, guard, tmp)				\
-  PTR_MANGLE_LOAD(guard, tmp);						\
-  PTR_MANGLE2(dst, src, guard)
-/* Use PTR_MANGLE2 for efficiency if guard is already loaded.  */
-#  define PTR_MANGLE2(dst, src, guard)		\
-  eor dst, src, guard
-#  define PTR_DEMANGLE(dst, src, guard, tmp)	\
-  PTR_MANGLE (dst, src, guard, tmp)
-#  define PTR_DEMANGLE2(dst, src, guard)	\
-  PTR_MANGLE2 (dst, src, guard)
-# else
-extern uintptr_t __pointer_chk_guard attribute_relro;
-#  define PTR_MANGLE(var) \
-  (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard)
-#  define PTR_DEMANGLE(var)     PTR_MANGLE (var)
-# endif
-#endif
-
 #endif /* linux/arm/sysdep.h */