[llvm] r280049 - [PowerPC] Force entry alignment in .got2
Hal Finkel via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 29 18:43:39 PDT 2016
Author: hfinkel
Date: Mon Aug 29 20:43:38 2016
New Revision: 280049
URL: http://llvm.org/viewvc/llvm-project?rev=280049&view=rev
Log:
[PowerPC] Force entry alignment in .got2
Implement Bill's suggested fix for 32-bit targets for PR22711 (for the
alignment of each entry). As pointed out in the bug report, we could just force
the section alignment, since we only add pointer-sized things currently, but
this fix is somewhat more future-proof.
Modified:
llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
llvm/trunk/test/CodeGen/PowerPC/ppc32-pic-large.ll
Modified: llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp?rev=280049&r1=280048&r2=280049&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp Mon Aug 29 20:43:38 2016
@@ -1146,10 +1146,12 @@ bool PPCLinuxAsmPrinter::doFinalization(
E = TOC.end(); I != E; ++I) {
OutStreamer->EmitLabel(I->second);
MCSymbol *S = I->first;
- if (isPPC64)
+ if (isPPC64) {
TS.emitTCEntry(*S);
- else
+ } else {
+ OutStreamer->EmitValueToAlignment(4);
OutStreamer->EmitSymbolValue(S, 4);
+ }
}
}
Modified: llvm/trunk/test/CodeGen/PowerPC/ppc32-pic-large.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/ppc32-pic-large.ll?rev=280049&r1=280048&r2=280049&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/ppc32-pic-large.ll (original)
+++ llvm/trunk/test/CodeGen/PowerPC/ppc32-pic-large.ll Mon Aug 29 20:43:38 2016
@@ -26,4 +26,5 @@ entry:
; LARGE-BSS-DAG: stw {{[0-9]+}}, 8(1)
; LARGE-BSS: lwz 30, -8(1)
; LARGE-BSS: [[VREF]]:
+; LARGE-BSS-NEXT: .p2align 2
; LARGE-BSS-NEXT: .long bar
More information about the llvm-commits
mailing list