aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorJoseph Huber <jhuber6@vols.utk.edu>2022-02-21 12:40:16 -0500
committerJoseph Huber <jhuber6@vols.utk.edu>2022-02-21 21:35:17 -0500
commit456ffd7a225f908ca61d747be21439f6182ea40c (patch)
tree069e71baa42e68ff5aa912a7f3bad9538c48cc7a /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parent294072e10b9949323bf20695085723158f7c873c (diff)
downloadllvm-456ffd7a225f908ca61d747be21439f6182ea40c.zip
llvm-456ffd7a225f908ca61d747be21439f6182ea40c.tar.gz
llvm-456ffd7a225f908ca61d747be21439f6182ea40c.tar.bz2
[OpenMP] Ensure offloading sections do not have SHF_ALLOC flag
We use offloading sections in the new Clang driver scheme to embed device code into the host. We later use these sections to link the device image, after which point they are completely unused and should not be loaded into memory if they are still in the executable. Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D120275
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 0892c74..348470b 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -446,7 +446,8 @@ static SectionKind getELFKindForNamedSection(StringRef Name, SectionKind K) {
/*AddSegmentInfo=*/false) ||
Name == getInstrProfSectionName(IPSK_covfun, Triple::ELF,
/*AddSegmentInfo=*/false) ||
- Name == ".llvmbc" || Name == ".llvmcmd")
+ Name == ".llvmbc" || Name == ".llvmcmd" ||
+ Name.startswith(".llvm.offloading."))
return SectionKind::getMetadata();
if (Name.empty() || Name[0] != '.') return K;