[PATCH] D74595: [llvm-readobj] - Report warnings instead of errors for broken relocations.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 17 07:50:57 PST 2020


jhenderson added inline comments.


================
Comment at: llvm/test/Object/invalid.test:420
 
-# RUN: yaml2obj %s --docnum=21 -o %t21
-# RUN: llvm-readobj --dynamic-table %t21 2>&1 | FileCheck -DFILE=%t21 --check-prefix=INVALID-DTSTRTAB %s
+# RUN: yaml2obj %s --docnum=20 -o %t20
+# RUN: llvm-readobj --dynamic-table %t20 2>&1 | FileCheck -DFILE=%t20 --check-prefix=INVALID-DTSTRTAB %s
----------------
grimar wrote:
> MaskRay wrote:
> > We probably should split `invalid.test`. For example, segments related errors and sections related errors can be separated.
> It feels that some of the tests might go to the corresponding tools test folders.
> (e.g. docnum 21 below)
Better yet would be to replace those tests which are testing library code with gtest unit tests to test the interfaces directly instead (and then additional tests in the tools folder to show the tools correctly handle the respective places properly).


================
Comment at: llvm/test/tools/llvm-readobj/ELF/relocation-errors.test:1
+## Check how do we report warnings when dumping an object with broken relocations.
+
----------------
Delete "do"


================
Comment at: llvm/test/tools/llvm-readobj/ELF/relocation-errors.test:55-58
+## Case 2: Test that no warning is reported for a relocation against a symbol with index 0.
+      - Offset: 0x2
+        Symbol: 0
+        Type:   R_X86_64_NONE
----------------
Seems like this overlaps with reloc-no-sym.test? Could we get rid of one or the other?


================
Comment at: llvm/test/tools/llvm-readobj/ELF/relocation-errors.test:69
+        Type:   R_X86_64_NONE
+## Case 5: Test a relocation in the section that is linked to a symbol table that
+##         has a section type that is not a SHT_SYMTAB or SHT_DYNSYM.
----------------
relocation in a section...


================
Comment at: llvm/test/tools/llvm-readobj/ELF/relocation-errors.test:70
+## Case 5: Test a relocation in the section that is linked to a symbol table that
+##         has a section type that is not a SHT_SYMTAB or SHT_DYNSYM.
+##         In this case the code fails to find a corresponding symbol string table.
----------------
is neither SHT_SYMTAB nor SHT_DYNSYM


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74595/new/

https://reviews.llvm.org/D74595





More information about the llvm-commits mailing list