Skip to content

Commit 9c16a4a

Browse files
committed
[ELF] INSERT [AFTER|BEFORE]: support quoted names
1 parent d5521d1 commit 9c16a4a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lld/ELF/ScriptParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ void ScriptParser::readSections() {
660660
isAfter = true;
661661
else if (!consume("BEFORE"))
662662
setError("expected AFTER/BEFORE, but got '" + next() + "'");
663-
StringRef where = next();
663+
StringRef where = readName();
664664
SmallVector<StringRef, 0> names;
665665
for (SectionCommand *cmd : v)
666666
if (auto *os = dyn_cast<OutputDesc>(cmd))

lld/test/ELF/linkerscript/insert-after.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
SECTIONS { .byte : { BYTE(0) } } INSERT AFTER .data;
4343

44-
SECTIONS { .foo.data : { *(.foo.data) } } INSERT AFTER .data;
44+
SECTIONS { .foo.data : { *(.foo.data) } } INSERT AFTER ".data";
4545

4646
## The input section .foo.text is an orphan. It will be placed in .foo.text
4747
SECTIONS { .foo.text : {} } INSERT AFTER .text;

lld/test/ELF/linkerscript/insert-before.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ SECTIONS { .byte : { BYTE(0) } } INSERT BEFORE .data;
5050
SECTIONS { .foo.data : { *(.foo.data) } } INSERT BEFORE .data;
5151

5252
## The input section .foo.text is an orphan. It will be placed in .foo.text
53-
SECTIONS { .foo.text : { x0 = .; } } INSERT BEFORE .text;
53+
SECTIONS { .foo.text : { x0 = .; } } INSERT BEFORE ".text";

0 commit comments

Comments
 (0)