diff options
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index a7cdcee8cd6..c50c6476ec5 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -1693,8 +1693,14 @@ MCSection *TargetLoweringObjectFileWasm::getExplicitSectionGlobal( Group = C->getName(); } - return getContext().getWasmSection(Name, Kind, Group, - MCContext::GenericSectionID); + MCSectionWasm* Section = + getContext().getWasmSection(Name, Kind, Group, + MCContext::GenericSectionID); + + if (TM.Options.ThreadModel != ThreadModel::Single) + Section->setPassive(); + + return Section; } static MCSectionWasm *selectWasmSectionForGlobal( @@ -1723,7 +1729,12 @@ static MCSectionWasm *selectWasmSectionForGlobal( UniqueID = *NextUniqueID; (*NextUniqueID)++; } - return Ctx.getWasmSection(Name, Kind, Group, UniqueID); + + MCSectionWasm* Section = Ctx.getWasmSection(Name, Kind, Group, UniqueID); + if (Section->isWasmData() && TM.Options.ThreadModel != ThreadModel::Single) + Section->setPassive(); + + return Section; } MCSection *TargetLoweringObjectFileWasm::SelectSectionForGlobal( |