[ELF] Don't suggest an alternative spelling for a symbol in a discarded section
authorFangrui Song <maskray@google.com>
Fri, 20 Dec 2019 00:04:45 +0000 (16:04 -0800)
committerFangrui Song <maskray@google.com>
Mon, 23 Dec 2019 17:10:29 +0000 (09:10 -0800)
commit261b7b4a6b06dd32bea46383f8fef1e56e68c88a
treeefc5eb0ba9dbdf00dd5fef37058dfa08ce524de2
parentc7c05b0c8a046c9bef46b4e4c7a35c262d1d880a
[ELF] Don't suggest an alternative spelling for a symbol in a discarded section

For undef-not-suggest.test, we currently make redundant alternative
spelling suggestions:

```
ld.lld: error: relocation refers to a discarded section: .text.foo
>>> defined in a.o
>>> section group signature: foo
>>> prevailing definition is in a.o
>>> referenced by a.o:(.rodata+0x0)
>>> did you mean:
>>> defined in: a.o

ld.lld: error: relocation refers to a symbol in a discarded section: foo
>>> defined in a.o
>>> section group signature: foo
>>> prevailing definition is in a.o
>>> referenced by a.o:(.rodata+0x8)
>>> did you mean: for
>>> defined in: a.o
```

Reviewed By: grimar, ruiu

Differential Revision: https://reviews.llvm.org/D71735
lld/ELF/Relocations.cpp
lld/test/ELF/undef-not-suggest.test [new file with mode: 0644]