[lld][ELF] Fix error message

The error previously talked about a "section header" but was actually
referring to a program header.

Reviewed by: grimar, MaskRay

Differential Revision: https://reviews.llvm.org/D76846
This commit is contained in:
James Henderson
2020-03-26 14:14:50 +00:00
parent 87de9a0786
commit 3ff3c6986b
2 changed files with 2 additions and 2 deletions

View File

@@ -1223,7 +1223,7 @@ std::vector<size_t> LinkerScript::getPhdrIndices(OutputSection *cmd) {
if (Optional<size_t> idx = getPhdrIndex(phdrsCommands, s))
ret.push_back(*idx);
else if (s != "NONE")
error(cmd->location + ": section header '" + s +
error(cmd->location + ": program header '" + s +
"' is not listed in PHDRS");
}
return ret;

View File

@@ -128,7 +128,7 @@
# DEFHDR-NEXT: PF_X (0x1)
# DEFHDR-NEXT: ]
# BADHDR: {{.*}}.script:1: section header 'bar' is not listed in PHDRS
# BADHDR: {{.*}}.script:1: program header 'bar' is not listed in PHDRS
# RUN: echo "PHDRS { text PT_LOAD FOOHDR; }" > %t1.script
# RUN: not ld.lld -o /dev/null --script %t1.script %t 2>&1 | FileCheck --check-prefix=FOOHDR %s