[PATCH] D84240: [llvm-readelf] - Introduce describe() helper functions.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 22 04:27:26 PDT 2020


grimar marked 3 inline comments as done.
grimar added inline comments.


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:3127
-    unsigned SecNdx = PltRelSec - &cantFail(Obj->sections()).front();
-    return createError("unable to get a symbol table linked to the RELPLT "
-                       "section with index " +
----------------
MaskRay wrote:
> The previous "RELPLT" seems more specific than SHT_PROGBITS. Do we need to change it?
> 
So now in `mips-plt.test`
instead of `unable to get a symbol table linked to the RELPLT section with index 2`
we report `unable to get a symbol table linked to the SHT_PROGBITS section with index 2`

I think this change is neutral, becase it probably was not clear what is `RELPLT` anyways (the message could mention a section that was found at the address specified in `DT_JMPREL`  instead and perhaps, the better name is `JMPREL` then.
Also, in the case of a broken object/invalid dynamic tag value, we could have something else instead of `SHT_PROGBITS`, so printing a section type looks useful too.

Perhaps a better mesage can be:
```
unable to get a symbol table linked to the SHT_PROGBITS section with index 2, found at address 0x12345 (DT_JMPREL)
```


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

https://reviews.llvm.org/D84240





More information about the llvm-commits mailing list