From 456ffd7a225f908ca61d747be21439f6182ea40c Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 21 Feb 2022 12:40:16 -0500 Subject: [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 --- llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp') 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; -- cgit v1.1