[PATCH] D71735: [ELF] Don't suggest an alternative spelling for a symbol in a discarded section

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 20 01:24:47 PST 2019


grimar added inline comments.


================
Comment at: lld/ELF/Relocations.cpp:725
+    // will give an error. Don't suggest an alternative spelling.
+    auto *file = dyn_cast_or_null<ObjFile<ELFT>>(sym.file);
+    if (file && sym.discardedSecIdx != 0 &&
----------------
I'd suggest to:

```
if (auto *file = dyn_cast_or_null<ObjFile<ELFT>>(sym.file))
...
```


================
Comment at: lld/test/ELF/undef-not-suggest.s:1
+# REQUIRES: riscv
+## Check we don't suggest alternative spelling for relocations to symbols
----------------
I wonder if we should use yaml2obj (if possible) and make this test be not 'riscv' specific?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71735





More information about the llvm-commits mailing list