[lld] e689515 - [ELF] OVERLAY: support quoted output section names
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Sat Jul 27 16:33:22 PDT 2024
Author: Fangrui Song
Date: 2024-07-27T16:33:18-07:00
New Revision: e6895154914adf32fc4d805cffdf0bec084ae711
URL: https://github.com/llvm/llvm-project/commit/e6895154914adf32fc4d805cffdf0bec084ae711
DIFF: https://github.com/llvm/llvm-project/commit/e6895154914adf32fc4d805cffdf0bec084ae711.diff
LOG: [ELF] OVERLAY: support quoted output section names
Added:
Modified:
lld/ELF/ScriptParser.cpp
lld/test/ELF/linkerscript/overlay.test
Removed:
################################################################################
diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp
index b97efc44bae5a..1fd1084e237fc 100644
--- a/lld/ELF/ScriptParser.cpp
+++ b/lld/ELF/ScriptParser.cpp
@@ -954,7 +954,8 @@ static Expr checkAlignment(Expr e, std::string &loc) {
}
OutputDesc *ScriptParser::readOverlaySectionDescription() {
- OutputDesc *osd = script->createOutputSection(next(), getCurrentLocation());
+ OutputDesc *osd =
+ script->createOutputSection(readName(), getCurrentLocation());
osd->osec.inOverlay = true;
expect("{");
while (auto tok = till("}")) {
diff --git a/lld/test/ELF/linkerscript/overlay.test b/lld/test/ELF/linkerscript/overlay.test
index 731caea6a5d14..7c64303b45659 100644
--- a/lld/test/ELF/linkerscript/overlay.test
+++ b/lld/test/ELF/linkerscript/overlay.test
@@ -59,13 +59,13 @@ _start:
SECTIONS {
## LMA defaults to VMA
OVERLAY 0x1000 : {
- .big1 { *(.big1) }
+ ".big1" { *(".big1") }
.small1 { *(.small1) }
}
## .big2 starts at ADDR(.small2)
OVERLAY : AT (0x2008) {
.small2 { *(.small2) }
- .big2 { *(.big2) }
+ ".big2" { *(.big2) }
}
## .empty3 is not discarded. .small3 and .big3 share its address.
OVERLAY . : AT (0x2014) {
More information about the llvm-commits
mailing list