re PR sanitizer/80953 (Support libsanitizer on Solaris)
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 13 Mar 2019 09:15:02 +0000 (09:15 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Wed, 13 Mar 2019 09:15:02 +0000 (09:15 +0000)
PR sanitizer/80953
Merge from LLVM revision 355979
* asan/asan_globals.c (GetGlobalsForAddress): Use internal_memcpy to
copy Global objects for SPARC with GCC.

From-SVN: r269640

libsanitizer/ChangeLog
libsanitizer/asan/asan_globals.cc

index 65df77e742f195b17fe605a966e649ae8291a392..4815db0c22c5ee991baa82d6be58746d09413d11 100644 (file)
@@ -1,3 +1,10 @@
+2019-03-13  Eric Botcazou  <ebotcazou@adacore.com>
+
+       PR sanitizer/80953
+       Merge from LLVM revision 355979
+       * asan/asan_globals.c (GetGlobalsForAddress): Use internal_memcpy to
+       copy Global objects for SPARC with GCC.
+
 2019-03-13  Eric Botcazou  <ebotcazou@adacore.com>
 
        PR sanitizer/80953
index a59a2dc27a47be412fe91e04e013bf4a60b4018c..10f090940fe3ca829b7d20846cbae6b1977fe9e9 100644 (file)
@@ -112,7 +112,11 @@ int GetGlobalsForAddress(uptr addr, Global *globals, u32 *reg_sites,
     if (flags()->report_globals >= 2)
       ReportGlobal(g, "Search");
     if (IsAddressNearGlobal(addr, g)) {
+#if defined(__GNUC__) && defined(__sparc__)
+      internal_memcpy(&globals[res], &g, sizeof(g));
+#else
       globals[res] = g;
+#endif
       if (reg_sites)
         reg_sites[res] = FindRegistrationSite(&g);
       res++;