[PATCH] D74974: [XCOFF][AIX] Fix incorrect alignment for function descriptor csect
Jason Liu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 21 10:23:50 PST 2020
jasonliu created this revision.
jasonliu added reviewers: daltenty, DiggerLin, hubert.reinterpretcast.
Herald added subscribers: llvm-commits, jsji, kbarton, hiraditya, nemanjai.
Herald added a project: LLVM.
jasonliu added a reviewer: Xiangling_L.
Herald added a subscriber: wuzish.
Function descriptor csect on AIX should be 4 byte align instead of 1 byte align.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D74974
Files:
llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
llvm/test/CodeGen/PowerPC/aix-func-dsc-gen.ll
llvm/test/CodeGen/PowerPC/aix-xcoff-reloc.ll
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
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/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<MCSectionXCOFF>(
getObjFileLowering().getSectionForFunctionDescriptor(CurrentFnDescSym));
+ FnDescSec->setAlignment(Align(Subtarget->isPPC64() ? 8 : 4));
cast<MCSymbolXCOFF>(CurrentFnDescSym)->setContainingCsect(FnDescSec);
return AsmPrinter::SetupMachineFunction(MF);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74974.245911.patch
Type: text/x-patch
Size: 1960 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200221/94d7845b/attachment.bin>
More information about the llvm-commits
mailing list