Skip to content

Commit 51c2b99

Browse files
committed
[lld][WebAssembly] Fix name of data section in PIC mode
This should always have been ".data". Without this we treat the section as a user-defined section in other places (such as the generation of __start/__stop symbols). Differential Revision: https://reviews.llvm.org/D64439 llvm-svn: 365547
1 parent 9e77d0c commit 51c2b99

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lld/wasm/Writer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,9 @@ void Writer::addSection(OutputSection *Sec) {
304304
// gold provide the feature, and used by many programs.
305305
static void addStartStopSymbols(const OutputSegment *Seg) {
306306
StringRef Name = Seg->Name;
307-
LLVM_DEBUG(dbgs() << "addStartStopSymbols: " << Name << "\n");
308307
if (!isValidCIdentifier(Name))
309308
return;
309+
LLVM_DEBUG(dbgs() << "addStartStopSymbols: " << Name << "\n");
310310
uint32_t Start = Seg->StartVA;
311311
uint32_t Stop = Start + Seg->Size;
312312
Symtab->addOptionalDataSymbol(Saver.save("__start_" + Name), Start);
@@ -601,7 +601,7 @@ static StringRef getOutputDataSegmentName(StringRef Name) {
601601
// With PIC code we currently only support a single data segment since
602602
// we only have a single __memory_base to use as our base address.
603603
if (Config->Pic)
604-
return "data";
604+
return ".data";
605605
if (!Config->MergeDataSegments)
606606
return Name;
607607
if (Name.startswith(".text."))

0 commit comments

Comments
 (0)