pcc added a comment.

What guarantee do we have that the `__hwasan_init` .preinit_array entry will be 
placed before the user's .preinit_array entries?



================
Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:842
+      if (!Args.hasArg(options::OPT_shared))
+        SharedRuntimes.push_back("hwasan-preinit");
     }
----------------
Shouldn't it be added to `HelperStaticRuntimes`? Otherwise I'm not sure how 
this would work because the library would need to be enclosed in 
`--whole-archive` in order to be included in the link.


================
Comment at: compiler-rt/lib/hwasan/hwasan_preinit.cpp:22
+__attribute__((section(".preinit_array"), used))
+void (*__local_hwasan_preinit)(void) = __hwasan_init;
+#endif
----------------
Can it be static?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118171

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to