[PATCH] D95916: DebugInfo/Symbolize: Allow STT_NOTYPE/STT_GNU_IFUNC symbols for .symtab symbolization

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 2 19:45:15 PST 2021


MaskRay created this revision.
MaskRay added reviewers: dblaikie, jhenderson.
Herald added subscribers: hiraditya, emaste.
MaskRay requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

In assembly files, omitting `.type foo, at function` is common. Such functions have
type `STT_NOTYPE` and llvm-symbolizer reports `??` for them.

An ifunc symbol usually has an associated resolver symbol which is defined at
the same address. Either one is ok. The resolver symbol may not end up in the
symbol table if (object file) `.L` is used (linked image) .symtab is stripped
while .dynsym is retained.

This patch allows STT_NOTYPE/STT_GNU_IFUNC symbols for .symtab symbolization.

If a file symbol (`STT_FILE`) is present, it precedes the other STB_LOCAL
symbols for the file. addr2line can attach the filename to STB_LOCAL symbols
(and to STB_WEAK/STB_GLOBAL symbols if no symbol precedes STT_FILE ->
essentially the single filename case) DebugInfo/Symbolize has not implemented
this heuristic. I have left TODO in the test files.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D95916

Files:
  llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
  llvm/test/DebugInfo/Symbolize/ELF/symtab-ifunc.s
  llvm/test/DebugInfo/Symbolize/ELF/symtab-notype.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95916.320977.patch
Type: text/x-patch
Size: 3714 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210203/c7f1d81b/attachment.bin>


More information about the llvm-commits mailing list