[llvm-branch-commits] [compiler-rt-branch] r270407 - Merging r263218:

Mohit K. Bhakkad via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon May 23 01:33:59 PDT 2016


Author: mohit.bhakkad
Date: Mon May 23 03:30:41 2016
New Revision: 270407

URL: http://llvm.org/viewvc/llvm-project?rev=270407&view=rev
Log:
Merging r263218:
------------------------------------------------------------------------
r263218 | mohit.bhakkad | 2016-03-11 16:21:03 +0530 (Fri, 11 Mar 2016) | 7 lines

[Sanitizer][MIPS] internal lstat and fstat for mips64

Reviewers: dvyukov

Subscribers: jaydeep, sagar, llvm-commits

Differential Revision: http://reviews.llvm.org/D18078
------------------------------------------------------------------------

Modified:
    compiler-rt/branches/release_38/   (props changed)
    compiler-rt/branches/release_38/lib/sanitizer_common/sanitizer_linux.cc

Propchange: compiler-rt/branches/release_38/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon May 23 03:30:41 2016
@@ -1 +1 @@
-/compiler-rt/trunk:258916,259755,260669,260839,260946,261073,261142,261148,261193,261263,261513,261721,261723,261837,261982,262209,262302-262303,262690,263001
+/compiler-rt/trunk:258916,259755,260669,260839,260946,261073,261142,261148,261193,261263,261513,261721,261723,261837,261982,262209,262302-262303,262690,263001,263218

Modified: compiler-rt/branches/release_38/lib/sanitizer_common/sanitizer_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_38/lib/sanitizer_common/sanitizer_linux.cc?rev=270407&r1=270406&r2=270407&view=diff
==============================================================================
--- compiler-rt/branches/release_38/lib/sanitizer_common/sanitizer_linux.cc (original)
+++ compiler-rt/branches/release_38/lib/sanitizer_common/sanitizer_linux.cc Mon May 23 03:30:41 2016
@@ -241,7 +241,15 @@ uptr internal_lstat(const char *path, vo
   return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path,
                          (uptr)buf, AT_SYMLINK_NOFOLLOW);
 #elif SANITIZER_LINUX_USES_64BIT_SYSCALLS
+# if SANITIZER_MIPS64
+  // For mips64, lstat syscall fills buffer in the format of kernel_stat
+  struct kernel_stat kbuf;
+  int res = internal_syscall(SYSCALL(lstat), path, &kbuf);
+  kernel_stat_to_stat(&kbuf, (struct stat *)buf);
+  return res;
+# else
   return internal_syscall(SYSCALL(lstat), (uptr)path, (uptr)buf);
+# endif
 #else
   struct stat64 buf64;
   int res = internal_syscall(SYSCALL(lstat64), path, &buf64);
@@ -252,7 +260,15 @@ uptr internal_lstat(const char *path, vo
 
 uptr internal_fstat(fd_t fd, void *buf) {
 #if SANITIZER_FREEBSD || SANITIZER_LINUX_USES_64BIT_SYSCALLS
+# if SANITIZER_MIPS64
+  // For mips64, fstat syscall fills buffer in the format of kernel_stat
+  struct kernel_stat kbuf;
+  int res = internal_syscall(SYSCALL(fstat), fd, &kbuf);
+  kernel_stat_to_stat(&kbuf, (struct stat *)buf);
+  return res;
+# else
   return internal_syscall(SYSCALL(fstat), fd, (uptr)buf);
+# endif
 #else
   struct stat64 buf64;
   int res = internal_syscall(SYSCALL(fstat64), fd, &buf64);




More information about the llvm-branch-commits mailing list