diff --git a/llvm/include/llvm/MC/MCSectionXCOFF.h b/llvm/include/llvm/MC/MCSectionXCOFF.h --- a/llvm/include/llvm/MC/MCSectionXCOFF.h +++ b/llvm/include/llvm/MC/MCSectionXCOFF.h @@ -38,6 +38,7 @@ Optional DwarfSubtypeFlags; bool MultiSymbolsAllowed; static constexpr unsigned DefaultAlignVal = 4; + static constexpr unsigned DefaultTextAlignVal = 32; MCSectionXCOFF(StringRef Name, XCOFF::StorageMappingClass SMC, XCOFF::SymbolType ST, SectionKind K, MCSymbolXCOFF *QualName, @@ -57,9 +58,14 @@ QualName->setRepresentedCsect(this); QualName->setStorageClass(XCOFF::C_HIDEXT); - // A csect is 4 byte aligned by default, except for undefined symbol csects. - if (ST != XCOFF::XTY_ER) - setAlignment(Align(DefaultAlignVal)); + if (ST != XCOFF::XTY_ER) { + // A csect for program code, set the align to 32 by default. For other + // csect, set the align to 4 by default. + if (SMC == XCOFF::XMC_PR) + setAlignment(Align(DefaultTextAlignVal)); + else + setAlignment(Align(DefaultAlignVal)); + } } MCSectionXCOFF(StringRef Name, SectionKind K, MCSymbolXCOFF *QualName, @@ -74,9 +80,8 @@ // FIXME: use a more meaningful name for non csect sections. QualName->setRepresentedCsect(this); - // Set default alignment 4 for all non csect sections for now. - // FIXME: set different alignments according to section types. - setAlignment(Align(DefaultAlignVal)); + // Use default text alignment as the alignment for DWARF sections. + setAlignment(Align(DefaultTextAlignVal)); } void printCsectDirective(raw_ostream &OS) const; diff --git a/llvm/lib/MC/XCOFFObjectWriter.cpp b/llvm/lib/MC/XCOFFObjectWriter.cpp --- a/llvm/lib/MC/XCOFFObjectWriter.cpp +++ b/llvm/lib/MC/XCOFFObjectWriter.cpp @@ -172,9 +172,14 @@ // For DWARF section entry. std::unique_ptr DwarfSect; + // For DWARF section, we must use real size in the section header. MemorySize + // is for the size the DWARF section occupies including paddings. + uint32_t MemorySize; + DwarfSectionEntry(StringRef N, int32_t Flags, std::unique_ptr Sect) - : SectionEntry(N, Flags | XCOFF::STYP_DWARF), DwarfSect(std::move(Sect)) { + : SectionEntry(N, Flags | XCOFF::STYP_DWARF), DwarfSect(std::move(Sect)), + MemorySize(0) { assert(DwarfSect->MCSec->isDwarfSect() && "This should be a DWARF section!"); assert(N.size() <= XCOFF::NameSize && "section name too long"); @@ -980,6 +985,7 @@ // Section indices are 1-based in XCOFF. int32_t SectionIndex = 1; bool HasTDataSection = false; + uint32_t PaddingsBeforeDwarf = 0; for (auto *Section : Sections) { const bool IsEmpty = @@ -1039,6 +1045,17 @@ Section->Size = Address - Section->Address; } + // Start to generate DWARF sections. Csect sections use DefaultSectionAlign + // as the default alignment, while DWARF sections have their own alignments, + // if these two alignments are not the same, we need some paddings here. + if (!DwarfSections.empty()) + PaddingsBeforeDwarf = + alignTo(Address, + (*DwarfSections.begin()).DwarfSect->MCSec->getAlignment()) - + Address; + + DwarfSectionEntry *LastDwarfSection = nullptr; + for (auto &DwarfSection : DwarfSections) { assert((SectionIndex <= MaxSectionIndex) && "Section index overflow!"); @@ -1065,9 +1082,22 @@ // Section size. // For DWARF section, we must use the real size which may be not aligned. DwarfSection.Size = DwarfSect.Size = Layout.getSectionAddressSize(MCSec); - - // Make the Address align to default alignment for follow section. - Address = alignTo(DwarfSect.Address + DwarfSect.Size, DefaultSectionAlign); + Address = DwarfSection.Address + DwarfSection.Size; + + if (!LastDwarfSection) + LastDwarfSection = &DwarfSection; + else { + LastDwarfSection->MemorySize = + DwarfSection.Address - LastDwarfSection->Address; + LastDwarfSection = &DwarfSection; + } + } + if (LastDwarfSection) { + // Make the final DWARF section Address align to default section alignment + // for follow sections. + Address = alignTo(LastDwarfSection->Address + LastDwarfSection->Size, + DefaultSectionAlign); + LastDwarfSection->MemorySize = Address - LastDwarfSection->Address; } SymbolTableEntryCount = SymbolTableIndex; @@ -1085,19 +1115,15 @@ report_fatal_error("Section raw data overflowed this object file."); } - for (auto &DwarfSection : DwarfSections) { - // Address of csect sections are always aligned to DefaultSectionAlign, but - // address of DWARF section are aligned to Section alignment which may be - // bigger than DefaultSectionAlign, need to execlude the padding bits. - RawPointer = - alignTo(RawPointer, DwarfSection.DwarfSect->MCSec->getAlignment()); + // Increase the raw pointer for the padding bytes between csect sections and + // DWARF sections. + if (!DwarfSections.empty()) + RawPointer += PaddingsBeforeDwarf; + for (auto &DwarfSection : DwarfSections) { DwarfSection.FileOffsetToData = RawPointer; - // Some section entries, like DWARF section size is not aligned, so - // RawPointer may be not aligned. - RawPointer += DwarfSection.Size; - // Make sure RawPointer is aligned. - RawPointer = alignTo(RawPointer, DefaultSectionAlign); + + RawPointer += DwarfSection.MemorySize; assert(RawPointer <= UINT32_MAX && "Section raw data overflowed this object file."); diff --git a/llvm/test/CodeGen/PowerPC/aix-alias.ll b/llvm/test/CodeGen/PowerPC/aix-alias.ll --- a/llvm/test/CodeGen/PowerPC/aix-alias.ll +++ b/llvm/test/CodeGen/PowerPC/aix-alias.ll @@ -56,7 +56,7 @@ ; ASM-NEXT: .csect fun[DS] ; ASM-NEXT: fun_weak: # @fun ; ASM-NEXT: fun_hidden: -; ASM: .csect .text[PR],2 +; ASM: .csect .text[PR],5 ; ASM-NEXT: .fun: ; ASM-NEXT: .fun_weak: ; ASM-NEXT: .fun_hidden: @@ -64,7 +64,7 @@ ; ASM-NEXT: li 3, 0 ; ASM-NEXT: blr ; ASM-NEXT: # -- End function -; ASM: .csect .text[PR],2 +; ASM: .csect .text[PR],5 ; ASM-NEXT: .test: ; ASM-NEXT: # %bb.0: # %entry ; ASM: bl .fun diff --git a/llvm/test/CodeGen/PowerPC/aix-dwarf.ll b/llvm/test/CodeGen/PowerPC/aix-dwarf.ll --- a/llvm/test/CodeGen/PowerPC/aix-dwarf.ll +++ b/llvm/test/CodeGen/PowerPC/aix-dwarf.ll @@ -59,7 +59,7 @@ ; SEC-NEXT: VirtualAddress: 0x28 ; SEC-NEXT: Size: 0xC ; SEC-NEXT: RawDataOffset: 0x104 -; SEC-NEXT: RelocationPointer: 0x1D8 +; SEC-NEXT: RelocationPointer: 0x1F4 ; SEC-NEXT: LineNumberPointer: 0x0 ; SEC-NEXT: NumberOfRelocations: 2 ; SEC-NEXT: NumberOfLineNumbers: 0 @@ -71,7 +71,7 @@ ; SEC-NEXT: PhysicalAddress: 0x0 ; SEC-NEXT: VirtualAddress: 0x0 ; SEC-NEXT: Size: 0x36 -; SEC-NEXT: RawDataOffset: 0x110 +; SEC-NEXT: RawDataOffset: 0x11C ; SEC-NEXT: RelocationPointer: 0x0 ; SEC-NEXT: LineNumberPointer: 0x0 ; SEC-NEXT: NumberOfRelocations: 0 @@ -84,8 +84,8 @@ ; SEC-NEXT: PhysicalAddress: 0x0 ; SEC-NEXT: VirtualAddress: 0x0 ; SEC-NEXT: Size: 0x57 -; SEC-NEXT: RawDataOffset: 0x148 -; SEC-NEXT: RelocationPointer: 0x1EC +; SEC-NEXT: RawDataOffset: 0x15C +; SEC-NEXT: RelocationPointer: 0x208 ; SEC-NEXT: LineNumberPointer: 0x0 ; SEC-NEXT: NumberOfRelocations: 4 ; SEC-NEXT: NumberOfLineNumbers: 0 @@ -97,8 +97,8 @@ ; SEC-NEXT: PhysicalAddress: 0x0 ; SEC-NEXT: VirtualAddress: 0x0 ; SEC-NEXT: Size: 0x36 -; SEC-NEXT: RawDataOffset: 0x1A0 -; SEC-NEXT: RelocationPointer: 0x214 +; SEC-NEXT: RawDataOffset: 0x1BC +; SEC-NEXT: RelocationPointer: 0x230 ; SEC-NEXT: LineNumberPointer: 0x0 ; SEC-NEXT: NumberOfRelocations: 1 ; SEC-NEXT: NumberOfLineNumbers: 0 diff --git a/llvm/test/CodeGen/PowerPC/aix-emit-tracebacktable-clobber-register.ll b/llvm/test/CodeGen/PowerPC/aix-emit-tracebacktable-clobber-register.ll --- a/llvm/test/CodeGen/PowerPC/aix-emit-tracebacktable-clobber-register.ll +++ b/llvm/test/CodeGen/PowerPC/aix-emit-tracebacktable-clobber-register.ll @@ -89,8 +89,8 @@ ; COMMON-NEXT: .align 2 ; COMMON-NEXT: .vbyte 4, 0 ; COMMON-NEXT: .vbyte 4, 0 -; CHECK-ASM-NEXT: .csect .text[PR],2 -; CHECK-FUNC-NEXT: .csect .foov[PR],2 +; CHECK-ASM-NEXT: .csect .text[PR],5 +; CHECK-FUNC-NEXT: .csect .foov[PR],5 ; COMMON-NEXT: # -- End function ; COMMON: .toc ; COMMON: L..C2: diff --git a/llvm/test/CodeGen/PowerPC/aix-emit-tracebacktable.ll b/llvm/test/CodeGen/PowerPC/aix-emit-tracebacktable.ll --- a/llvm/test/CodeGen/PowerPC/aix-emit-tracebacktable.ll +++ b/llvm/test/CodeGen/PowerPC/aix-emit-tracebacktable.ll @@ -141,7 +141,7 @@ } ; CHECK-ASM-LABEL: ._Z10add_structifd1SP2SD1Di:{{[[:space:]] *}}# %bb.0: -; CHECK-FUNC-LABEL: csect ._Z10add_structifd1SP2SD1Di[PR],2{{[[:space:]] *}}# %bb.0: +; CHECK-FUNC-LABEL: csect ._Z10add_structifd1SP2SD1Di[PR],5{{[[:space:]] *}}# %bb.0: ; COMMON-NEXT: lwz 4, L..C0(2) ; COMMON-NEXT: stfs 1, -24(1) ; COMMON-NEXT: lfs 0, 0(4) @@ -174,7 +174,7 @@ ; CHECK-ASM-LABEL: .main:{{[[:space:]] *}}# %bb.0: -; CHECK-FUNC-LABEL: .csect .main[PR],2{{[[:space:]] *}}# %bb.0 +; CHECK-FUNC-LABEL: .csect .main[PR],5{{[[:space:]] *}}# %bb.0 ; COMMON-NEXT: mflr 0 ; COMMON-NEXT: stw 0, 8(1) ; COMMON: mtlr 0 @@ -202,7 +202,7 @@ ; CHECK-ASM-LABEL: ._Z7add_bari1SfdP2SD1Di:{{[[:space:]] *}}# %bb.0: -; CHECK-FUNC-LABEL: .csect ._Z7add_bari1SfdP2SD1Di[PR],2{{[[:space:]] *}}# %bb.0: +; CHECK-FUNC-LABEL: .csect ._Z7add_bari1SfdP2SD1Di[PR],5{{[[:space:]] *}}# %bb.0: ; COMMON: .vbyte 4, 0x00000000 # Traceback table begin ; COMMON-NEXT: .byte 0x00 # Version = 0 ; COMMON-NEXT: .byte 0x09 # Language = CPlusPlus @@ -226,7 +226,7 @@ ; CHECK-ASM-LABEL: .foo:{{[[:space:]] *}}# %bb.0: -; CHECK-FUNC-LABEL: .csect .foo[PR],2{{[[:space:]] *}}# %bb.0: +; CHECK-FUNC-LABEL: .csect .foo[PR],5{{[[:space:]] *}}# %bb.0: ; COMMON: stw 3, -4(1) ; COMMON-NEXT: blr ; COMMON-NEXT:L..foo0: diff --git a/llvm/test/CodeGen/PowerPC/aix-extern-weak.ll b/llvm/test/CodeGen/PowerPC/aix-extern-weak.ll --- a/llvm/test/CodeGen/PowerPC/aix-extern-weak.ll +++ b/llvm/test/CodeGen/PowerPC/aix-extern-weak.ll @@ -185,7 +185,7 @@ ; CHECKSYM-NEXT: SectionLen: 80 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0 -; CHECKSYM-NEXT: SymbolAlignmentLog2: 4 +; CHECKSYM-NEXT: SymbolAlignmentLog2: 5 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1) ; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0) ; CHECKSYM-NEXT: StabInfoIndex: 0x0 diff --git a/llvm/test/CodeGen/PowerPC/aix-extern.ll b/llvm/test/CodeGen/PowerPC/aix-extern.ll --- a/llvm/test/CodeGen/PowerPC/aix-extern.ll +++ b/llvm/test/CodeGen/PowerPC/aix-extern.ll @@ -206,7 +206,7 @@ ; CHECKSYM-NEXT: SectionLen: 112 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0 -; CHECKSYM-NEXT: SymbolAlignmentLog2: 4 +; CHECKSYM-NEXT: SymbolAlignmentLog2: 5 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1) ; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0) ; CHECKSYM-NEXT: StabInfoIndex: 0x0 diff --git a/llvm/test/CodeGen/PowerPC/aix-func-dsc-gen.ll b/llvm/test/CodeGen/PowerPC/aix-func-dsc-gen.ll --- a/llvm/test/CodeGen/PowerPC/aix-func-dsc-gen.ll +++ b/llvm/test/CodeGen/PowerPC/aix-func-dsc-gen.ll @@ -34,7 +34,7 @@ ; CHECK-NEXT: SectionLen: 4 ; CHECK-NEXT: ParameterHashIndex: 0x0 ; CHECK-NEXT: TypeChkSectNum: 0x0 -; CHECK-NEXT: SymbolAlignmentLog2: 4 +; CHECK-NEXT: SymbolAlignmentLog2: 5 ; CHECK-NEXT: SymbolType: XTY_SD (0x1) ; CHECK-NEXT: StorageMappingClass: XMC_PR (0x0) ; CHECK-NEXT: StabInfoIndex: 0x0 diff --git a/llvm/test/CodeGen/PowerPC/aix-lower-jump-table.ll b/llvm/test/CodeGen/PowerPC/aix-lower-jump-table.ll --- a/llvm/test/CodeGen/PowerPC/aix-lower-jump-table.ll +++ b/llvm/test/CodeGen/PowerPC/aix-lower-jump-table.ll @@ -190,7 +190,7 @@ ; 64LARGE-ASM: .vbyte 4, L..BB0_4-L..JTI0_0 ; 64LARGE-ASM: .vbyte 4, L..BB0_5-L..JTI0_0 -; FUNC-ASM: .csect .jump_table[PR],2 +; FUNC-ASM: .csect .jump_table[PR],5 ; FUNC-ASM: L..BB0_2: ; FUNC-ASM: L..BB0_3: ; FUNC-ASM: L..BB0_4: diff --git a/llvm/test/CodeGen/PowerPC/aix-personality-alias.ll b/llvm/test/CodeGen/PowerPC/aix-personality-alias.ll --- a/llvm/test/CodeGen/PowerPC/aix-personality-alias.ll +++ b/llvm/test/CodeGen/PowerPC/aix-personality-alias.ll @@ -56,7 +56,7 @@ ; SYM64: .vbyte 8, .__gxx_personality_v0 ; SYM64: .vbyte 8, TOC[TC0] ; SYM64: .vbyte 8, 0 -; SYM: .csect .text[PR],2 +; SYM: .csect .text[PR],5 ; SYM: .__gxx_personality_v0: ; SYM: .__xlcxx_personality_v1: ; SYM: # %bb.0: # %entry diff --git a/llvm/test/CodeGen/PowerPC/aix-tls-xcoff-reloc-large.ll b/llvm/test/CodeGen/PowerPC/aix-tls-xcoff-reloc-large.ll --- a/llvm/test/CodeGen/PowerPC/aix-tls-xcoff-reloc-large.ll +++ b/llvm/test/CodeGen/PowerPC/aix-tls-xcoff-reloc-large.ll @@ -251,7 +251,7 @@ ; SYM-NEXT: SectionLen: 132 ; SYM-NEXT: ParameterHashIndex: 0x0 ; SYM-NEXT: TypeChkSectNum: 0x0 -; SYM-NEXT: SymbolAlignmentLog2: 4 +; SYM-NEXT: SymbolAlignmentLog2: 5 ; SYM-NEXT: SymbolType: XTY_SD (0x1) ; SYM-NEXT: StorageMappingClass: XMC_PR (0x0) ; SYM-NEXT: StabInfoIndex: 0x0 diff --git a/llvm/test/CodeGen/PowerPC/aix-tls-xcoff-reloc.ll b/llvm/test/CodeGen/PowerPC/aix-tls-xcoff-reloc.ll --- a/llvm/test/CodeGen/PowerPC/aix-tls-xcoff-reloc.ll +++ b/llvm/test/CodeGen/PowerPC/aix-tls-xcoff-reloc.ll @@ -212,7 +212,7 @@ ; SYM-NEXT: SectionLen: 104 ; SYM-NEXT: ParameterHashIndex: 0x0 ; SYM-NEXT: TypeChkSectNum: 0x0 -; SYM-NEXT: SymbolAlignmentLog2: 4 +; SYM-NEXT: SymbolAlignmentLog2: 5 ; SYM-NEXT: SymbolType: XTY_SD (0x1) ; SYM-NEXT: StorageMappingClass: XMC_PR (0x0) ; SYM-NEXT: StabInfoIndex: 0x0 diff --git a/llvm/test/CodeGen/PowerPC/aix-tls-xcoff-variables.ll b/llvm/test/CodeGen/PowerPC/aix-tls-xcoff-variables.ll --- a/llvm/test/CodeGen/PowerPC/aix-tls-xcoff-variables.ll +++ b/llvm/test/CodeGen/PowerPC/aix-tls-xcoff-variables.ll @@ -129,7 +129,7 @@ ; SYMS-NEXT: SectionLen: 0 ; SYMS-NEXT: ParameterHashIndex: 0x0 ; SYMS-NEXT: TypeChkSectNum: 0x0 -; SYMS-NEXT: SymbolAlignmentLog2: 2 +; SYMS-NEXT: SymbolAlignmentLog2: 5 ; SYMS-NEXT: SymbolType: XTY_SD (0x1) ; SYMS-NEXT: StorageMappingClass: XMC_PR (0x0) ; SYMS-NEXT: StabInfoIndex: 0x0 diff --git a/llvm/test/CodeGen/PowerPC/aix-weak.ll b/llvm/test/CodeGen/PowerPC/aix-weak.ll --- a/llvm/test/CodeGen/PowerPC/aix-weak.ll +++ b/llvm/test/CodeGen/PowerPC/aix-weak.ll @@ -123,7 +123,7 @@ ; CHECKSYM-NEXT: SectionLen: 136 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0 -; CHECKSYM-NEXT: SymbolAlignmentLog2: 4 +; CHECKSYM-NEXT: SymbolAlignmentLog2: 5 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1) ; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0) ; CHECKSYM-NEXT: StabInfoIndex: 0x0 diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-data.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-data.ll --- a/llvm/test/CodeGen/PowerPC/aix-xcoff-data.ll +++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-data.ll @@ -44,7 +44,7 @@ ; CHECK-NOT: .toc -; CHECK: .csect .text[PR],2 +; CHECK: .csect .text[PR],5 ; CHECK-NEXT: .file ; CHECK: .csect .data[RW],5 @@ -232,7 +232,7 @@ ; SYMS-NEXT: SectionLen: 0 ; SYMS-NEXT: ParameterHashIndex: 0x0 ; SYMS-NEXT: TypeChkSectNum: 0x0 -; SYMS-NEXT: SymbolAlignmentLog2: 2 +; SYMS-NEXT: SymbolAlignmentLog2: 5 ; SYMS-NEXT: SymbolType: XTY_SD (0x1) ; SYMS-NEXT: StorageMappingClass: XMC_PR (0x0) ; SYMS-NEXT: StabInfoIndex: 0x0 diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-explicit-section.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-explicit-section.ll --- a/llvm/test/CodeGen/PowerPC/aix-xcoff-explicit-section.ll +++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-explicit-section.ll @@ -25,7 +25,7 @@ ; CHECK-NEXT: .globl .ext_fun ; CHECK-NEXT: .align 4 ; CHECK-NEXT: .csect ext_fun[DS] -; CHECK: .csect .ext_fun_sec[PR],2 +; CHECK: .csect .ext_fun_sec[PR],5 ; CHECK-NEXT: .ext_fun: ; CHECK: .csect .ext_const_sec[RO],2 ; CHECK-NEXT: .globl ext_const @@ -90,7 +90,7 @@ ; CHECKSYM-NEXT: SectionLen: 28 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0 -; CHECKSYM-NEXT: SymbolAlignmentLog2: 4 +; CHECKSYM-NEXT: SymbolAlignmentLog2: 5 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1) ; CHECKSYM-NEXT: StorageMappingClass: XMC_PR (0x0) ; CHECKSYM-NEXT: StabInfoIndex: 0x0 diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-funcsect.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-funcsect.ll --- a/llvm/test/CodeGen/PowerPC/aix-xcoff-funcsect.ll +++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-funcsect.ll @@ -34,7 +34,7 @@ ret void } -; ASM: .csect .foo[PR],2 +; ASM: .csect .foo[PR],5 ; ASM-NEXT: .globl foo[DS] # -- Begin function foo ; ASM-NEXT: .globl .foo[PR] ; ASM-NEXT: .align 4 @@ -43,11 +43,11 @@ ; ASM-NEXT: .vbyte {{[0-9]+}}, .foo[PR] ; ASM-NEXT: .vbyte {{[0-9]+}}, TOC[TC0] ; ASM-NEXT: .vbyte {{[0-9]+}}, 0 -; ASM-NEXT: .csect .foo[PR],2 +; ASM-NEXT: .csect .foo[PR],5 ; ASM-NEXT: .alias_foo: ; ASM-NEXT: # %bb.0: # %entry ; ASM-NEXT: blr -; ASM: .csect .hidden_foo[PR],2 +; ASM: .csect .hidden_foo[PR],5 ; ASM-NEXT: .globl hidden_foo[DS],hidden # -- Begin function hidden_foo ; ASM-NEXT: .globl .hidden_foo[PR],hidden ; ASM-NEXT: .align 4 @@ -58,7 +58,7 @@ ; ASM-NEXT: .csect .hidden_foo[PR] ; ASM-NEXT: # %bb.0: # %entry ; ASM-NEXT: blr -; ASM: .csect .bar[PR],2 +; ASM: .csect .bar[PR],5 ; ASM-NEXT: .globl bar[DS] # -- Begin function bar ; ASM-NEXT: .globl .bar[PR] ; ASM-NEXT: .align 4 @@ -66,7 +66,7 @@ ; ASM-NEXT: .vbyte {{[0-9]+}}, .bar[PR] # @bar ; ASM-NEXT: .vbyte {{[0-9]+}}, TOC[TC0] ; ASM-NEXT: .vbyte {{[0-9]+}}, 0 -; ASM-NEXT: .csect .bar[PR],2 +; ASM-NEXT: .csect .bar[PR],5 ; ASM-NEXT: # %bb.0: # %entry ; ASM: bl .foo[PR] ; ASM-NEXT: nop diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-reloc-symb.mir b/llvm/test/CodeGen/PowerPC/aix-xcoff-reloc-symb.mir --- a/llvm/test/CodeGen/PowerPC/aix-xcoff-reloc-symb.mir +++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-reloc-symb.mir @@ -47,7 +47,7 @@ # SYM-NEXT: SectionLen: 8 # SYM-NEXT: ParameterHashIndex: 0x0 # SYM-NEXT: TypeChkSectNum: 0x0 -# SYM-NEXT: SymbolAlignmentLog2: 4 +# SYM-NEXT: SymbolAlignmentLog2: 5 # SYM-NEXT: SymbolType: XTY_SD (0x1) # SYM-NEXT: StorageMappingClass: XMC_PR (0x0) # SYM-NEXT: StabInfoIndex: 0x0 diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-reloc.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-reloc.ll --- a/llvm/test/CodeGen/PowerPC/aix-xcoff-reloc.ll +++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-reloc.ll @@ -210,7 +210,7 @@ ; SYM-NEXT: SectionLen: 64 ; SYM-NEXT: ParameterHashIndex: 0x0 ; SYM-NEXT: TypeChkSectNum: 0x0 -; SYM-NEXT: SymbolAlignmentLog2: 4 +; SYM-NEXT: SymbolAlignmentLog2: 5 ; SYM-NEXT: SymbolType: XTY_SD (0x1) ; SYM-NEXT: StorageMappingClass: XMC_PR (0x0) ; SYM-NEXT: StabInfoIndex: 0x0 diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-symbol-rename.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-symbol-rename.ll --- a/llvm/test/CodeGen/PowerPC/aix-xcoff-symbol-rename.ll +++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-symbol-rename.ll @@ -54,7 +54,7 @@ ; ASM-NEXT: .vbyte 4, ._Renamed..24f_o # @"f$o" ; ASM-NEXT: .vbyte 4, TOC[TC0] ; ASM-NEXT: .vbyte 4, 0 -; ASM-NEXT: .csect .text[PR],2 +; ASM-NEXT: .csect .text[PR],5 ; ASM-NEXT: ._Renamed..24f_o: ; ASM: bl ._Renamed..40f_o[PR] ; ASM-NEXT: nop @@ -67,7 +67,7 @@ ; ASM-NEXT: .vbyte 4, ._Renamed..26f_o # @"f&o" ; ASM-NEXT: .vbyte 4, TOC[TC0] ; ASM-NEXT: .vbyte 4, 0 -; ASM-NEXT: .csect .text[PR],2 +; ASM-NEXT: .csect .text[PR],5 ; ASM-NEXT: ._Renamed..26f_o: ; ASM: bl ._Renamed..24f_o ; ASM: .globl _Renamed..265ff__o[DS] # -- Begin function f&_o @@ -79,7 +79,7 @@ ; ASM-NEXT: .vbyte 4, ._Renamed..265ff__o # @"f&_o" ; ASM-NEXT: .vbyte 4, TOC[TC0] ; ASM-NEXT: .vbyte 4, 0 -; ASM-NEXT: .csect .text[PR],2 +; ASM-NEXT: .csect .text[PR],5 ; ASM-NEXT: ._Renamed..265ff__o: ; ASM: .csect .data[RW],2 ; ASM-NEXT: .globl _Renamed..60f_o diff --git a/llvm/test/CodeGen/PowerPC/test_func_desc.ll b/llvm/test/CodeGen/PowerPC/test_func_desc.ll --- a/llvm/test/CodeGen/PowerPC/test_func_desc.ll +++ b/llvm/test/CodeGen/PowerPC/test_func_desc.ll @@ -37,7 +37,7 @@ ; 64BIT-NEXT: .vbyte 8, .foo ; 64BIT-NEXT: .vbyte 8, TOC[TC0] ; 64BIT-NEXT: .vbyte 8, 0 -; CHECK-NEXT: .csect .text[PR],2 +; CHECK-NEXT: .csect .text[PR],5 ; CHECK-LABEL: .foo: ; CHECK: .globl main[DS] @@ -50,7 +50,7 @@ ; 64BIT-NEXT: .vbyte 8, .main ; 64BIT-NEXT: .vbyte 8, TOC[TC0] ; 64BIT-NEXT: .vbyte 8, 0 -; CHECK-NEXT: .csect .text[PR],2 +; CHECK-NEXT: .csect .text[PR],5 ; CHECK-LABEL: .main: ; CHECK: bl .foo ; CHECK: bl .extern_foo @@ -66,7 +66,7 @@ ; 64BIT-NEXT: .vbyte 8, .static_foo ; 64BIT-NEXT: .vbyte 8, TOC[TC0] ; 64BIT-NEXT: .vbyte 8, 0 -; CHECK-NEXT: .csect .text[PR],2 +; CHECK-NEXT: .csect .text[PR],5 ; CHECK-LABEL: .static_foo: ; CHECK-NOT: .csect extern_foo diff --git a/llvm/test/DebugInfo/XCOFF/empty.ll b/llvm/test/DebugInfo/XCOFF/empty.ll --- a/llvm/test/DebugInfo/XCOFF/empty.ll +++ b/llvm/test/DebugInfo/XCOFF/empty.ll @@ -35,7 +35,7 @@ !11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) !12 = !DILocation(line: 3, column: 3, scope: !8) -; ASM32: .csect .text[PR],2 +; ASM32: .csect .text[PR],5 ; ASM32-NEXT: .file "1.c" ; ASM32-NEXT: .globl main[DS] # -- Begin function main ; ASM32-NEXT: .globl .main @@ -44,7 +44,7 @@ ; ASM32-NEXT: .vbyte 4, .main # @main ; ASM32-NEXT: .vbyte 4, TOC[TC0] ; ASM32-NEXT: .vbyte 4, 0 -; ASM32-NEXT: .csect .text[PR],2 +; ASM32-NEXT: .csect .text[PR],5 ; ASM32-NEXT: .main: ; ASM32-NEXT: L..func_begin0: ; ASM32-NEXT: # %bb.0: # %entry @@ -236,7 +236,7 @@ ; ASM32-NEXT: .byte 1 ; ASM32-NEXT: L..debug_line_end0: -; ASM64: .csect .text[PR],2 +; ASM64: .csect .text[PR],5 ; ASM64-NEXT: .file "1.c" ; ASM64-NEXT: .globl main[DS] # -- Begin function main ; ASM64-NEXT: .globl .main @@ -245,7 +245,7 @@ ; ASM64-NEXT: .vbyte 8, .main # @main ; ASM64-NEXT: .vbyte 8, TOC[TC0] ; ASM64-NEXT: .vbyte 8, 0 -; ASM64-NEXT: .csect .text[PR],2 +; ASM64-NEXT: .csect .text[PR],5 ; ASM64-NEXT: .main: ; ASM64-NEXT: L..func_begin0: ; ASM64-NEXT: # %bb.0: # %entry diff --git a/llvm/test/DebugInfo/XCOFF/explicit-section.ll b/llvm/test/DebugInfo/XCOFF/explicit-section.ll --- a/llvm/test/DebugInfo/XCOFF/explicit-section.ll +++ b/llvm/test/DebugInfo/XCOFF/explicit-section.ll @@ -42,7 +42,7 @@ !15 = !DILocation(line: 3, column: 10, scope: !14) !16 = !DILocation(line: 3, column: 3, scope: !14) -; CHECK: .csect .text[PR],2 +; CHECK: .csect .text[PR],5 ; CHECK-NEXT: .file "2.c" ; CHECK-NEXT: .globl bar[DS] # -- Begin function bar ; CHECK-NEXT: .globl .bar @@ -51,7 +51,7 @@ ; CHECK-NEXT: .vbyte 4, .bar # @bar ; CHECK-NEXT: .vbyte 4, TOC[TC0] ; CHECK-NEXT: .vbyte 4, 0 -; CHECK-NEXT: .csect .text[PR],2 +; CHECK-NEXT: .csect .text[PR],5 ; CHECK-NEXT: .bar: ; CHECK-NEXT: L..func_begin0: ; CHECK-NEXT: # %bb.0: # %entry @@ -80,7 +80,7 @@ ; CHECK-NEXT: .byte "bar" # Function Name ; CHECK-NEXT: L..func_end0: ; CHECK-NEXT: # -- End function -; CHECK-NEXT: .csect explicit_main_sec[PR],2 +; CHECK-NEXT: .csect explicit_main_sec[PR],5 ; CHECK-NEXT: .globl main[DS] # -- Begin function main ; CHECK-NEXT: .globl .main ; CHECK-NEXT: .align 2 @@ -88,7 +88,7 @@ ; CHECK-NEXT: .vbyte 4, .main # @main ; CHECK-NEXT: .vbyte 4, TOC[TC0] ; CHECK-NEXT: .vbyte 4, 0 -; CHECK-NEXT: .csect explicit_main_sec[PR],2 +; CHECK-NEXT: .csect explicit_main_sec[PR],5 ; CHECK-NEXT: .main: ; CHECK-NEXT: L..func_begin1: ; CHECK-NEXT: # %bb.0: # %entry diff --git a/llvm/test/DebugInfo/XCOFF/function-sections.ll b/llvm/test/DebugInfo/XCOFF/function-sections.ll --- a/llvm/test/DebugInfo/XCOFF/function-sections.ll +++ b/llvm/test/DebugInfo/XCOFF/function-sections.ll @@ -37,9 +37,9 @@ !13 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 6, type: !9, scopeLine: 7, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2) !14 = !DILocation(line: 8, column: 3, scope: !13) -; CHECK: .csect .text[PR],2 +; CHECK: .csect .text[PR],5 ; CHECK-NEXT: .file "1.c" -; CHECK-NEXT: .csect .foo[PR],2 +; CHECK-NEXT: .csect .foo[PR],5 ; CHECK-NEXT: .globl foo[DS] # -- Begin function foo ; CHECK-NEXT: .globl .foo[PR] ; CHECK-NEXT: .align 2 @@ -47,7 +47,7 @@ ; CHECK-NEXT: .vbyte 4, .foo[PR] # @foo ; CHECK-NEXT: .vbyte 4, TOC[TC0] ; CHECK-NEXT: .vbyte 4, 0 -; CHECK-NEXT: .csect .foo[PR],2 +; CHECK-NEXT: .csect .foo[PR],5 ; CHECK-NEXT: L..func_begin0: ; CHECK-NEXT: # %bb.0: # %entry ; CHECK-NEXT: L..tmp0: @@ -75,7 +75,7 @@ ; CHECK-NEXT: .byte "foo" # Function Name ; CHECK-NEXT: L..func_end0: ; CHECK-NEXT: # -- End function -; CHECK-NEXT: .csect .bar[PR],2 +; CHECK-NEXT: .csect .bar[PR],5 ; CHECK-NEXT: .globl bar[DS] # -- Begin function bar ; CHECK-NEXT: .globl .bar[PR] ; CHECK-NEXT: .align 2 @@ -83,7 +83,7 @@ ; CHECK-NEXT: .vbyte 4, .bar[PR] # @bar ; CHECK-NEXT: .vbyte 4, TOC[TC0] ; CHECK-NEXT: .vbyte 4, 0 -; CHECK-NEXT: .csect .bar[PR],2 +; CHECK-NEXT: .csect .bar[PR],5 ; CHECK-NEXT: L..func_begin1: ; CHECK-NEXT: # %bb.0: # %entry ; CHECK-NEXT: L..tmp3: