summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>2015-02-27 22:14:10 +0000
committerBill Schmidt <wschmidt@linux.vnet.ibm.com>2015-02-27 22:14:10 +0000
commite3959eb54ebf5a2a8997fa79c5d1dd2a1e4eab75 (patch)
tree8bfaafc367418f5eb8f9999940338dff0c7d7194 /llvm/lib
parent6982fa4bb0dfb286414e24f54a20a3b08eae5c59 (diff)
downloadbcm5719-llvm-e3959eb54ebf5a2a8997fa79c5d1dd2a1e4eab75.tar.gz
bcm5719-llvm-e3959eb54ebf5a2a8997fa79c5d1dd2a1e4eab75.zip
[PowerPC] Fix PR22711 - Misaligned .toc section
Straightforward patch to emit an alignment directive when emitting a TOC entry. The test case was generated from the test in PR22711 that demonstrated a misaligned .toc section. The object code is run through llvm-readobj to verify that the correct alignment has been applied to the .toc section. Thanks to Ulrich Weigand for running down where the fix was needed. llvm-svn: 230801
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
index f2da3896168..eff5e14305c 100644
--- a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
+++ b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
@@ -145,6 +145,7 @@ public:
}
void emitTCEntry(const MCSymbol &S) override {
// Creates a R_PPC64_TOC relocation
+ Streamer.EmitValueToAlignment(8);
Streamer.EmitSymbolValue(&S, 8);
}
void emitMachine(StringRef CPU) override {
OpenPOWER on IntegriCloud