File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -900,7 +900,8 @@ OutputDesc *ScriptParser::readOverlaySectionDescription() {
900
900
}
901
901
902
902
OutputDesc *ScriptParser::readOutputSectionDescription (StringRef outSec) {
903
- OutputDesc *cmd = script->createOutputSection (outSec, getCurrentLocation ());
903
+ OutputDesc *cmd =
904
+ script->createOutputSection (unquote (outSec), getCurrentLocation ());
904
905
OutputSection *osec = &cmd->osec ;
905
906
// Maybe relro. Will reset to false if DATA_SEGMENT_RELRO_END is absent.
906
907
osec->relro = seenDataAlign && !seenRelroEnd;
Original file line number Diff line number Diff line change 1
1
# REQUIRES: x86
2
2
3
3
## Handling of quotes is tricky sometimes. Check we do that right and include
4
- ## "foo bar" section into .data as expected.
4
+ ## "foo bar" section into " .data foo" as expected.
5
5
6
- # RUN: echo '.section "foo bar", "aw"; nop' | llvm-mc -filetype=obj -triple=x86_64-pc-linux - -o %t
7
- # RUN: ld.lld %t --script %s -o %t2 --print-map | FileCheck %s
8
- # CHECK: .data
6
+ # RUN: echo '.section "foo bar", "aw"; nop' | llvm-mc -filetype=obj -triple=x86_64 - -o %t.o
7
+ # RUN: ld.lld %t.o --script %s -o %t --print-map | FileCheck %s
8
+ # RUN: llvm-readelf -S %t | FileCheck %s --check-prefix=SEC
9
+ # CHECK: .data foo
9
10
# CHECK-NEXT: {{.*}}(foo bar)
10
11
12
+ # SEC: ]{{ }}.data foo
13
+ # SEC: ]{{ }}.data bar
14
+
11
15
SECTIONS {
12
- .data : { *("foo bar") }
16
+ " .data foo" : { *("foo bar") }
17
+ }
18
+
19
+ OVERWRITE_SECTIONS {
20
+ " .data bar" : { bar = .; }
13
21
}
You can’t perform that action at this time.
0 commit comments