1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00

[XCOFF][AIX] Fix incorrect alignment for function descriptor csect

Summary:
Function descriptor csect on AIX should be 4 byte align instead of 1 byte align.

Reviewer: daltenty

Differential Revision: https://reviews.llvm.org/D74974
This commit is contained in:
jasonliu 2020-02-24 15:46:11 +00:00
parent ae6946dfc3
commit f20e89acb5
3 changed files with 4 additions and 3 deletions

View File

@ -1547,9 +1547,10 @@ void PPCLinuxAsmPrinter::emitFunctionBodyEnd() {
void PPCAIXAsmPrinter::SetupMachineFunction(MachineFunction &MF) {
// Get the function descriptor symbol.
CurrentFnDescSym = getSymbol(&MF.getFunction());
// Set the containing csect.
// Set the alignment and the containing csect.
MCSectionXCOFF *FnDescSec = cast<MCSectionXCOFF>(
getObjFileLowering().getSectionForFunctionDescriptor(CurrentFnDescSym));
FnDescSec->setAlignment(Align(Subtarget->isPPC64() ? 8 : 4));
cast<MCSymbolXCOFF>(CurrentFnDescSym)->setContainingCsect(FnDescSec);
return AsmPrinter::SetupMachineFunction(MF);

View File

@ -63,7 +63,7 @@ entry:
; CHECK-NEXT: SectionLen: 12
; CHECK-NEXT: ParameterHashIndex: 0x0
; CHECK-NEXT: TypeChkSectNum: 0x0
; CHECK-NEXT: SymbolAlignmentLog2: 0
; CHECK-NEXT: SymbolAlignmentLog2: 2
; CHECK-NEXT: SymbolType: XTY_SD (0x1)
; CHECK-NEXT: StorageMappingClass: XMC_DS (0xA)
; CHECK-NEXT: StabInfoIndex: 0x0

View File

@ -318,7 +318,7 @@ declare i32 @bar(i32)
; SYM-NEXT: SectionLen: 12
; SYM-NEXT: ParameterHashIndex: 0x0
; SYM-NEXT: TypeChkSectNum: 0x0
; SYM-NEXT: SymbolAlignmentLog2: 0
; SYM-NEXT: SymbolAlignmentLog2: 2
; SYM-NEXT: SymbolType: XTY_SD (0x1)
; SYM-NEXT: StorageMappingClass: XMC_DS (0xA)
; SYM-NEXT: StabInfoIndex: 0x0