summaryrefslogtreecommitdiff
path: root/libsanitizer
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-21 21:21:27 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-21 21:21:27 +0000
commit2619e2416212a0ecfe6abba16f3e95a8f6199409 (patch)
tree427536f9380e1647b1aaf6178db3c701d1932f19 /libsanitizer
parente45408ff3cb8c3b549526d364d1466d79e77fc02 (diff)
downloadgcc-2619e2416212a0ecfe6abba16f3e95a8f6199409.tar.gz
PR sanitizer/64435
* sanitizer_common/sanitizer_platform_limits_posix.h: Cherry pick upstream r226637. * sanitizer_common/sanitizer_platform_limits_posix.cc: Likewise. * sanitizer_common/sanitizer_posix.cc: Cherry pick upstream r226639. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219968 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libsanitizer')
-rw-r--r--libsanitizer/ChangeLog8
-rw-r--r--libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc6
-rw-r--r--libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h2
-rw-r--r--libsanitizer/sanitizer_common/sanitizer_posix.cc5
4 files changed, 17 insertions, 4 deletions
diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog
index cb0f98c7e83..de7c633c6d7 100644
--- a/libsanitizer/ChangeLog
+++ b/libsanitizer/ChangeLog
@@ -1,3 +1,11 @@
+2015-01-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR sanitizer/64435
+ * sanitizer_common/sanitizer_platform_limits_posix.h: Cherry pick
+ upstream r226637.
+ * sanitizer_common/sanitizer_platform_limits_posix.cc: Likewise.
+ * sanitizer_common/sanitizer_posix.cc: Cherry pick upstream r226639.
+
2015-01-20 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/64632
diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
index 7ea8706dfc6..199a842447a 100644
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
@@ -1059,7 +1059,13 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, uid);
CHECK_SIZE_AND_OFFSET(ipc_perm, gid);
CHECK_SIZE_AND_OFFSET(ipc_perm, cuid);
CHECK_SIZE_AND_OFFSET(ipc_perm, cgid);
+#ifndef __GLIBC_PREREQ
+#define __GLIBC_PREREQ(x, y) 0
+#endif
+#if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)
+/* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */
CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
+#endif
CHECK_TYPE_SIZE(shmid_ds);
CHECK_SIZE_AND_OFFSET(shmid_ds, shm_perm);
diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
index 139fe0a1821..631983a5fdb 100644
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -167,7 +167,7 @@ namespace __sanitizer {
unsigned __seq;
u64 __unused1;
u64 __unused2;
-#elif defined(__mips__)
+#elif defined(__mips__) || defined(__aarch64__)
unsigned int mode;
unsigned short __seq;
unsigned short __pad1;
diff --git a/libsanitizer/sanitizer_common/sanitizer_posix.cc b/libsanitizer/sanitizer_common/sanitizer_posix.cc
index 229870e00dc..adb1b2a9d68 100644
--- a/libsanitizer/sanitizer_common/sanitizer_posix.cc
+++ b/libsanitizer/sanitizer_common/sanitizer_posix.cc
@@ -76,16 +76,15 @@ static uptr GetKernelAreaSize() {
uptr GetMaxVirtualAddress() {
#if SANITIZER_WORDSIZE == 64
-# if defined(__powerpc64__)
+# if defined(__powerpc64__) || defined(__aarch64__)
// On PowerPC64 we have two different address space layouts: 44- and 46-bit.
// We somehow need to figure out which one we are using now and choose
// one of 0x00000fffffffffffUL and 0x00003fffffffffffUL.
// Note that with 'ulimit -s unlimited' the stack is moved away from the top
// of the address space, so simply checking the stack address is not enough.
// This should (does) work for both PowerPC64 Endian modes.
+ // Similarly, aarch64 has multiple address space layouts: 39, 42 and 47-bit.
return (1ULL << (MostSignificantSetBitIndex(GET_CURRENT_FRAME()) + 1)) - 1;
-# elif defined(__aarch64__)
- return (1ULL << 39) - 1;
# elif defined(__mips64)
return (1ULL << 40) - 1;
# else