[llvm] [hwasan] Add hwasan-all-globals option (PR #149621)
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 22 11:04:03 PDT 2025
================
@@ -1780,11 +1790,21 @@ void HWAddressSanitizer::instrumentGlobals() {
if (GV.hasCommonLinkage())
continue;
- // Globals with custom sections may be used in __start_/__stop_ enumeration,
- // which would be broken both by adding tags and potentially by the extra
- // padding/alignment that we insert.
- if (GV.hasSection())
- continue;
+ if (ClAllGlobals) {
+ // Avoid adding metadata emitted for the hwasan instrumentation itself.
+ // Code which makes assumptions about memory layout of globals between
+ // __start_<section>/__end_<section> linker-generated symbols may need
----------------
pcc wrote:
nit: `s/__end_/__stop_/`
https://github.com/llvm/llvm-project/pull/149621
More information about the llvm-commits
mailing list