We should always include symbol name when reporting relocations error to simplify debugging of these issues. Without symbol names users have to manually investigate which of the libraries contain invalid relocations which can be cumbersome when linking multiple libraries.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Thank you for doing this!
ELF/Relocations.cpp | ||
---|---|---|
425–430 ↗ | (On Diff #68591) | You can call getName() on a local symbol, can't you? |
ELF/Relocations.cpp | ||
---|---|---|
425–430 ↗ | (On Diff #68591) | There is an assert(!isLocal()) in SymbolBody::getName(). The name for local symbols is empty, but it I could use the name offset and find name in the File string table (if it's there), does that sound fine to you? |
ELF/Relocations.cpp | ||
---|---|---|
425–430 ↗ | (On Diff #68591) | Ah, right. Please define something like this and use it. template <class ELFT> static StringRef getLocalSymName(elf::ObjectFile<ELFT> &F, SymbolBody &B) { return F.getStringTable().data() + B.getNameOffset(); } |