From 1d08493df33c295a8647a712884d7c634f8e8057 Mon Sep 17 00:00:00 2001 From: Dmitry Mikulin Date: Tue, 15 Oct 2019 18:31:10 +0000 Subject: Added support for "#pragma clang section relro=" Differential Revision: https://reviews.llvm.org/D68806 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374934 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/CodeGen/CodeGenModule.cpp') diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index eab48ccb9b..c97e7b2217 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -1717,6 +1717,8 @@ void CodeGenModule::setNonAliasAttributes(GlobalDecl GD, GV->addAttribute("data-section", SA->getName()); if (auto *SA = D->getAttr()) GV->addAttribute("rodata-section", SA->getName()); + if (auto *SA = D->getAttr()) + GV->addAttribute("relro-section", SA->getName()); } if (auto *F = dyn_cast(GO)) { @@ -4118,6 +4120,7 @@ static bool isVarDeclStrongDefinition(const ASTContext &Context, // If no specialized section name is applicable, it will resort to default. if (D->hasAttr() || D->hasAttr() || + D->hasAttr() || D->hasAttr()) return true; -- cgit v1.2.1