OSDN Git Service

[ELF] --warn-backrefs: check that D79300 fixed an issue due to `mb = {}`
authorFangrui Song <maskray@google.com>
Sat, 27 Jun 2020 03:31:47 +0000 (20:31 -0700)
committerFangrui Song <maskray@google.com>
Sat, 27 Jun 2020 03:31:47 +0000 (20:31 -0700)
commitd94526bb5fa5a22645240aa5bee5a3163fa193a9
tree5b1cf131aea227fb71c2303f8c7a86b5a2bc640c
parent059994f2190f04b8580562efb875d3a2fd91b0b8
[ELF] --warn-backrefs: check that D79300 fixed an issue due to `mb = {}`

D79300 forgot to change `getBuffer().empty()` in LazyObjFile::parse to
`fetched`. This caused incorrect iterating after the current LazyObjFile was
fetched. This issue is benign and can just cause loss of "undefined symbols"
and "backward reference" diagnostics.

Before D79300 `mb = {}` caused --warn-backrefs-exclude to be useless for
a fetched LazyObjFile.

Add two test cases.
lld/ELF/InputFiles.cpp
lld/test/ELF/warn-backrefs.s