[PATCH] D85303: [llvm-readobj/elf] - Remove `unwrapOrError` calls from DumpStyle<ELFT>::printRelocationsHelper.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 01:38:07 PDT 2020


jhenderson added inline comments.


================
Comment at: llvm/test/tools/llvm-readobj/ELF/packed-relocs.test:60
+
+## FIXME: GNU still reports an error earlier than tries to actually dump relocations.
+# BROKEN-RELA-GNU: error: '[[FILE]]': section [index 1] has a sh_offset (0xffffffff) + sh_size (0x3a) that is greater than the file size (0x238)
----------------



================
Comment at: llvm/test/tools/llvm-readobj/ELF/packed-relocs.test:123
+
+## FIXME: GNU still reports an error earlier than tries to actually dump relocations.
+# BROKEN-REL-GNU: error: '[[FILE]]': section [index 1] has a sh_offset (0xffffffff) + sh_size (0x12) that cannot be represented
----------------
Ditto.


================
Comment at: llvm/test/tools/llvm-readobj/ELF/relocations.test:202
+
+## Case A: check the case when relocations can't be read from the SHT_REL section.
+# RUN: yaml2obj %s --docnum=1 -DENTSIZEREL=1 -o %t.broken.rel
----------------



================
Comment at: llvm/test/tools/llvm-readobj/ELF/relocations.test:233
+
+## Case B: check the case when relocations can't be read from the SHT_RELA section.
+# RUN: yaml2obj %s --docnum=1 -DENTSIZERELA=1 -o %t.broken.rela
----------------



================
Comment at: llvm/test/tools/llvm-readobj/ELF/relr-relocs.test:39
 
-# RUN: yaml2obj --docnum=1 %s \
-# RUN:   | llvm-readelf -relocations -raw-relr - \
+# RUN: llvm-readelf -relocations -raw-relr %t1 \
 # RUN:   | FileCheck --check-prefix=RAW-GNU1 %s
----------------
Could you use double-dashes here and below for the options, whilst modifying these lines, please?


================
Comment at: llvm/test/tools/llvm-readobj/ELF/relr-relocs.test:158
+
+## Case A: check the case when relocations can't be read from the SHT_RELR section.
+# RUN: yaml2obj --docnum=2 -DENTSIZE=1 %s -o %t2.broken
----------------



================
Comment at: llvm/test/tools/llvm-readobj/ELF/relr-relocs.test:171
+
+## FIXME: GNU still reports an error earlier than tries to actually dump relocations.
+# BROKEN-GNU: error: '[[FILE]]': section [index 1] has an invalid sh_entsize: 1
----------------
Same suggestion as elsewhere.


================
Comment at: llvm/test/tools/llvm-readobj/ELF/relr-relocs.test:174
+
+## Case B: check the case when relocations can't be read from the SHT_ANDROID_RELR section.
+##         SHT_ANDROID_RELR = 0x6fffff00.
----------------



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

https://reviews.llvm.org/D85303



More information about the llvm-commits mailing list