Revert "Revert "Reland D61583 [ELF] Error on relocations to STT_SECTION symbols if the sections were discarded""

This reverts commit 729111cf1824159bb4dd331cab8a829eab30313f.

Reverting the previous commit breaks other LLD buildbots.

llvm-svn: 362743
This commit is contained in:
Sean Fertile
2019-06-06 20:16:53 +00:00
parent 38c5ee1802
commit 6ba76dd779
10 changed files with 100 additions and 12 deletions

View File

@@ -438,7 +438,8 @@ void InputSection::copyRelocations(uint8_t *Buf, ArrayRef<RelTy> Rels) {
// hopefully creates a frame that is ignored at runtime.
auto *D = dyn_cast<Defined>(&Sym);
if (!D) {
error("STT_SECTION symbol should be defined");
warn("STT_SECTION symbol should be defined");
P->setSymbolAndType(0, 0, false);
continue;
}
SectionBase *Section = D->Section->Repl;