[PATCH] D138095: [asan] Keep Itanium mangled names in global metadata

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 16 12:34:09 PST 2022


MaskRay added a comment.

In D138095#3931582 <https://reviews.llvm.org/D138095#3931582>, @hctim wrote:

> In D138095#3931484 <https://reviews.llvm.org/D138095#3931484>, @dblaikie wrote:
>
>> Huh, fascinating - so we used the unmangled name as a symbol name, punctuation, spaces, and all?
>>
>> (interesting to know that sanitizers end up with their own copies of mangled names too - another thing we could consider deduplicating/maybe sharing with some debug info/symbol table reductions at some point (I guess if we just simplify mangled names enough - use hashes, etc, this'd fall out naturally for the sanitizers (though all demanglers would need to have access to some side table of hash->mangled name table, which I guess sanitizers need at runtime, so couldn't be dropped during linking (previously had considered this strategy since the linker would need to produce good diagnostics - but I guess runtime symbolizers need useful symbol names too, etc)))
>
> nice triple-nested parenthetical thought!
>
> yes - this is a room for opportunity :). i think the major thing that would need to happen is for llvm-symbolizer to be able to symbolize an address half way through a GV (although it may be possible to find the start pointer using the sanitizer metadata).

Yes, definitely room for improvement. The instrumentation - runtime protocol is more private than DWARF debug information (which has more consumers and therefore has more restriction on things like string table usage.)
In some operating systems that adopt `.ctf`, I think `.ctf` just reuses the ELF symbol table `.symtab` and `.strtab`, resulting in some saving. (This is some work going on in binutils, but I don't actively keep an eye on it.)

In instrumentaiton-based PGO, `__llvm_prf_nm` uses compressed content with hashes indexing into it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138095



More information about the llvm-commits mailing list