llvm-project/lld/wasm
Sam Clegg 8544b40b6e [lld][WebAssembly] Fix for PIC output + TLS + non-shared-memory
Prior to this change build with `-shared/-pie` and using TLS (but
without -shared-memory) would hit this assert:

  "Currenly only a single data segment is supported in PIC mode"

This is because we were not including TLS data when merging data
segments.  However, when we build without shared-memory (i.e.  without
threads) we effectively lower away TLS into a normal active data
segment.. so we were ending up with two active data segments: the merged
data, and the lowered TLS data.

To fix this problem we can instead avoid combining data segments at
all when running in shared memory mode (because in this case all
segment initialization is passive).  And then in non-shared memory
mode we know that TLS has been lowered and therefore we can can
and should combine all segments.

So with this new behavior we have two different modes:

1. With shared memory / mutli-threaded: Never combine data segments
   since it is not necessary.  (All data segments as passive already).

2. Wihout shared memory / single-threaded: Combine *all* data segments
   since we treat TLS as normal data.  (We end up with a single
   active data segment).

Differential Revision: https://reviews.llvm.org/D102937
2021-05-21 15:16:47 -07:00
..
CMakeLists.txt Reland: "[lld][WebAssembly] Initial support merging string data" 2021-05-10 16:03:38 -07:00
Config.h [lld][WebAssembly] Add `--export-if-defined` 2021-04-29 10:58:45 -07:00
Driver.cpp [WebAssembly] Fix PIC/GOT codegen for wasm64 2021-05-20 09:59:31 -07:00
InputChunks.cpp [WebAssembly] Fix PIC/GOT codegen for wasm64 2021-05-20 09:59:31 -07:00
InputChunks.h [lld][WebAssembly] Enable string tail merging in debug sections 2021-05-18 12:25:39 -07:00
InputElement.h [WebAssembly] Fix PIC/GOT codegen for wasm64 2021-05-20 09:59:31 -07:00
InputFiles.cpp [WebAssembly] Fix PIC/GOT codegen for wasm64 2021-05-20 09:59:31 -07:00
InputFiles.h [lld][WebAssembly] Enable string tail merging in debug sections 2021-05-18 12:25:39 -07:00
LTO.cpp [LTO][wasm][NewPM] Allow using new pass manager for wasm LTO 2020-12-01 12:22:40 -08:00
LTO.h [Coding style change][lld] Rename variables for non-ELF ports 2019-07-11 05:40:30 +00:00
MapFile.cpp [lld][WebAssembly] Rename methods/members to match ELF backend. NFC. 2021-02-26 17:05:59 -08:00
MapFile.h [lld][WebAssembly] Add initial support for -Map/--print-map 2020-09-12 16:10:51 -07:00
MarkLive.cpp [lld][WebAssembly] Common superclass for input globals/events/tables 2021-02-11 14:54:45 +01:00
MarkLive.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Options.td [lld][WebAssembly] Add `--export-if-defined` 2021-04-29 10:58:45 -07:00
OutputSections.cpp [lld][WebAssembly] Fix for PIC output + TLS + non-shared-memory 2021-05-21 15:16:47 -07:00
OutputSections.h [lld][WebAssembly] Enable string tail merging in debug sections 2021-05-18 12:25:39 -07:00
OutputSegment.cpp [lld][WebAssembly] Enable string tail merging in debug sections 2021-05-18 12:25:39 -07:00
OutputSegment.h [lld][WebAssembly] Refactor input chunk class hierarchy. NFC 2021-05-17 21:01:17 -07:00
Relocations.cpp [lld][WebAssembly] Fix for PIC output + TLS + non-shared-memory 2021-05-21 15:16:47 -07:00
Relocations.h [Coding style change][lld] Rename variables for non-ELF ports 2019-07-11 05:40:30 +00:00
SymbolTable.cpp [lld][WebAssembly] Refactor input chunk class hierarchy. NFC 2021-05-17 21:01:17 -07:00
SymbolTable.h [lld][WebAssembly] Refactor input chunk class hierarchy. NFC 2021-05-17 21:01:17 -07:00
Symbols.cpp [WebAssembly] Fix PIC/GOT codegen for wasm64 2021-05-20 09:59:31 -07:00
Symbols.h [WebAssembly] Fix PIC/GOT codegen for wasm64 2021-05-20 09:59:31 -07:00
SyntheticSections.cpp [WebAssembly] Fix PIC/GOT codegen for wasm64 2021-05-20 09:59:31 -07:00
SyntheticSections.h [WebAssembly][lld] Preassign table number 0 to indirect function table for MVP inputs 2021-02-12 20:20:19 +01:00
Writer.cpp [lld][WebAssembly] Fix for PIC output + TLS + non-shared-memory 2021-05-21 15:16:47 -07:00
Writer.h [WebAssembly] Refactor synthetic sections and relocation processing. NFC. 2019-05-21 09:13:09 +00:00
WriterUtils.cpp [WebAssembly] Rename WasmLimits::Initial to ::Minimum. NFC. 2021-03-24 09:10:11 +01:00
WriterUtils.h [lld][WebAssembly] Common superclass for input globals/events/tables 2021-02-11 14:54:45 +01:00