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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 14 14:39:27 PST 2020


MaskRay 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
----------------
We probably should split `invalid.test`. For example, segments related errors and sections related errors can be separated.


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


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:3327
+  else
+    printRelocation(Obj, /*Sym=*/(*Target).first, /*Name=*/(*Target).second, R,
+                    IsRela);
----------------
`Target->first`


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:5750
 
+  std::string TargetName =  (*Target).second;
   SmallString<32> RelocName;
----------------
`Target->second`


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

https://reviews.llvm.org/D74595





More information about the llvm-commits mailing list