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

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 3 01:37:00 PST 2021


jhenderson added a comment.

Some time ago, I filed https://bugs.llvm.org/show_bug.cgi?id=45729, which I think this will address? Is there a particular reason to pay any attention to the symbol type at all, other than to pick the "best" one if there are multiple candidates? Even if someone is using DATA or CODE, I'm not sure we should pay any attention to the symbol type - just pick the symbol that matches the requested address, possibly restricting it to one in the matching symbol. (I haven't checked GNU behaviour to make sure what I'm saying makes sense compared to addr2line, mind you).



================
Comment at: llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp:162
+    uint8_t Type = ELFSymbolRef(Symbol).getELFType();
+    // Functions defined in assembly are often STT_NONE.
+    if (Type != ELF::STT_NOTYPE && Type != ELF::STT_FUNC &&
----------------



================
Comment at: llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp:200
+  // optimization. Treat everything else (ELF STT_NOTYPE, STT_FUNC and
+  // STT_GNU_IFUNC ) function symbols which can be symbolize addresses.
+  auto &M = SymbolType != SymbolRef::ST_Data ? Functions : Objects;
----------------
The last line of this comment seems messed up? I've suggested what I think is intended.


================
Comment at: llvm/test/DebugInfo/Symbolize/ELF/symtab-file.yaml:1
+# RUN: yaml2obj %s -o %t
+# RUN: llvm-symbolizer --obj=%t 0 1 2 | FileCheck %s
----------------
Top-level test comment saying what this test is trying to show? Same in the other tests.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95916



More information about the llvm-commits mailing list