[llvm] [llvm-readobj] Resolve relocations to function symbols and addends in call-graph-info (PR #213156)
Roland McGrath via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 24 20:24:58 PDT 2026
================
----------------
frobtech wrote:
This is not what `STT_SECTION` symbols normally look like. They actually have `st_name = 0`. As symbols, they don't have any names. The normal `readelf` output shows you the section name from `.shstrndx` in the `Name` column when it's a `STT_SECTION` symbol. But it's not really right to say there is a symbol called `.text`--there could be one, and nothing would require it to have the `st_shndx` of a section with the same name (of the many such there might be) and `st_value` of zero; but there isn't one. In the example data, we should use something that looks like what the assembler actually produces.
This is important for this test data in particular because it's relevant to thinking about what the JSON output looks like. For things intended for programmatic use like the JSON, it really seems improper to me to have things like a `SymbolName` field that doesn't say exactly what `st_name` actually says in that entry. In the current version of the change, I can't actually tell whether it's delivering a false symbol name for nameless symbol (as e.g. `readelf -s` does in its human-readable output) or just faithfully reporting a symbol table entry that real assembler-produced symbol tables would never contain.
https://github.com/llvm/llvm-project/pull/213156
More information about the llvm-commits
mailing list