[PATCH] D88089: [llvm-readelf/obj] - Fix extended section symbol indices printed in warnings for MIPS GOT/PLT entries.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 23 02:05:43 PDT 2020
grimar added inline comments.
================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:6778-6779
std::string SymName = this->dumper()->getFullSymbolName(
- Sym, Sym - &Parser.getGotDynSyms()[0],
- this->dumper()->getDynamicStringTable(), true);
W.printNumber("Name", SymName, Sym->st_name);
----------------
jhenderson wrote:
> I don't know MIPS at all. Is `getGotDynSyms()` equivalent to `dynamic_symbols()`?
No. `getGotDynSyms` was introduced by me in D87899 and it was a mistake. It returns `GotDynSyms`, which is:
```
GotDynSyms = DynSyms.drop_front(*DtGotSym);
```
where `DynSyms` == `dynamic_symbols()`
In this place we want to pass symbol index, so should really use `dynamic_symbols()[0]` instead of `GotDynSyms[0]`.
This issue was catched by the test case.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88089/new/
https://reviews.llvm.org/D88089
More information about the llvm-commits
mailing list