summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDmitry Mikulin <dmitry.mikulin@sony.com>2019-10-15 18:31:10 +0000
committerDmitry Mikulin <dmitry.mikulin@sony.com>2019-10-15 18:31:10 +0000
commitf14642f2f185f9af290f9fcace4851adbbe16432 (patch)
tree023054e847f2845c009d66e9e3e88ad11872fe41 /clang/lib/CodeGen/CodeGenModule.cpp
parent2cb27072cefb11d5018735a3b70a903dc1d319ac (diff)
downloadbcm5719-llvm-f14642f2f185f9af290f9fcace4851adbbe16432.tar.gz
bcm5719-llvm-f14642f2f185f9af290f9fcace4851adbbe16432.zip
Added support for "#pragma clang section relro=<name>"
Differential Revision: https://reviews.llvm.org/D68806 llvm-svn: 374934
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index eab48ccb9b7..c97e7b22170 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -1717,6 +1717,8 @@ void CodeGenModule::setNonAliasAttributes(GlobalDecl GD,
GV->addAttribute("data-section", SA->getName());
if (auto *SA = D->getAttr<PragmaClangRodataSectionAttr>())
GV->addAttribute("rodata-section", SA->getName());
+ if (auto *SA = D->getAttr<PragmaClangRelroSectionAttr>())
+ GV->addAttribute("relro-section", SA->getName());
}
if (auto *F = dyn_cast<llvm::Function>(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<PragmaClangBSSSectionAttr>() ||
D->hasAttr<PragmaClangDataSectionAttr>() ||
+ D->hasAttr<PragmaClangRelroSectionAttr>() ||
D->hasAttr<PragmaClangRodataSectionAttr>())
return true;
OpenPOWER on IntegriCloud