[PATCH] D137676: [compiler-rt][hwasan] Do not call InitLoadedGlobals in __hwasan_init

Leonard Chan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 9 11:47:29 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG40dffefa0e65: [compiler-rt][hwasan] Do not call InitLoadedGlobals in __hwasan_init (authored by leonardchan).

Changed prior to commit:
  https://reviews.llvm.org/D137676?vs=474101&id=474321#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137676/new/

https://reviews.llvm.org/D137676

Files:
  compiler-rt/lib/hwasan/hwasan.cpp


Index: compiler-rt/lib/hwasan/hwasan.cpp
===================================================================
--- compiler-rt/lib/hwasan/hwasan.cpp
+++ compiler-rt/lib/hwasan/hwasan.cpp
@@ -340,7 +340,13 @@
   DisableCoreDumperIfNecessary();
 
   InitInstrumentation();
-  InitLoadedGlobals();
+  if constexpr (!SANITIZER_FUCHSIA) {
+    // Fuchsia's libc provides a hook (__sanitizer_module_loaded) that runs on
+    // the startup path which calls into __hwasan_library_loaded on all
+    // initially loaded modules, so explicitly registering the globals here
+    // isn't needed.
+    InitLoadedGlobals();
+  }
 
   // Needs to be called here because flags()->random_tags might not have been
   // initialized when InitInstrumentation() was called.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137676.474321.patch
Type: text/x-patch
Size: 753 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221109/74850087/attachment.bin>


More information about the llvm-commits mailing list