diff options
| author | Sam Clegg <sbc@chromium.org> | 2019-07-09 19:47:32 +0000 |
|---|---|---|
| committer | Sam Clegg <sbc@chromium.org> | 2019-07-09 19:47:32 +0000 |
| commit | 51c2b99eff172595973e98f01d18c762141d2196 (patch) | |
| tree | a709cae8530bf3a8c7a89f10445a76e6321d694c /lld/wasm/Writer.cpp | |
| parent | 9e77d0c6df1dad1bb6463f9ad6269d979feb8697 (diff) | |
| download | bcm5719-llvm-51c2b99eff172595973e98f01d18c762141d2196.tar.gz bcm5719-llvm-51c2b99eff172595973e98f01d18c762141d2196.zip | |
[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
Diffstat (limited to 'lld/wasm/Writer.cpp')
| -rw-r--r-- | lld/wasm/Writer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp index cbf173e6c65..e79d30131e5 100644 --- a/lld/wasm/Writer.cpp +++ b/lld/wasm/Writer.cpp @@ -304,9 +304,9 @@ void Writer::addSection(OutputSection *Sec) { // gold provide the feature, and used by many programs. static void addStartStopSymbols(const OutputSegment *Seg) { StringRef Name = Seg->Name; - LLVM_DEBUG(dbgs() << "addStartStopSymbols: " << Name << "\n"); if (!isValidCIdentifier(Name)) return; + LLVM_DEBUG(dbgs() << "addStartStopSymbols: " << Name << "\n"); uint32_t Start = Seg->StartVA; uint32_t Stop = Start + Seg->Size; Symtab->addOptionalDataSymbol(Saver.save("__start_" + Name), Start); @@ -601,7 +601,7 @@ static StringRef getOutputDataSegmentName(StringRef Name) { // With PIC code we currently only support a single data segment since // we only have a single __memory_base to use as our base address. if (Config->Pic) - return "data"; + return ".data"; if (!Config->MergeDataSegments) return Name; if (Name.startswith(".text.")) |

