This is an archive of the discontinued LLVM Phabricator instance.

[llvm-readelf/readobj] - Refine the error reporting in printMipsABIFlags() methods.
ClosedPublic

Authored by grimar on Jul 17 2020, 8:18 AM.

Details

Summary

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.

Diff Detail

Event Timeline

grimar created this revision.Jul 17 2020, 8:18 AM
atanasyan accepted this revision.Jul 17 2020, 9:20 AM

LGTM. Thanks

This revision is now accepted and ready to land.Jul 17 2020, 9:20 AM
This revision was automatically updated to reflect the committed changes.
jhenderson added inline comments.Jul 21 2020, 12:43 AM
llvm/test/tools/llvm-readobj/ELF/mips-abiflags.test
322

The implicit-check-not on the llvm-readobj case implies there is other output expected? What is this other output, and should we actually be checking it?

grimar marked an inline comment as done.Jul 21 2020, 1:48 AM
grimar added inline comments.
llvm/test/tools/llvm-readobj/ELF/mips-abiflags.test
322

The full output is:

File: <file name here>
Format: elf64-mips
Arch: mips64el
AddressSize: 64bit
LoadName: <Not found>
There is no .MIPS.abiflags section in the file.
There is no .MIPS.options section in the file.
There is no .reginfo section in the file.

should we actually be checking it?

It doesn't look like that to me.

jhenderson added inline comments.Jul 21 2020, 2:15 AM
llvm/test/tools/llvm-readobj/ELF/mips-abiflags.test
322

Okay, thanks.