[ELF] Support input section description .rel[a].dyn in /DISCARD/

Reviewed By: ruiu

Differential Revision: https://reviews.llvm.org/D70695
This commit is contained in:
Fangrui Song
2019-11-25 13:24:18 -08:00
parent 92f1446b8b
commit a71c1e2a57
2 changed files with 16 additions and 5 deletions

View File

@@ -442,7 +442,7 @@ LinkerScript::computeInputSections(const InputSectionDescription *cmd) {
}
void LinkerScript::discard(InputSectionBase *s) {
if (s == in.shStrTab || s == mainPart->relaDyn || s == mainPart->relrDyn)
if (s == in.shStrTab || s == mainPart->relrDyn)
error("discarding " + s->name + " section is not allowed");
// You can discard .hash and .gnu.hash sections by linker scripts. Since