[PATCH] D85623: [llvm-objdump] Change a PLT decoding error to a warning

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 02:07:37 PDT 2020


grimar added inline comments.


================
Comment at: llvm/test/tools/llvm-objdump/ELF/AArch64/plt.test:21
 
+# RUN: yaml2obj %s -o %t.warn
+# RUN: llvm-objdump -d %t.warn 2>&1 | FileCheck %s --check-prefix=INVALID -DFILE=%t.warn
----------------
Probably it might be a bit better to be explicit here:

```
yaml2obj %s -D SYM=0 -o %t.warn
```


================
Comment at: llvm/test/tools/llvm-objdump/ELF/AArch64/plt.test:41
       - Offset: 0x0000000000230018
-        Symbol: f1
+        Symbol: [[SYM=<none>]]
         Type:   R_AARCH64_JUMP_SLOT
----------------
I'd do:

`[[SYM=f1]]`

I.e. then we have a valid YAML input by default and break it with `-D SYM=0` for a particular test.

Otherwise, with `[[SYM=<none>]]` the input is initially broken, what prevents the possible futher extensions
(e.g. testing the second symbol) for this test without fixing values back to normal ones in each following
yaml2obj invocation.




================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:1408
+                          " references an invalid symbol",
+                      Obj->getFileName());
+      }
----------------
Will it be better not to consume the error and to report something like:
"warning: unable to read the name of a symbol for PLT entry at ....: <error message with the reason>"?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85623



More information about the llvm-commits mailing list