[llvm-readelf/readobj] - Refine the error reporting in printMipsABIFlags() methods.
authorGeorgii Rymar <grimar@accesssoftek.com>
Fri, 17 Jul 2020 12:45:01 +0000 (15:45 +0300)
committerGeorgii Rymar <grimar@accesssoftek.com>
Mon, 20 Jul 2020 08:30:17 +0000 (11:30 +0300)
commit256aea816da45bd3bc52317cbc89e704095a8991
treefcfc1e1279c55204cca490d508c0a228a54a320d
parentb6073ee9ae842d1999fd7798a0aac0f8427d6aea
[llvm-readelf/readobj] - Refine the error reporting in printMipsABIFlags() methods.

It fixes/improves the following:
1) Some code was duplicated.
2) A "The .MIPS.abiflags section has a wrong size" error was not reported as a warning,
   but was printed to stdout for the LLVM style. Also, it was reported as an error for the GNU style.
   This patch changes the behavior to be consistent and to report warnings.
3) `unwrapOrError()` was used before, now a warning is reported instead.

Differential revision: https://reviews.llvm.org/D84033
llvm/test/tools/llvm-readobj/ELF/mips-abiflags.test
llvm/tools/llvm-readobj/ELFDumper.cpp