Skip to content

Commit a4921f1

Browse files
committed
[ELF] Output section phdr: support quoted names
1 parent 9c16a4a commit a4921f1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lld/ELF/ScriptParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1643,7 +1643,7 @@ SmallVector<StringRef, 0> ScriptParser::readOutputSectionPhdrs() {
16431643
SmallVector<StringRef, 0> phdrs;
16441644
while (!errorCount() && peek().starts_with(":")) {
16451645
StringRef tok = next();
1646-
phdrs.push_back((tok.size() == 1) ? next() : tok.substr(1));
1646+
phdrs.push_back((tok.size() == 1) ? readName() : tok.substr(1));
16471647
}
16481648
return phdrs;
16491649
}

lld/test/ELF/linkerscript/phdrs.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ PHDRS {all PT_LOAD FILEHDR PHDRS ;}
77
SECTIONS {
88
. = 0x10000200;
99
.text : {*(.text*)} :all
10-
.foo : {*(.foo.*)} :all
11-
.data : {*(.data.*)} :all}
10+
.foo : {*(.foo.*)} :"all"
11+
.data : {*(.data.*)} : "all"}
1212

1313
# RUN: ld.lld -o 1 -T 1.lds a.o
1414
# RUN: llvm-readelf -Sl 1 | FileCheck %s

0 commit comments

Comments
 (0)