[ELF] Avoid false-positive assert in getErrPlace()
authorAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Wed, 15 Jan 2020 14:32:14 +0000 (14:32 +0000)
committerAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Wed, 15 Jan 2020 14:32:25 +0000 (14:32 +0000)
commit441410be471d5d0a5d1d47cf363de155e397a0c2
tree3b41232ec13fc53ddfb9880c75ba3ef5ca0ae8dd
parent4d14bfaa2cb1610104db6b0818fc7d74fad1bd8f
[ELF] Avoid false-positive assert in getErrPlace()

This assertion was added as part of D70659 but did not account for .bss
input sections. I noticed that this assert was incorrectly triggering
while building FreeBSD for MIPS64. Fixed by relaxing the assert to also
account for SHT_NOBITS input sections and adjust the test
mips-jalr-non-function.s to link a file with a .bss section first.

Reviewed By: MaskRay, grimar
Differential Revision: https://reviews.llvm.org/D72567
lld/ELF/Target.cpp
lld/test/ELF/mips-jalr-non-functions.s