Skip to content

Commit 3ff3c69

Browse files
committed
[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
1 parent 87de9a0 commit 3ff3c69

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lld/ELF/LinkerScript.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ std::vector<size_t> LinkerScript::getPhdrIndices(OutputSection *cmd) {
12231223
if (Optional<size_t> idx = getPhdrIndex(phdrsCommands, s))
12241224
ret.push_back(*idx);
12251225
else if (s != "NONE")
1226-
error(cmd->location + ": section header '" + s +
1226+
error(cmd->location + ": program header '" + s +
12271227
"' is not listed in PHDRS");
12281228
}
12291229
return ret;

lld/test/ELF/linkerscript/phdrs.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
# DEFHDR-NEXT: PF_X (0x1)
129129
# DEFHDR-NEXT: ]
130130

131-
# BADHDR: {{.*}}.script:1: section header 'bar' is not listed in PHDRS
131+
# BADHDR: {{.*}}.script:1: program header 'bar' is not listed in PHDRS
132132

133133
# RUN: echo "PHDRS { text PT_LOAD FOOHDR; }" > %t1.script
134134
# RUN: not ld.lld -o /dev/null --script %t1.script %t 2>&1 | FileCheck --check-prefix=FOOHDR %s

0 commit comments

Comments
 (0)