From a196c82cf236299e00704f3fc23eba798bdc6e37 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Wed, 13 Mar 2019 09:15:02 +0000 Subject: [PATCH] re PR sanitizer/80953 (Support libsanitizer on Solaris) 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 | 7 +++++++ libsanitizer/asan/asan_globals.cc | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog index 65df77e742f..4815db0c22c 100644 --- a/libsanitizer/ChangeLog +++ b/libsanitizer/ChangeLog @@ -1,3 +1,10 @@ +2019-03-13 Eric Botcazou + + 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 PR sanitizer/80953 diff --git a/libsanitizer/asan/asan_globals.cc b/libsanitizer/asan/asan_globals.cc index a59a2dc27a4..10f090940fe 100644 --- a/libsanitizer/asan/asan_globals.cc +++ b/libsanitizer/asan/asan_globals.cc @@ -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++; -- 2.30.2