1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00

[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.

llvm-svn: 280049
This commit is contained in:
Hal Finkel 2016-08-30 01:43:38 +00:00
parent cd267c08fb
commit 914a9afcd7
2 changed files with 5 additions and 2 deletions

View File

@ -1146,10 +1146,12 @@ bool PPCLinuxAsmPrinter::doFinalization(Module &M) {
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);
}
}
}

View File

@ -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