1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/tools/llvm-readobj
Georgii Rymar 089f3ae98c [llvm-readobj] - Refactor the MipsGOTParser<ELFT> to stop using report_fatal_error().
`MipsGOTParser` is a helper class that is used to dump MIPS GOT and PLT.
There is a problem with it: it might call report_fatal_error() on invalid input.
When this happens, the tool reports a crash:

```
# command stderr:
LLVM ERROR: Cannot find PLTGOT dynamic table tag.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backt
race.
Stack dump:
...
```

Such error were not tested. In this patch I've refactored `MipsGOTParser`:

I've splitted handling of GOT and PLT to separate methods. This allows to propagate
any possible errors to caller and should allow to dump the PLT when something is wrong
with the GOT and vise versa in the future.

I've added tests for each `report_fatal_error()`
and now calling the `reportError` instead. In the future we might want to switch to
reporting warnings, but it requres the additional testing and should
be performed independently.

I've kept `unwrapOrError` calls untouched for now as I'd like to focus on eliminating
`report_fatal_error` calls in this patch only.

Differential revision: https://reviews.llvm.org/D83225
2020-07-07 16:43:38 +03:00
..
ARMEHABIPrinter.h
ARMWinEHPrinter.cpp [llvm-readobj] Fix/improve printing WinEH unwind info for linked PE images 2019-12-11 10:20:34 +02:00
ARMWinEHPrinter.h
CMakeLists.txt
COFFDumper.cpp [llvm-readobj][COFF] add .llvm.call-graph-profile section dump 2020-06-25 09:52:49 -07:00
COFFImportDumper.cpp
DwarfCFIEHPrinter.h [llvm-readobj] - Cleanup the DwarfCFIEH::PrinterContext class. NFCI. 2020-05-29 16:45:18 +03:00
ELFDumper.cpp [llvm-readobj] - Refactor the MipsGOTParser<ELFT> to stop using report_fatal_error(). 2020-07-07 16:43:38 +03:00
Error.cpp
Error.h
llvm-readobj.cpp [llvm-readobj][COFF] add .llvm.call-graph-profile section dump 2020-06-25 09:52:49 -07:00
llvm-readobj.h
LLVMBuild.txt
MachODumper.cpp
ObjDumper.cpp Make bugpoint work with gcc5 again. 2020-01-29 03:11:00 +01:00
ObjDumper.h [llvm-readelf] - Split GNUStyle<ELFT>::printHashHistogram. NFC. 2020-05-27 13:59:20 +03:00
StackMapPrinter.h
WasmDumper.cpp [WebAssembly] Adding 64-bit version of R_WASM_MEMORY_ADDR_* relocs 2020-06-15 10:07:42 -07:00
Win64EHDumper.cpp [llvm-readobj] Fix/improve printing WinEH unwind info for linked PE images 2019-12-11 10:20:34 +02:00
Win64EHDumper.h
WindowsResourceDumper.cpp
WindowsResourceDumper.h
XCOFFDumper.cpp [NFC][XCOFF] refactor readobj/XCOFFDumper.cpp 2020-04-07 11:33:31 -04:00