[all-commits] [llvm/llvm-project] 948620: [llvm-readobj/readelf] - Refine the implementation...

Georgii Rymar via All-commits all-commits at lists.llvm.org
Tue Aug 4 01:40:39 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 94862018375f2330b070cbf36085919b13a0c7a4
      https://github.com/llvm/llvm-project/commit/94862018375f2330b070cbf36085919b13a0c7a4
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2020-08-04 (Tue, 04 Aug 2020)

  Changed paths:
    R llvm/test/tools/llvm-readobj/ELF/Inputs/options.obj.elf-mipsel
    M llvm/test/tools/llvm-readobj/ELF/mips-options-sec.test
    M llvm/tools/llvm-readobj/ELFDumper.cpp

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

`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.

Differential revision: https://reviews.llvm.org/D84854




More information about the All-commits mailing list