diff options
author | Fangrui Song <i@maskray.me> | 2022-11-19 01:06:26 +0000 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2022-11-19 01:06:26 +0000 |
commit | 00be3578e0841dd9abe408e5b4946180de0bf46b (patch) | |
tree | 3e0b124e7d79c30769dd93d473657181e2472e02 /llvm/lib/Object | |
parent | 3c36de55f5e60dee8f1bc04bd201f6dd762b3423 (diff) | |
download | llvm-00be3578e0841dd9abe408e5b4946180de0bf46b.zip llvm-00be3578e0841dd9abe408e5b4946180de0bf46b.tar.gz llvm-00be3578e0841dd9abe408e5b4946180de0bf46b.tar.bz2 |
[asan] Keep Itanium mangled names in global metadata
The runtime calls `MaybeDemangleGlobalName` for error reporting and
`__cxxabiv1::__cxa_demangle` is called if available, so demanging Itanium
mangled names in global metadata is unnecessary and wastes data size.
Add `MaybeDemangleGlobalName` in ODR violation detection to support demangled
names in a suppressions file. `MaybeDemangleGlobalName` may call
`DemangleCXXABI` and leak memory. Use an internal allocation to prevent lsan
leak (in case there is no fatal asan error).
The debug feature `report_globals=2` prints information for all instrumented
global variables. `MaybeDemangleGlobalName` would be slow, so don't do that.
The output looks like `Added Global[0x56448f092d60]: beg=0x56448fa66d60 size=4/32 name=_ZL13test_global_2`
and I think the mangled name is fine.
Other mangled schemes e.g. Windows (see win-string-literal.ll) remain the
current behavior.
Reviewed By: hctim
Differential Revision: https://reviews.llvm.org/D138095
Diffstat (limited to 'llvm/lib/Object')
0 files changed, 0 insertions, 0 deletions