summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2018-04-02 23:20:30 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2018-04-02 23:20:30 +0000
commit8c58750cc41e105ad26dd225b23049907341ad85 (patch)
tree66087f02480a7765ff603a1b222a64fdd1fc6522 /llvm/lib/CodeGen/AsmPrinter
parent84e2cd6c021a1564e77c2f099f9d3a3c21906e90 (diff)
downloadbcm5719-llvm-8c58750cc41e105ad26dd225b23049907341ad85.tar.gz
bcm5719-llvm-8c58750cc41e105ad26dd225b23049907341ad85.zip
Align stubs for external and common global variables to pointer size.
This patch fixes PR36885: clang++ generates unaligned stub symbol holding a pointer. Patch by Rahul Chaudhry! llvm-svn: 329030
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index da4244b8b6c..2926ea64b85 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1336,6 +1336,7 @@ bool AsmPrinter::doFinalization(Module &M) {
OutStreamer->SwitchSection(TLOF.getDataSection());
const DataLayout &DL = M.getDataLayout();
+ EmitAlignment(Log2_32(DL.getPointerSize()));
for (const auto &Stub : Stubs) {
OutStreamer->EmitLabel(Stub.first);
OutStreamer->EmitSymbolValue(Stub.second.getPointer(),
OpenPOWER on IntegriCloud