[PATCH] D84854: [llvm-readobj/readelf] - Refine the implementation of printMipsOptions().

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 29 08:35:34 PDT 2020


grimar created this revision.
grimar added reviewers: jhenderson, MaskRay, atanasyan.
Herald added subscribers: rupprecht, arichardson, sdardis, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.
grimar requested review of this revision.

`printMipsOptions()` and the test related has the following issues currently:

1. It does not check the value of Elf_Mips_Options<ELFT>::size field.
2. For ODK_REGINFO options it is possible to read past the end of buffer, because there is no check against the `sizeof(Elf_Mips_RegInfo<ELFT>)`.
3. The error about the broken size is just printed to the standard output.
4. The binary input is used for the test.
5. There is no testing for multiple options in the .MIPS.options section, though the code supports it.
6. Only llvm-readobj is tested, but not llvm-readelf.
7. "Unsupported MIPS options tag" message does not reveal the tag ID/name.

This patch fixes all of these points.


https://reviews.llvm.org/D84854

Files:
  llvm/test/tools/llvm-readobj/ELF/Inputs/options.obj.elf-mipsel
  llvm/test/tools/llvm-readobj/ELF/mips-options-sec.test
  llvm/tools/llvm-readobj/ELFDumper.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84854.281610.patch
Type: text/x-patch
Size: 7763 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200729/d1403bd1/attachment.bin>


More information about the llvm-commits mailing list