Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp =================================================================== --- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp +++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp @@ -1547,9 +1547,10 @@ 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( getObjFileLowering().getSectionForFunctionDescriptor(CurrentFnDescSym)); + FnDescSec->setAlignment(Align(Subtarget->isPPC64() ? 8 : 4)); cast(CurrentFnDescSym)->setContainingCsect(FnDescSec); return AsmPrinter::SetupMachineFunction(MF); Index: llvm/test/CodeGen/PowerPC/aix-func-dsc-gen.ll =================================================================== --- llvm/test/CodeGen/PowerPC/aix-func-dsc-gen.ll +++ llvm/test/CodeGen/PowerPC/aix-func-dsc-gen.ll @@ -63,7 +63,7 @@ ; 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 Index: llvm/test/CodeGen/PowerPC/aix-xcoff-reloc.ll =================================================================== --- llvm/test/CodeGen/PowerPC/aix-xcoff-reloc.ll +++ llvm/test/CodeGen/PowerPC/aix-xcoff-reloc.ll @@ -318,7 +318,7 @@ ; 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