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 @@ -92,7 +92,7 @@ // with a storage mapping class of `xmc_pr` will get placed into the same // container. using CsectGroup = std::deque; -using CsectGroups = std::deque; +using CsectGroups = std::deque>; // The basic section entry defination. This Section represents a section entry // in XCOFF section header table. @@ -160,9 +160,8 @@ // This is a section containing csect groups. CsectGroups Groups; - CsectSectionEntry(StringRef N, XCOFF::SectionTypeFlags Flags, bool IsVirtual, - CsectGroups Groups) - : SectionEntry(N, Flags), IsVirtual(IsVirtual), Groups(Groups) { + CsectSectionEntry(StringRef N, XCOFF::SectionTypeFlags Flags, bool IsVirtual) + : SectionEntry(N, Flags), IsVirtual(IsVirtual) { assert(N.size() <= XCOFF::NameSize && "section name too long"); memcpy(Name, N.data(), N.size()); } @@ -170,7 +169,7 @@ void reset() override { SectionEntry::reset(); // Clear any csects we have stored. - for (auto *Group : Groups) + for (auto &Group : Groups) Group->clear(); } @@ -230,27 +229,10 @@ // Needed for relocation. DenseMap SymbolIndexMap; - // CsectGroups. These store the csects which make up different parts of - // the sections. Should have one for each set of csects that get mapped into - // the same section and get handled in a 'similar' way. - CsectGroup UndefinedCsects; - CsectGroup ProgramCodeCsects; - CsectGroup ReadOnlyCsects; - CsectGroup DataCsects; - CsectGroup FuncDSCsects; - CsectGroup TOCCsects; - CsectGroup BSSCsects; + std::unique_ptr UndefinedCsects; - // The Predefined sections. - CsectSectionEntry Text; - CsectSectionEntry Data; - CsectSectionEntry BSS; - - // All the XCOFF sections, in the order they will appear in the section header - // table. - std::array Sections{{&Text, &Data, &BSS}}; - - CsectGroup &getCsectGroup(const MCSectionXCOFF *MCSec); + // All the XCOFF sections. + SmallVector, 4> Sections; virtual void reset() override; @@ -286,6 +268,14 @@ void assignAddressesAndIndices(const MCAsmLayout &); void finalizeSectionInfo(); + // Find the CsectGroup in the Sectons, return the CsectGroup if found and + // nullptr if not found. + std::unique_ptr *getCsectGroup(const MCSectionXCOFF *MCSec); + + // Find the SectionEntry in the Sectons, return the SectionEntry if found and + // nullptr if not found. + std::unique_ptr *getCsectSectionEntry(const CsectGroup *Group); + bool needsAuxiliaryHeader() const { /* TODO aux header support not implemented. */ return false; @@ -298,6 +288,46 @@ return 0; } + bool isProgramCodeCsects(const MCSectionXCOFF *MCSec) { + return MCSec->getMappingClass() == XCOFF::XMC_PR; + } + bool isReadOnlyCsects(const MCSectionXCOFF *MCSec) { + return MCSec->getMappingClass() == XCOFF::XMC_RO; + } + bool isBSSCsects(const MCSectionXCOFF *MCSec) { + return (MCSec->getMappingClass() == XCOFF::XMC_RW && + MCSec->getCSectType() == XCOFF::XTY_CM) || + (MCSec->getMappingClass() == XCOFF::XMC_BS); + } + bool isDataCsects(const MCSectionXCOFF *MCSec) { + return MCSec->getMappingClass() == XCOFF::XMC_RW && + MCSec->getCSectType() == XCOFF::XTY_SD; + } + bool isFuncDSCsects(const MCSectionXCOFF *MCSec) { + return MCSec->getMappingClass() == XCOFF::XMC_DS; + } + bool isTOCCsects(const MCSectionXCOFF *MCSec) { + XCOFF::StorageMappingClass SMC = MCSec->getMappingClass(); + return SMC == XCOFF::XMC_TC0 || SMC == XCOFF::XMC_TC || + SMC == XCOFF::XMC_TE; + } + + bool isTextSectionEntry(const CsectGroup *Group) { + assert(!Group->empty() && "Empty Group!"); + return isProgramCodeCsects(Group->front().MCSec) || + isReadOnlyCsects(Group->front().MCSec); + } + bool isDataSectionEntry(const CsectGroup *Group) { + assert(!Group->empty() && "Empty Group!"); + return isDataCsects(Group->front().MCSec) || + isFuncDSCsects(Group->front().MCSec) || + isTOCCsects(Group->front().MCSec); + } + bool isBSSSectionEntry(const CsectGroup *Group) { + assert(!Group->empty() && "Empty Group!"); + return isBSSCsects(Group->front().MCSec); + } + public: XCOFFObjectWriter(std::unique_ptr MOTW, raw_pwrite_stream &OS); @@ -307,23 +337,20 @@ std::unique_ptr MOTW, raw_pwrite_stream &OS) : W(OS, support::big), TargetObjectWriter(std::move(MOTW)), Strings(StringTableBuilder::XCOFF), - Text(".text", XCOFF::STYP_TEXT, /* IsVirtual */ false, - CsectGroups{&ProgramCodeCsects, &ReadOnlyCsects}), - Data(".data", XCOFF::STYP_DATA, /* IsVirtual */ false, - CsectGroups{&DataCsects, &FuncDSCsects, &TOCCsects}), - BSS(".bss", XCOFF::STYP_BSS, /* IsVirtual */ true, - CsectGroups{&BSSCsects}) {} + UndefinedCsects(std::make_unique()) {} void XCOFFObjectWriter::reset() { // Clear the mappings we created. SymbolIndexMap.clear(); SectionMap.clear(); - UndefinedCsects.clear(); + UndefinedCsects->clear(); // Reset any sections we have written to, and empty the section header table. - for (auto *Sec : Sections) + for (auto &Sec : Sections) Sec->reset(); + Sections.clear(); + // Reset states in XCOFFObjectWriter. SymbolTableEntryCount = 0; SymbolTableOffset = 0; @@ -334,48 +361,55 @@ MCObjectWriter::reset(); } -CsectGroup &XCOFFObjectWriter::getCsectGroup(const MCSectionXCOFF *MCSec) { - switch (MCSec->getMappingClass()) { - case XCOFF::XMC_PR: - assert(XCOFF::XTY_SD == MCSec->getCSectType() && - "Only an initialized csect can contain program code."); - return ProgramCodeCsects; - case XCOFF::XMC_RO: - assert(XCOFF::XTY_SD == MCSec->getCSectType() && - "Only an initialized csect can contain read only data."); - return ReadOnlyCsects; - case XCOFF::XMC_RW: - if (XCOFF::XTY_CM == MCSec->getCSectType()) - return BSSCsects; - - if (XCOFF::XTY_SD == MCSec->getCSectType()) - return DataCsects; - - report_fatal_error("Unhandled mapping of read-write csect to section."); - case XCOFF::XMC_DS: - return FuncDSCsects; - case XCOFF::XMC_BS: - assert(XCOFF::XTY_CM == MCSec->getCSectType() && - "Mapping invalid csect. CSECT with bss storage class must be " - "common type."); - return BSSCsects; - case XCOFF::XMC_TC0: - assert(XCOFF::XTY_SD == MCSec->getCSectType() && - "Only an initialized csect can contain TOC-base."); - assert(TOCCsects.empty() && - "We should have only one TOC-base, and it should be the first csect " - "in this CsectGroup."); - return TOCCsects; - case XCOFF::XMC_TC: - case XCOFF::XMC_TE: - assert(XCOFF::XTY_SD == MCSec->getCSectType() && - "Only an initialized csect can contain TC entry."); - assert(!TOCCsects.empty() && - "We should at least have a TOC-base in this CsectGroup."); - return TOCCsects; - default: - report_fatal_error("Unhandled mapping of csect to section."); +// Currently we support +// ProgramCodeCsects/ReadOnlyCsects/BSSCsects/DataCsects/FuncDSCsects/TOCCsects. +std::unique_ptr * +XCOFFObjectWriter::getCsectGroup(const MCSectionXCOFF *MCSec) { + if (Sections.empty()) + return nullptr; + + for (auto &SectionEntry : Sections) { + if (CsectSectionEntry *Csect = + dyn_cast(SectionEntry.get())) { + for (auto &Group : Csect->Groups) { + // For FuncDSCsects, it only requires the mapping class. While for other + // section group, it requires both the mapping class and the symbol + // type. + if (MCSec->getMappingClass() == XCOFF::XMC_DS && + Group->front().MCSec->getMappingClass() == XCOFF::XMC_DS) + return &Group; + // For ProgramCodeCsects/ReadOnlyCsects/BSSCsects/DataCsects/TOCCsects. + if (Group->front().MCSec->getMappingClass() == + MCSec->getMappingClass() && + Group->front().MCSec->getCSectType() == MCSec->getCSectType()) + return &Group; + } + } } + + return nullptr; +} + +std::unique_ptr * +XCOFFObjectWriter::getCsectSectionEntry(const CsectGroup *Group) { + if (Sections.empty()) + return nullptr; + + bool IsText = isTextSectionEntry(Group); + bool IsData = isDataSectionEntry(Group); + bool IsBSS = isBSSSectionEntry(Group); + assert((IsText + IsData + IsBSS == 1) && + "One Group should only be mapped to one section entry!"); + + for (auto &SectionEntry : Sections) + if (CsectSectionEntry *Csect = + dyn_cast(SectionEntry.get())) + if ((IsText && Csect->Flags == XCOFF::STYP_TEXT) || + (IsData && Csect->Flags == XCOFF::STYP_DATA) || + (IsBSS && Csect->Flags == XCOFF::STYP_BSS)) + return &SectionEntry; + + return nullptr; } static MCSectionXCOFF *getContainingCsect(const MCSymbolXCOFF *XSym) { @@ -389,6 +423,24 @@ if (TargetObjectWriter->is64Bit()) report_fatal_error("64-bit XCOFF object files are not supported yet."); + auto CreateNewSectionEntry = + [&](const CsectGroup *Group) -> std::unique_ptr { + bool IsText = isTextSectionEntry(Group); + bool IsData = isDataSectionEntry(Group); + bool IsBSS = isBSSSectionEntry(Group); + assert((IsText + IsData + IsBSS == 1) && + "One Group should only be mapped to one section entry!"); + if (IsText) + return std::make_unique(".text", XCOFF::STYP_TEXT, + /* IsVirtual */ false); + if (IsData) + return std::make_unique(".data", XCOFF::STYP_DATA, + /* IsVirtual */ false); + assert(IsBSS && "unsupport section type!"); + return std::make_unique(".bss", XCOFF::STYP_BSS, + /* IsVirtual */ true); + }; + for (const auto &S : Asm) { const auto *MCSec = cast(&S); assert(SectionMap.find(MCSec) == SectionMap.end() && @@ -401,9 +453,45 @@ if (nameShouldBeInStringTable(MCSec->getSymbolTableName())) Strings.add(MCSec->getSymbolTableName()); - CsectGroup &Group = getCsectGroup(MCSec); - Group.emplace_back(MCSec); - SectionMap[MCSec] = &Group.back(); + // Check if the CsectGroup is already generated before. + bool IsGroupFound = true; + std::unique_ptr *Group = getCsectGroup(MCSec); + std::unique_ptr G; + // Create the new CsectGroup. + if (!Group) { + // If the Group is not found in the Sections, it needs to be added later. + IsGroupFound = false; + G = std::make_unique(); + Group = &G; + } + + // Add the MCSec to the Group. + (*Group)->emplace_back(MCSec); + SectionMap[MCSec] = &((*Group)->back()); + + // Check if the SectionEntry is alredy generated before. + std::unique_ptr *CsectEntry = + getCsectSectionEntry(Group->get()); + + bool IsSectionEntryFound = true; + std::unique_ptr SE; + // Create the new CsectSetionEntry. + if (!CsectEntry) { + SE = CreateNewSectionEntry(Group->get()); + CsectEntry = &SE; + IsSectionEntryFound = false; + } + assert(!(IsGroupFound && !IsSectionEntryFound) && + "Group exists in non-exist Csect section entry!"); + + // If the Group is not in the section entry, now add it. + if (!IsGroupFound) + (dyn_cast((*CsectEntry).get())) + ->Groups.emplace_back(std::move(*Group)); + + // If the Seciton entry is not in the Sections of the object, now add it. + if (!IsSectionEntryFound) + Sections.push_back(std::move(*CsectEntry)); } for (const MCSymbol &S : Asm.symbols()) { @@ -416,8 +504,8 @@ if (ContainingCsect->getCSectType() == XCOFF::XTY_ER) { // Handle undefined symbol. - UndefinedCsects.emplace_back(ContainingCsect); - SectionMap[ContainingCsect] = &UndefinedCsects.back(); + UndefinedCsects->emplace_back(ContainingCsect); + SectionMap[ContainingCsect] = &(UndefinedCsects->back()); if (nameShouldBeInStringTable(ContainingCsect->getSymbolTableName())) Strings.add(ContainingCsect->getSymbolTableName()); continue; @@ -473,6 +561,22 @@ (Sym->isDefined() ? Layout.getSymbolOffset(*Sym) : 0); }; + auto GetTOCSectionGroup = [&]() -> std::unique_ptr & { + for (auto &Section : Sections) { + if (Section->Flags == XCOFF::STYP_DATA) { + for (auto &Group : + (dyn_cast(Section.get()))->Groups) { + XCOFF::StorageMappingClass SMC = + Group->front().MCSec->getMappingClass(); + if (SMC == XCOFF::XMC_TC0 || SMC == XCOFF::XMC_TC || + SMC == XCOFF::XMC_TE) + return Group; + } + } + } + report_fatal_error("TOC section group is not found!"); + }; + const MCSymbol *const SymA = &Target.getSymA()->getSymbol(); MCAsmBackend &Backend = Asm.getBackend(); @@ -498,7 +602,7 @@ // The FixedValue should be the TOC entry offset from the TOC-base plus any // constant offset value. const int64_t TOCEntryOffset = SectionMap[SymASec]->Address - - TOCCsects.front().Address + + GetTOCSectionGroup()->front().Address + Target.getConstant(); if (Type == XCOFF::RelocationType::R_TOC && !isInt<16>(TOCEntryOffset)) report_fatal_error("TOCEntryOffset overflows in small code model mode"); @@ -550,9 +654,10 @@ void XCOFFObjectWriter::writeSections(const MCAssembler &Asm, const MCAsmLayout &Layout) { uint32_t CurrentAddressLocation = 0; - for (const auto *Section : Sections) { - assert(isa(Section) && "Only csect entry is supported!"); - const auto *CsectEntry = dyn_cast(Section); + for (const auto &Section : Sections) { + assert(isa(Section.get()) && + "Only csect entry is supported!"); + const auto *CsectEntry = dyn_cast(Section.get()); // Nothing to write for this Section. if (CsectEntry->Index == SectionEntry::UninitializedIndex || CsectEntry->IsVirtual) @@ -566,7 +671,7 @@ CurrentAddressLocation = CsectEntry->Address; - for (const auto *Group : CsectEntry->Groups) { + for (const auto &Group : CsectEntry->Groups) { for (const auto &Csect : *Group) { if (uint32_t PaddingSize = Csect.Address - CurrentAddressLocation) W.OS.write_zeros(PaddingSize); @@ -723,7 +828,7 @@ } void XCOFFObjectWriter::writeSectionHeaderTable() { - for (const auto *Sec : Sections) { + for (const auto &Sec : Sections) { // Nothing to write for this Section. if (Sec->Index == SectionEntry::UninitializedIndex) continue; @@ -762,15 +867,16 @@ } void XCOFFObjectWriter::writeRelocations() { - for (const auto *Section : Sections) { + for (const auto &Section : Sections) { if (Section->Index == SectionEntry::UninitializedIndex) // Nothing to write for this Section. continue; - assert(isa(Section) && "Only csect entry is supported!"); - const auto *CsectEntry = dyn_cast(Section); + assert(isa(Section.get()) && + "Only csect entry is supported!"); + const auto *CsectEntry = dyn_cast(Section.get()); - for (const auto *Group : CsectEntry->Groups) { + for (const auto &Group : CsectEntry->Groups) { if (Group->empty()) continue; @@ -807,21 +913,22 @@ // n_numaux. No aux entry for now. W.write(0); - for (const auto &Csect : UndefinedCsects) { + for (const auto &Csect : *UndefinedCsects) { writeSymbolTableEntryForControlSection(Csect, XCOFF::ReservedSectionNum::N_UNDEF, Csect.MCSec->getStorageClass()); } - for (const auto *Section : Sections) { + for (const auto &Section : Sections) { if (Section->Index == SectionEntry::UninitializedIndex) // Nothing to write for this Section. continue; - assert(isa(Section) && "Only csect entry is supported!"); - const auto *CsectEntry = dyn_cast(Section); + assert(isa(Section.get()) && + "Only csect entry is supported!"); + const auto *CsectEntry = dyn_cast(Section.get()); - for (const auto *Group : CsectEntry->Groups) { + for (const auto &Group : CsectEntry->Groups) { if (Group->empty()) continue; @@ -840,15 +947,16 @@ } void XCOFFObjectWriter::finalizeSectionInfo() { - for (auto *Section : Sections) { + for (auto &Section : Sections) { if (Section->Index == SectionEntry::UninitializedIndex) // Nothing to record for this Section. continue; - assert(isa(Section) && "Only csect entry is supported!"); - auto *CsectEntry = dyn_cast(Section); + assert(isa(Section.get()) && + "Only csect entry is supported!"); + auto *CsectEntry = dyn_cast(Section.get()); - for (const auto *Group : CsectEntry->Groups) { + for (const auto &Group : CsectEntry->Groups) { if (Group->empty()) continue; @@ -867,9 +975,10 @@ // Calculate the file offset to the relocation entries. uint64_t RawPointer = RelocationEntryOffset; - for (auto Sec : Sections) { - assert(isa(Sec) && "Only csect entry is supported!"); - auto *CsectEntry = dyn_cast(Sec); + for (auto &Sec : Sections) { + assert(isa(Sec.get()) && + "Only csect entry is supported!"); + auto *CsectEntry = dyn_cast(Sec.get()); if (CsectEntry->Index == SectionEntry::UninitializedIndex || !CsectEntry->RelocationCount) @@ -894,7 +1003,7 @@ uint32_t SymbolTableIndex = 1; // Calculate indices for undefined symbols. - for (auto &Csect : UndefinedCsects) { + for (auto &Csect : *UndefinedCsects) { Csect.Size = 0; Csect.Address = 0; Csect.SymbolTableIndex = SymbolTableIndex; @@ -910,12 +1019,13 @@ // Section indices are 1-based in XCOFF. int32_t SectionIndex = 1; - for (auto *Section : Sections) { - assert(isa(Section) && "Only csect entry is supported!"); - auto *CsectEntry = dyn_cast(Section); - const bool IsEmpty = - llvm::all_of(CsectEntry->Groups, - [](const CsectGroup *Group) { return Group->empty(); }); + for (auto &Section : Sections) { + assert(isa(Section.get()) && + "Only csect entry is supported!"); + auto *CsectEntry = dyn_cast(Section.get()); + const bool IsEmpty = llvm::all_of( + CsectEntry->Groups, + [](std::unique_ptr &Group) { return Group->empty(); }); if (IsEmpty) continue; @@ -925,7 +1035,7 @@ SectionCount++; bool SectionAddressSet = false; - for (auto *Group : CsectEntry->Groups) { + for (auto &Group : CsectEntry->Groups) { if (Group->empty()) continue; @@ -965,9 +1075,10 @@ // Calculate the RawPointer value for each section. uint64_t RawPointer = sizeof(XCOFF::FileHeader32) + auxiliaryHeaderSize() + SectionCount * sizeof(XCOFF::SectionHeader32); - for (auto *Sec : Sections) { - assert(isa(Sec) && "Only csect entry is supported!"); - auto *CsectEntry = dyn_cast(Sec); + for (auto &Sec : Sections) { + assert(isa(Sec.get()) && + "Only csect entry is supported!"); + auto *CsectEntry = dyn_cast(Sec.get()); if (CsectEntry->Index == SectionEntry::UninitializedIndex || CsectEntry->IsVirtual) continue; 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 @@ -214,39 +214,39 @@ ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: Symbol { ; CHECKSYM-NEXT: Index: [[#Index+14]] -; CHECKSYM-NEXT: Name: .data +; CHECKSYM-NEXT: Name: main ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x50 ; CHECKSYM-NEXT: Section: .data ; CHECKSYM-NEXT: Type: 0x0 -; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B) +; CHECKSYM-NEXT: StorageClass: C_EXT (0x2) ; CHECKSYM-NEXT: NumberOfAuxEntries: 1 ; CHECKSYM-NEXT: CSECT Auxiliary Entry { ; CHECKSYM-NEXT: Index: [[#Index+15]] -; CHECKSYM-NEXT: SectionLen: 4 +; CHECKSYM-NEXT: SectionLen: 12 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 2 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1) -; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5) +; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA) ; CHECKSYM-NEXT: StabInfoIndex: 0x0 ; CHECKSYM-NEXT: StabSectNum: 0x0 ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: Symbol { ; CHECKSYM-NEXT: Index: [[#Index+16]] -; CHECKSYM-NEXT: Name: foo_ext_weak_p -; CHECKSYM-NEXT: Value (RelocatableAddress): 0x50 +; CHECKSYM-NEXT: Name: .data +; CHECKSYM-NEXT: Value (RelocatableAddress): 0x5C ; CHECKSYM-NEXT: Section: .data ; CHECKSYM-NEXT: Type: 0x0 -; CHECKSYM-NEXT: StorageClass: C_EXT (0x2) +; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B) ; CHECKSYM-NEXT: NumberOfAuxEntries: 1 ; CHECKSYM-NEXT: CSECT Auxiliary Entry { ; CHECKSYM-NEXT: Index: [[#Index+17]] -; CHECKSYM-NEXT: ContainingCsectSymbolIndex: [[#Index+14]] +; CHECKSYM-NEXT: SectionLen: 4 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0 -; CHECKSYM-NEXT: SymbolAlignmentLog2: 0 -; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2) +; CHECKSYM-NEXT: SymbolAlignmentLog2: 2 +; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1) ; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5) ; CHECKSYM-NEXT: StabInfoIndex: 0x0 ; CHECKSYM-NEXT: StabSectNum: 0x0 @@ -254,20 +254,20 @@ ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: Symbol { ; CHECKSYM-NEXT: Index: [[#Index+18]] -; CHECKSYM-NEXT: Name: main -; CHECKSYM-NEXT: Value (RelocatableAddress): 0x54 +; CHECKSYM-NEXT: Name: foo_ext_weak_p +; CHECKSYM-NEXT: Value (RelocatableAddress): 0x5C ; CHECKSYM-NEXT: Section: .data ; CHECKSYM-NEXT: Type: 0x0 ; CHECKSYM-NEXT: StorageClass: C_EXT (0x2) ; CHECKSYM-NEXT: NumberOfAuxEntries: 1 ; CHECKSYM-NEXT: CSECT Auxiliary Entry { ; CHECKSYM-NEXT: Index: [[#Index+19]] -; CHECKSYM-NEXT: SectionLen: 12 +; CHECKSYM-NEXT: ContainingCsectSymbolIndex: [[#Index+16]] ; CHECKSYM-NEXT: ParameterHashIndex: 0x0 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0 -; CHECKSYM-NEXT: SymbolAlignmentLog2: 2 -; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1) -; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA) +; CHECKSYM-NEXT: SymbolAlignmentLog2: 0 +; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2) +; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5) ; CHECKSYM-NEXT: StabInfoIndex: 0x0 ; CHECKSYM-NEXT: StabSectNum: 0x0 ; CHECKSYM-NEXT: } 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 @@ -255,80 +255,80 @@ ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: Symbol { ; CHECKSYM-NEXT: Index: [[#Index+16]] -; CHECKSYM-NEXT: Name: .data +; CHECKSYM-NEXT: Name: foo ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x70 ; CHECKSYM-NEXT: Section: .data ; CHECKSYM-NEXT: Type: 0x0 -; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B) +; CHECKSYM-NEXT: StorageClass: C_EXT (0x2) ; CHECKSYM-NEXT: NumberOfAuxEntries: 1 ; CHECKSYM-NEXT: CSECT Auxiliary Entry { ; CHECKSYM-NEXT: Index: [[#Index+17]] -; CHECKSYM-NEXT: SectionLen: 4 +; CHECKSYM-NEXT: SectionLen: 12 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 2 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1) -; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5) +; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA) ; CHECKSYM-NEXT: StabInfoIndex: 0x0 ; CHECKSYM-NEXT: StabSectNum: 0x0 ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: Symbol { ; CHECKSYM-NEXT: Index: [[#Index+18]] -; CHECKSYM-NEXT: Name: bar_p -; CHECKSYM-NEXT: Value (RelocatableAddress): 0x70 +; CHECKSYM-NEXT: Name: main +; CHECKSYM-NEXT: Value (RelocatableAddress): 0x7C ; CHECKSYM-NEXT: Section: .data ; CHECKSYM-NEXT: Type: 0x0 ; CHECKSYM-NEXT: StorageClass: C_EXT (0x2) ; CHECKSYM-NEXT: NumberOfAuxEntries: 1 ; CHECKSYM-NEXT: CSECT Auxiliary Entry { ; CHECKSYM-NEXT: Index: [[#Index+19]] -; CHECKSYM-NEXT: ContainingCsectSymbolIndex: [[#Index+16]] +; CHECKSYM-NEXT: SectionLen: 12 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0 -; CHECKSYM-NEXT: SymbolAlignmentLog2: 0 -; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2) -; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5) +; CHECKSYM-NEXT: SymbolAlignmentLog2: 2 +; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1) +; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA) ; CHECKSYM-NEXT: StabInfoIndex: 0x0 ; CHECKSYM-NEXT: StabSectNum: 0x0 ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: Symbol { ; CHECKSYM-NEXT: Index: [[#Index+20]] -; CHECKSYM-NEXT: Name: foo -; CHECKSYM-NEXT: Value (RelocatableAddress): 0x74 +; CHECKSYM-NEXT: Name: .data +; CHECKSYM-NEXT: Value (RelocatableAddress): 0x88 ; CHECKSYM-NEXT: Section: .data ; CHECKSYM-NEXT: Type: 0x0 -; CHECKSYM-NEXT: StorageClass: C_EXT (0x2) +; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B) ; CHECKSYM-NEXT: NumberOfAuxEntries: 1 ; CHECKSYM-NEXT: CSECT Auxiliary Entry { ; CHECKSYM-NEXT: Index: [[#Index+21]] -; CHECKSYM-NEXT: SectionLen: 12 +; CHECKSYM-NEXT: SectionLen: 4 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 2 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1) -; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA) +; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5) ; CHECKSYM-NEXT: StabInfoIndex: 0x0 ; CHECKSYM-NEXT: StabSectNum: 0x0 ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: Symbol { ; CHECKSYM-NEXT: Index: [[#Index+22]] -; CHECKSYM-NEXT: Name: main -; CHECKSYM-NEXT: Value (RelocatableAddress): 0x80 +; CHECKSYM-NEXT: Name: bar_p +; CHECKSYM-NEXT: Value (RelocatableAddress): 0x88 ; CHECKSYM-NEXT: Section: .data ; CHECKSYM-NEXT: Type: 0x0 ; CHECKSYM-NEXT: StorageClass: C_EXT (0x2) ; CHECKSYM-NEXT: NumberOfAuxEntries: 1 ; CHECKSYM-NEXT: CSECT Auxiliary Entry { ; CHECKSYM-NEXT: Index: [[#Index+23]] -; CHECKSYM-NEXT: SectionLen: 12 +; CHECKSYM-NEXT: ContainingCsectSymbolIndex: [[#Index+20]] ; CHECKSYM-NEXT: ParameterHashIndex: 0x0 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0 -; CHECKSYM-NEXT: SymbolAlignmentLog2: 2 -; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1) -; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA) +; CHECKSYM-NEXT: SymbolAlignmentLog2: 0 +; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2) +; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5) ; CHECKSYM-NEXT: StabInfoIndex: 0x0 ; CHECKSYM-NEXT: StabSectNum: 0x0 ; CHECKSYM-NEXT: } diff --git a/llvm/test/CodeGen/PowerPC/aix-return55.ll b/llvm/test/CodeGen/PowerPC/aix-return55.ll --- a/llvm/test/CodeGen/PowerPC/aix-return55.ll +++ b/llvm/test/CodeGen/PowerPC/aix-return55.ll @@ -29,16 +29,16 @@ ;CHECKOBJ-NEXT: c: 6f 77 6f 72 xoris 23, 27, 28530 ;CHECKOBJ-NEXT: 10: 0a 00 00 00 tdlti 0, 0{{[[:space:]] *}} ;CHECKOBJ-NEXT: Disassembly of section .data:{{[[:space:]] *}} -;CHECKOBJ-NEXT: 00000018 : -;CHECKOBJ-NEXT: 18: 00 01 23 45 -;CHECKOBJ-NEXT: 1c: 67 8a bc de oris 10, 28, 48350{{[[:space:]] *}} -;CHECKOBJ-NEXT: 00000020 : -;CHECKOBJ-NEXT: 20: 40 14 00 00 bdnzf 20, 0x20 -;CHECKOBJ-NEXT: 24: 00 00 00 00 {{[[:space:]] *}} -;CHECKOBJ-NEXT: 00000028 : -;CHECKOBJ-NEXT: 28: 00 00 00 00 -;CHECKOBJ-NEXT: 2c: 00 00 00 34 -;CHECKOBJ-NEXT: 30: 00 00 00 00 +;CHECKOBJ-NEXT: 00000014 : +;CHECKOBJ-NEXT: 14: 00 00 00 00 +;CHECKOBJ-NEXT: 18: 00 00 00 30 +;CHECKOBJ-NEXT: 1c: 00 00 00 00 {{[[:space:]] *}} +;CHECKOBJ-NEXT: 00000020 : +;CHECKOBJ-NEXT: 20: 00 01 23 45 +;CHECKOBJ-NEXT: 24: 67 8a bc de oris 10, 28, 48350{{[[:space:]] *}} +;CHECKOBJ-NEXT: 00000028 : +;CHECKOBJ-NEXT: 28: 40 14 00 00 bdnzf 20, 0x28 +;CHECKOBJ-NEXT: 2c: 00 00 00 00 ;CHECKSECT: Sections [ ;CHECKSECT-NEXT: Section { @@ -57,8 +57,8 @@ ;CHECKSECT-NEXT: Section { ;CHECKSECT-NEXT: Index: 2 ;CHECKSECT-NEXT: Name: .data -;CHECKSECT-NEXT: PhysicalAddress: 0x18 -;CHECKSECT-NEXT: VirtualAddress: 0x18 +;CHECKSECT-NEXT: PhysicalAddress: 0x14 +;CHECKSECT-NEXT: VirtualAddress: 0x14 ;CHECKSECT-NEXT: Size: 0x1C ;CHECKSECT-NEXT: RawDataOffset: 0x78 ;CHECKSECT-NEXT: RelocationPointer: 0x94 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 @@ -192,120 +192,120 @@ ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: Symbol { ; CHECKSYM-NEXT: Index: [[#Index+8]] -; CHECKSYM-NEXT: Name: .data +; CHECKSYM-NEXT: Name: foo_weak ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x88 ; CHECKSYM-NEXT: Section: .data ; CHECKSYM-NEXT: Type: 0x0 -; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B) +; CHECKSYM-NEXT: StorageClass: C_WEAKEXT (0x6F) ; CHECKSYM-NEXT: NumberOfAuxEntries: 1 ; CHECKSYM-NEXT: CSECT Auxiliary Entry { ; CHECKSYM-NEXT: Index: [[#Index+9]] -; CHECKSYM-NEXT: SectionLen: 8 +; CHECKSYM-NEXT: SectionLen: 12 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 2 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1) -; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5) +; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA) ; CHECKSYM-NEXT: StabInfoIndex: 0x0 ; CHECKSYM-NEXT: StabSectNum: 0x0 ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: Symbol { ; CHECKSYM-NEXT: Index: [[#Index+10]] -; CHECKSYM-NEXT: Name: foo_weak_p -; CHECKSYM-NEXT: Value (RelocatableAddress): 0x88 +; CHECKSYM-NEXT: Name: foo_ref_weak +; CHECKSYM-NEXT: Value (RelocatableAddress): 0x94 ; CHECKSYM-NEXT: Section: .data ; CHECKSYM-NEXT: Type: 0x0 -; CHECKSYM-NEXT: StorageClass: C_EXT (0x2) +; CHECKSYM-NEXT: StorageClass: C_WEAKEXT (0x6F) ; CHECKSYM-NEXT: NumberOfAuxEntries: 1 ; CHECKSYM-NEXT: CSECT Auxiliary Entry { ; CHECKSYM-NEXT: Index: [[#Index+11]] -; CHECKSYM-NEXT: ContainingCsectSymbolIndex: [[#Index+8]] +; CHECKSYM-NEXT: SectionLen: 12 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0 -; CHECKSYM-NEXT: SymbolAlignmentLog2: 0 -; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2) -; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5) +; CHECKSYM-NEXT: SymbolAlignmentLog2: 2 +; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1) +; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA) ; CHECKSYM-NEXT: StabInfoIndex: 0x0 ; CHECKSYM-NEXT: StabSectNum: 0x0 ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: Symbol { ; CHECKSYM-NEXT: Index: [[#Index+12]] -; CHECKSYM-NEXT: Name: b -; CHECKSYM-NEXT: Value (RelocatableAddress): 0x8C +; CHECKSYM-NEXT: Name: main +; CHECKSYM-NEXT: Value (RelocatableAddress): 0xA0 ; CHECKSYM-NEXT: Section: .data ; CHECKSYM-NEXT: Type: 0x0 -; CHECKSYM-NEXT: StorageClass: C_WEAKEXT (0x6F) +; CHECKSYM-NEXT: StorageClass: C_EXT (0x2) ; CHECKSYM-NEXT: NumberOfAuxEntries: 1 ; CHECKSYM-NEXT: CSECT Auxiliary Entry { ; CHECKSYM-NEXT: Index: [[#Index+13]] -; CHECKSYM-NEXT: ContainingCsectSymbolIndex: [[#Index+8]] +; CHECKSYM-NEXT: SectionLen: 12 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0 -; CHECKSYM-NEXT: SymbolAlignmentLog2: 0 -; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2) -; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5) +; CHECKSYM-NEXT: SymbolAlignmentLog2: 2 +; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1) +; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA) ; CHECKSYM-NEXT: StabInfoIndex: 0x0 ; CHECKSYM-NEXT: StabSectNum: 0x0 ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: Symbol { ; CHECKSYM-NEXT: Index: [[#Index+14]] -; CHECKSYM-NEXT: Name: foo_weak -; CHECKSYM-NEXT: Value (RelocatableAddress): 0x90 +; CHECKSYM-NEXT: Name: .data +; CHECKSYM-NEXT: Value (RelocatableAddress): 0xAC ; CHECKSYM-NEXT: Section: .data ; CHECKSYM-NEXT: Type: 0x0 -; CHECKSYM-NEXT: StorageClass: C_WEAKEXT (0x6F) +; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B) ; CHECKSYM-NEXT: NumberOfAuxEntries: 1 ; CHECKSYM-NEXT: CSECT Auxiliary Entry { ; CHECKSYM-NEXT: Index: [[#Index+15]] -; CHECKSYM-NEXT: SectionLen: 12 +; CHECKSYM-NEXT: SectionLen: 8 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 2 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1) -; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA) +; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5) ; CHECKSYM-NEXT: StabInfoIndex: 0x0 ; CHECKSYM-NEXT: StabSectNum: 0x0 ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: Symbol { ; CHECKSYM-NEXT: Index: [[#Index+16]] -; CHECKSYM-NEXT: Name: foo_ref_weak -; CHECKSYM-NEXT: Value (RelocatableAddress): 0x9C +; CHECKSYM-NEXT: Name: foo_weak_p +; CHECKSYM-NEXT: Value (RelocatableAddress): 0xAC ; CHECKSYM-NEXT: Section: .data ; CHECKSYM-NEXT: Type: 0x0 -; CHECKSYM-NEXT: StorageClass: C_WEAKEXT (0x6F) +; CHECKSYM-NEXT: StorageClass: C_EXT (0x2) ; CHECKSYM-NEXT: NumberOfAuxEntries: 1 ; CHECKSYM-NEXT: CSECT Auxiliary Entry { ; CHECKSYM-NEXT: Index: [[#Index+17]] -; CHECKSYM-NEXT: SectionLen: 12 +; CHECKSYM-NEXT: ContainingCsectSymbolIndex: [[#Index+14]] ; CHECKSYM-NEXT: ParameterHashIndex: 0x0 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0 -; CHECKSYM-NEXT: SymbolAlignmentLog2: 2 -; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1) -; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA) +; CHECKSYM-NEXT: SymbolAlignmentLog2: 0 +; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2) +; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5) ; CHECKSYM-NEXT: StabInfoIndex: 0x0 ; CHECKSYM-NEXT: StabSectNum: 0x0 ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: Symbol { ; CHECKSYM-NEXT: Index: [[#Index+18]] -; CHECKSYM-NEXT: Name: main -; CHECKSYM-NEXT: Value (RelocatableAddress): 0xA8 +; CHECKSYM-NEXT: Name: b +; CHECKSYM-NEXT: Value (RelocatableAddress): 0xB0 ; CHECKSYM-NEXT: Section: .data ; CHECKSYM-NEXT: Type: 0x0 -; CHECKSYM-NEXT: StorageClass: C_EXT (0x2) +; CHECKSYM-NEXT: StorageClass: C_WEAKEXT (0x6F) ; CHECKSYM-NEXT: NumberOfAuxEntries: 1 ; CHECKSYM-NEXT: CSECT Auxiliary Entry { ; CHECKSYM-NEXT: Index: [[#Index+19]] -; CHECKSYM-NEXT: SectionLen: 12 +; CHECKSYM-NEXT: ContainingCsectSymbolIndex: [[#Index+14]] ; CHECKSYM-NEXT: ParameterHashIndex: 0x0 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0 -; CHECKSYM-NEXT: SymbolAlignmentLog2: 2 -; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1) -; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA) +; CHECKSYM-NEXT: SymbolAlignmentLog2: 0 +; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2) +; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5) ; CHECKSYM-NEXT: StabInfoIndex: 0x0 ; CHECKSYM-NEXT: StabSectNum: 0x0 ; CHECKSYM-NEXT: } diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-data-sections.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-data-sections.ll --- a/llvm/test/CodeGen/PowerPC/aix-xcoff-data-sections.ll +++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-data-sections.ll @@ -100,27 +100,27 @@ ; CHECKOBJ-EMPTY: ; CHECKOBJ-NEXT: Disassembly of section .data: ; CHECKOBJ-EMPTY: -; CHECKOBJ-NEXT: 00000048 (idx: 11) ivar[RW]: -; CHECKOBJ-NEXT: 48: 00 00 00 23 +; CHECKOBJ-NEXT: 00000048 (idx: 11) foo[DS]: +; CHECKOBJ-NEXT: 48: 00 00 00 00 +; CHECKOBJ-NEXT: 4c: 00 00 00 68 +; CHECKOBJ-NEXT: 50: 00 00 00 00 ; CHECKOBJ-EMPTY: -; CHECKOBJ-NEXT: 0000004c (idx: 13) p[RW]: -; CHECKOBJ-NEXT: 4c: 00 00 00 3c +; CHECKOBJ-NEXT: 00000054 (idx: 13) bar[DS]: +; CHECKOBJ-NEXT: 54: 00 00 00 10 +; CHECKOBJ-NEXT: 58: 00 00 00 68 +; CHECKOBJ-NEXT: 5c: 00 00 00 00 ; CHECKOBJ-EMPTY: -; CHECKOBJ-NEXT: 00000050 (idx: 15) foo[DS]: -; CHECKOBJ-NEXT: 50: 00 00 00 00 -; CHECKOBJ-NEXT: 54: 00 00 00 68 -; CHECKOBJ-NEXT: 58: 00 00 00 00 +; CHECKOBJ-NEXT: 00000060 (idx: 15) ivar[RW]: +; CHECKOBJ-NEXT: 60: 00 00 00 23 ; CHECKOBJ-EMPTY: -; CHECKOBJ-NEXT: 0000005c (idx: 17) bar[DS]: -; CHECKOBJ-NEXT: 5c: 00 00 00 10 -; CHECKOBJ-NEXT: 60: 00 00 00 68 -; CHECKOBJ-NEXT: 64: 00 00 00 00 +; CHECKOBJ-NEXT: 00000064 (idx: 17) p[RW]: +; CHECKOBJ-NEXT: 64: 00 00 00 3c ; CHECKOBJ-EMPTY: ; CHECKOBJ-NEXT: 00000068 (idx: 21) p[TC]: -; CHECKOBJ-NEXT: 68: 00 00 00 4c +; CHECKOBJ-NEXT: 68: 00 00 00 64 ; CHECKOBJ-EMPTY: ; CHECKOBJ-NEXT: 0000006c (idx: 23) ivar[TC]: -; CHECKOBJ-NEXT: 6c: 00 00 00 48 +; CHECKOBJ-NEXT: 6c: 00 00 00 60 ; CHECKOBJ-EMPTY: ; CHECKOBJ-NEXT: 00000070 (idx: 25) a[TC]: ; CHECKOBJ-NEXT: 70: 00 00 00 78 @@ -175,7 +175,7 @@ ; CHECKSYM: } ; CHECKSYM: Symbol { ; CHECKSYM: Name: ivar -; CHECKSYM: Value (RelocatableAddress): 0x48 +; CHECKSYM: Value (RelocatableAddress): 0x60 ; CHECKSYM: Section: .data ; CHECKSYM: Type: 0x0 ; CHECKSYM: StorageClass: C_EXT (0x2) @@ -193,7 +193,7 @@ ; CHECKSYM: } ; CHECKSYM: Symbol { ; CHECKSYM: Name: p -; CHECKSYM: Value (RelocatableAddress): 0x4C +; CHECKSYM: Value (RelocatableAddress): 0x64 ; CHECKSYM: Section: .data ; CHECKSYM: Type: 0x0 ; CHECKSYM: StorageClass: C_EXT (0x2) 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 @@ -62,22 +62,22 @@ ; CHECKOBJ-EMPTY: ; CHECKOBJ-NEXT: Disassembly of section .data: ; CHECKOBJ-EMPTY: -; CHECKOBJ-NEXT: 00000020 (idx: 13) ext_var: -; CHECKOBJ-NEXT: 20: 00 00 00 01 +; CHECKOBJ-NEXT: 00000020 (idx: 11) ext_fun[DS]: +; CHECKOBJ-NEXT: 20: 00 00 00 00 +; CHECKOBJ-NEXT: 24: 00 00 00 34 +; CHECKOBJ-NEXT: 28: 00 00 00 00 ; CHECKOBJ-EMPTY: -; CHECKOBJ-NEXT: 00000024 (idx: 17) ext_zvar: -; CHECKOBJ-NEXT: 24: 00 00 00 00 +; CHECKOBJ-NEXT: 0000002c (idx: 15) ext_var: +; CHECKOBJ-NEXT: 2c: 00 00 00 01 ; CHECKOBJ-EMPTY: -; CHECKOBJ-NEXT: 00000028 (idx: 19) ext_fun[DS]: -; CHECKOBJ-NEXT: 28: 00 00 00 00 -; CHECKOBJ-NEXT: 2c: 00 00 00 34 +; CHECKOBJ-NEXT: 00000030 (idx: 19) ext_zvar: ; CHECKOBJ-NEXT: 30: 00 00 00 00 ; CHECKOBJ-EMPTY: ; CHECKOBJ-NEXT: 00000034 (idx: 23) ext_var[TC]: -; CHECKOBJ-NEXT: 34: 00 00 00 20 +; CHECKOBJ-NEXT: 34: 00 00 00 2c ; CHECKOBJ-EMPTY: ; CHECKOBJ-NEXT: 00000038 (idx: 25) ext_zvar[TC]: -; CHECKOBJ-NEXT: 38: 00 00 00 24 +; CHECKOBJ-NEXT: 38: 00 00 00 30 ; CHECKSYM: Symbol {{[{][[:space:]] *}}Index: [[#INDX:]]{{[[:space:]] *}}Name: .ext_fun_sec ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x0 @@ -159,39 +159,39 @@ ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: Symbol { ; CHECKSYM-NEXT: Index: [[#INDX+8]] -; CHECKSYM-NEXT: Name: .ext_var_sec +; CHECKSYM-NEXT: Name: ext_fun ; CHECKSYM-NEXT: Value (RelocatableAddress): 0x20 ; CHECKSYM-NEXT: Section: .data ; CHECKSYM-NEXT: Type: 0x0 -; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B) +; CHECKSYM-NEXT: StorageClass: C_EXT (0x2) ; CHECKSYM-NEXT: NumberOfAuxEntries: 1 ; CHECKSYM-NEXT: CSECT Auxiliary Entry { ; CHECKSYM-NEXT: Index: [[#INDX+9]] -; CHECKSYM-NEXT: SectionLen: 4 +; CHECKSYM-NEXT: SectionLen: 12 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0 ; CHECKSYM-NEXT: SymbolAlignmentLog2: 2 ; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1) -; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5) +; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA) ; CHECKSYM-NEXT: StabInfoIndex: 0x0 ; CHECKSYM-NEXT: StabSectNum: 0x0 ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: Symbol { ; CHECKSYM-NEXT: Index: [[#INDX+10]] -; CHECKSYM-NEXT: Name: ext_var -; CHECKSYM-NEXT: Value (RelocatableAddress): 0x20 +; CHECKSYM-NEXT: Name: .ext_var_sec +; CHECKSYM-NEXT: Value (RelocatableAddress): 0x2C ; CHECKSYM-NEXT: Section: .data ; CHECKSYM-NEXT: Type: 0x0 -; CHECKSYM-NEXT: StorageClass: C_EXT (0x2) +; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B) ; CHECKSYM-NEXT: NumberOfAuxEntries: 1 ; CHECKSYM-NEXT: CSECT Auxiliary Entry { ; CHECKSYM-NEXT: Index: [[#INDX+11]] -; CHECKSYM-NEXT: ContainingCsectSymbolIndex: [[#INDX+8]] +; CHECKSYM-NEXT: SectionLen: 4 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0 -; CHECKSYM-NEXT: SymbolAlignmentLog2: 0 -; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2) +; CHECKSYM-NEXT: SymbolAlignmentLog2: 2 +; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1) ; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5) ; CHECKSYM-NEXT: StabInfoIndex: 0x0 ; CHECKSYM-NEXT: StabSectNum: 0x0 @@ -199,19 +199,19 @@ ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: Symbol { ; CHECKSYM-NEXT: Index: [[#INDX+12]] -; CHECKSYM-NEXT: Name: .ext_zvar_sec -; CHECKSYM-NEXT: Value (RelocatableAddress): 0x24 +; CHECKSYM-NEXT: Name: ext_var +; CHECKSYM-NEXT: Value (RelocatableAddress): 0x2C ; CHECKSYM-NEXT: Section: .data ; CHECKSYM-NEXT: Type: 0x0 -; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B) +; CHECKSYM-NEXT: StorageClass: C_EXT (0x2) ; CHECKSYM-NEXT: NumberOfAuxEntries: 1 ; CHECKSYM-NEXT: CSECT Auxiliary Entry { ; CHECKSYM-NEXT: Index: [[#INDX+13]] -; CHECKSYM-NEXT: SectionLen: 4 +; CHECKSYM-NEXT: ContainingCsectSymbolIndex: [[#INDX+10]] ; CHECKSYM-NEXT: ParameterHashIndex: 0x0 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0 -; CHECKSYM-NEXT: SymbolAlignmentLog2: 2 -; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1) +; CHECKSYM-NEXT: SymbolAlignmentLog2: 0 +; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2) ; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5) ; CHECKSYM-NEXT: StabInfoIndex: 0x0 ; CHECKSYM-NEXT: StabSectNum: 0x0 @@ -219,19 +219,19 @@ ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: Symbol { ; CHECKSYM-NEXT: Index: [[#INDX+14]] -; CHECKSYM-NEXT: Name: ext_zvar -; CHECKSYM-NEXT: Value (RelocatableAddress): 0x24 +; CHECKSYM-NEXT: Name: .ext_zvar_sec +; CHECKSYM-NEXT: Value (RelocatableAddress): 0x30 ; CHECKSYM-NEXT: Section: .data ; CHECKSYM-NEXT: Type: 0x0 -; CHECKSYM-NEXT: StorageClass: C_EXT (0x2) +; CHECKSYM-NEXT: StorageClass: C_HIDEXT (0x6B) ; CHECKSYM-NEXT: NumberOfAuxEntries: 1 ; CHECKSYM-NEXT: CSECT Auxiliary Entry { ; CHECKSYM-NEXT: Index: [[#INDX+15]] -; CHECKSYM-NEXT: ContainingCsectSymbolIndex: [[#INDX+12]] +; CHECKSYM-NEXT: SectionLen: 4 ; CHECKSYM-NEXT: ParameterHashIndex: 0x0 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0 -; CHECKSYM-NEXT: SymbolAlignmentLog2: 0 -; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2) +; CHECKSYM-NEXT: SymbolAlignmentLog2: 2 +; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1) ; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5) ; CHECKSYM-NEXT: StabInfoIndex: 0x0 ; CHECKSYM-NEXT: StabSectNum: 0x0 @@ -239,20 +239,20 @@ ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: Symbol { ; CHECKSYM-NEXT: Index: [[#INDX+16]] -; CHECKSYM-NEXT: Name: ext_fun -; CHECKSYM-NEXT: Value (RelocatableAddress): 0x28 +; CHECKSYM-NEXT: Name: ext_zvar +; CHECKSYM-NEXT: Value (RelocatableAddress): 0x30 ; CHECKSYM-NEXT: Section: .data ; CHECKSYM-NEXT: Type: 0x0 ; CHECKSYM-NEXT: StorageClass: C_EXT (0x2) ; CHECKSYM-NEXT: NumberOfAuxEntries: 1 ; CHECKSYM-NEXT: CSECT Auxiliary Entry { ; CHECKSYM-NEXT: Index: [[#INDX+17]] -; CHECKSYM-NEXT: SectionLen: 12 +; CHECKSYM-NEXT: ContainingCsectSymbolIndex: [[#INDX+14]] ; CHECKSYM-NEXT: ParameterHashIndex: 0x0 ; CHECKSYM-NEXT: TypeChkSectNum: 0x0 -; CHECKSYM-NEXT: SymbolAlignmentLog2: 2 -; CHECKSYM-NEXT: SymbolType: XTY_SD (0x1) -; CHECKSYM-NEXT: StorageMappingClass: XMC_DS (0xA) +; CHECKSYM-NEXT: SymbolAlignmentLog2: 0 +; CHECKSYM-NEXT: SymbolType: XTY_LD (0x2) +; CHECKSYM-NEXT: StorageMappingClass: XMC_RW (0x5) ; CHECKSYM-NEXT: StabInfoIndex: 0x0 ; CHECKSYM-NEXT: StabSectNum: 0x0 ; CHECKSYM-NEXT: } diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-lower-comm.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-lower-comm.ll --- a/llvm/test/CodeGen/PowerPC/aix-xcoff-lower-comm.ll +++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-lower-comm.ll @@ -29,7 +29,7 @@ ; RELOC: Relocations [ ; RELOC-NEXT: Section (index: {{[0-9]+}}) .data { ; RELOC-NEXT: Relocation { -; RELOC-NEXT: Virtual Address: 0x0 +; RELOC-NEXT: Virtual Address: 0x4 ; RELOC-NEXT: Symbol: common ([[#COM_INDX:]]) ; RELOC-NEXT: IsSigned: No ; RELOC-NEXT: FixupBitValue: 0 @@ -39,59 +39,57 @@ ; RELOC-NEXT: } ; RELOC-NEXT: ] -; SYM: Symbol {{[{][[:space:]] *}}Index: [[#INDX:]]{{[[:space:]] *}}Name: .data +; SYM: Symbol {{[{][[:space:]] *}}Index: [[#COM_INDX:]]{{[[:space:]] *}}Name: common ; SYM-NEXT: Value (RelocatableAddress): 0x0 -; SYM-NEXT: Section: .data +; SYM-NEXT: Section: .bss ; SYM-NEXT: Type: 0x0 -; SYM-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYM-NEXT: StorageClass: C_EXT (0x2) ; SYM-NEXT: NumberOfAuxEntries: 1 ; SYM-NEXT: CSECT Auxiliary Entry { -; SYM-NEXT: Index: [[#INDX+1]] +; SYM-NEXT: Index: [[#COM_INDX+1]] ; SYM-NEXT: SectionLen: 4 ; SYM-NEXT: ParameterHashIndex: 0x0 ; SYM-NEXT: TypeChkSectNum: 0x0 ; SYM-NEXT: SymbolAlignmentLog2: 2 -; SYM-NEXT: SymbolType: XTY_SD (0x1) +; SYM-NEXT: SymbolType: XTY_CM (0x3) ; SYM-NEXT: StorageMappingClass: XMC_RW (0x5) ; SYM-NEXT: StabInfoIndex: 0x0 ; SYM-NEXT: StabSectNum: 0x0 ; SYM-NEXT: } ; SYM-NEXT: } -; SYM-NEXT: Symbol { -; SYM-NEXT: Index: [[#INDX+2]] -; SYM-NEXT: Name: pointer -; SYM-NEXT: Value (RelocatableAddress): 0x0 +; SYM-NEXT: Symbol {{[{][[:space:]] *}}Index: [[#INDX:]]{{[[:space:]] *}}Name: .data +; SYM-NEXT: Value (RelocatableAddress): 0x4 ; SYM-NEXT: Section: .data ; SYM-NEXT: Type: 0x0 -; SYM-NEXT: StorageClass: C_EXT (0x2) +; SYM-NEXT: StorageClass: C_HIDEXT (0x6B) ; SYM-NEXT: NumberOfAuxEntries: 1 ; SYM-NEXT: CSECT Auxiliary Entry { -; SYM-NEXT: Index: [[#INDX+3]] -; SYM-NEXT: ContainingCsectSymbolIndex: [[#INDX]] +; SYM-NEXT: Index: [[#INDX+1]] +; SYM-NEXT: SectionLen: 4 ; SYM-NEXT: ParameterHashIndex: 0x0 ; SYM-NEXT: TypeChkSectNum: 0x0 -; SYM-NEXT: SymbolAlignmentLog2: 0 -; SYM-NEXT: SymbolType: XTY_LD (0x2) +; SYM-NEXT: SymbolAlignmentLog2: 2 +; SYM-NEXT: SymbolType: XTY_SD (0x1) ; SYM-NEXT: StorageMappingClass: XMC_RW (0x5) ; SYM-NEXT: StabInfoIndex: 0x0 ; SYM-NEXT: StabSectNum: 0x0 ; SYM-NEXT: } ; SYM-NEXT: } ; SYM-NEXT: Symbol { -; SYM-NEXT: Index: [[#COM_INDX]] -; SYM-NEXT: Name: common +; SYM-NEXT: Index: [[#INDX+2]] +; SYM-NEXT: Name: pointer ; SYM-NEXT: Value (RelocatableAddress): 0x4 -; SYM-NEXT: Section: .bss +; SYM-NEXT: Section: .data ; SYM-NEXT: Type: 0x0 ; SYM-NEXT: StorageClass: C_EXT (0x2) ; SYM-NEXT: NumberOfAuxEntries: 1 ; SYM-NEXT: CSECT Auxiliary Entry { -; SYM-NEXT: Index: [[#COM_INDX+1]] -; SYM-NEXT: SectionLen: 4 +; SYM-NEXT: Index: [[#INDX+3]] +; SYM-NEXT: ContainingCsectSymbolIndex: [[#INDX]] ; SYM-NEXT: ParameterHashIndex: 0x0 ; SYM-NEXT: TypeChkSectNum: 0x0 -; SYM-NEXT: SymbolAlignmentLog2: 2 -; SYM-NEXT: SymbolType: XTY_CM (0x3) +; SYM-NEXT: SymbolAlignmentLog2: 0 +; SYM-NEXT: SymbolType: XTY_LD (0x2) ; SYM-NEXT: StorageMappingClass: XMC_RW (0x5) ; SYM-NEXT: StabInfoIndex: 0x0 ; SYM-NEXT: StabSectNum: 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 @@ -104,24 +104,24 @@ ; RELOC-NEXT: } ; RELOC-NEXT: Section (index: 2) .data { ; RELOC-NEXT: Relocation { -; RELOC-NEXT: Virtual Address: 0x70 -; RELOC-NEXT: Symbol: arr (15) +; RELOC-NEXT: Virtual Address: 0x40 +; RELOC-NEXT: Symbol: .foo (7) ; RELOC-NEXT: IsSigned: No ; RELOC-NEXT: FixupBitValue: 0 ; RELOC-NEXT: Length: 32 ; RELOC-NEXT: Type: R_POS (0x0) ; RELOC-NEXT: } ; RELOC-NEXT: Relocation { -; RELOC-NEXT: Virtual Address: 0x74 -; RELOC-NEXT: Symbol: .foo (7) +; RELOC-NEXT: Virtual Address: 0x44 +; RELOC-NEXT: Symbol: TOC (21) ; RELOC-NEXT: IsSigned: No ; RELOC-NEXT: FixupBitValue: 0 ; RELOC-NEXT: Length: 32 ; RELOC-NEXT: Type: R_POS (0x0) ; RELOC-NEXT: } ; RELOC-NEXT: Relocation { -; RELOC-NEXT: Virtual Address: 0x78 -; RELOC-NEXT: Symbol: TOC (21) +; RELOC-NEXT: Virtual Address: 0x7C +; RELOC-NEXT: Symbol: arr (17) ; RELOC-NEXT: IsSigned: No ; RELOC-NEXT: FixupBitValue: 0 ; RELOC-NEXT: Length: 32 @@ -129,7 +129,7 @@ ; RELOC-NEXT: } ; RELOC-NEXT: Relocation { ; RELOC-NEXT: Virtual Address: 0x80 -; RELOC-NEXT: Symbol: globalA (11) +; RELOC-NEXT: Symbol: globalA (13) ; RELOC-NEXT: IsSigned: No ; RELOC-NEXT: FixupBitValue: 0 ; RELOC-NEXT: Length: 32 @@ -137,7 +137,7 @@ ; RELOC-NEXT: } ; RELOC-NEXT: Relocation { ; RELOC-NEXT: Virtual Address: 0x84 -; RELOC-NEXT: Symbol: globalB (13) +; RELOC-NEXT: Symbol: globalB (15) ; RELOC-NEXT: IsSigned: No ; RELOC-NEXT: FixupBitValue: 0 ; RELOC-NEXT: Length: 32 @@ -239,39 +239,39 @@ ; SYM-NEXT: } ; SYM-NEXT: Symbol { ; SYM-NEXT: Index: [[#INDX+8]] -; SYM-NEXT: Name: .data +; SYM-NEXT: Name: foo ; SYM-NEXT: Value (RelocatableAddress): 0x40 ; SYM-NEXT: Section: .data ; SYM-NEXT: Type: 0x0 -; SYM-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYM-NEXT: StorageClass: C_EXT (0x2) ; SYM-NEXT: NumberOfAuxEntries: 1 ; SYM-NEXT: CSECT Auxiliary Entry { ; SYM-NEXT: Index: [[#INDX+9]] -; SYM-NEXT: SectionLen: 52 +; SYM-NEXT: SectionLen: 12 ; SYM-NEXT: ParameterHashIndex: 0x0 ; SYM-NEXT: TypeChkSectNum: 0x0 ; SYM-NEXT: SymbolAlignmentLog2: 2 ; SYM-NEXT: SymbolType: XTY_SD (0x1) -; SYM-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYM-NEXT: StorageMappingClass: XMC_DS (0xA) ; SYM-NEXT: StabInfoIndex: 0x0 ; SYM-NEXT: StabSectNum: 0x0 ; SYM-NEXT: } ; SYM-NEXT: } ; SYM-NEXT: Symbol { ; SYM-NEXT: Index: [[#INDX+10]] -; SYM-NEXT: Name: globalA -; SYM-NEXT: Value (RelocatableAddress): 0x40 +; SYM-NEXT: Name: .data +; SYM-NEXT: Value (RelocatableAddress): 0x4C ; SYM-NEXT: Section: .data ; SYM-NEXT: Type: 0x0 -; SYM-NEXT: StorageClass: C_EXT (0x2) +; SYM-NEXT: StorageClass: C_HIDEXT (0x6B) ; SYM-NEXT: NumberOfAuxEntries: 1 ; SYM-NEXT: CSECT Auxiliary Entry { ; SYM-NEXT: Index: [[#INDX+11]] -; SYM-NEXT: ContainingCsectSymbolIndex: [[#INDX+8]] +; SYM-NEXT: SectionLen: 52 ; SYM-NEXT: ParameterHashIndex: 0x0 ; SYM-NEXT: TypeChkSectNum: 0x0 -; SYM-NEXT: SymbolAlignmentLog2: 0 -; SYM-NEXT: SymbolType: XTY_LD (0x2) +; SYM-NEXT: SymbolAlignmentLog2: 2 +; SYM-NEXT: SymbolType: XTY_SD (0x1) ; SYM-NEXT: StorageMappingClass: XMC_RW (0x5) ; SYM-NEXT: StabInfoIndex: 0x0 ; SYM-NEXT: StabSectNum: 0x0 @@ -279,15 +279,15 @@ ; SYM-NEXT: } ; SYM-NEXT: Symbol { ; SYM-NEXT: Index: [[#INDX+12]] -; SYM-NEXT: Name: globalB -; SYM-NEXT: Value (RelocatableAddress): 0x44 +; SYM-NEXT: Name: globalA +; SYM-NEXT: Value (RelocatableAddress): 0x4C ; SYM-NEXT: Section: .data ; SYM-NEXT: Type: 0x0 ; SYM-NEXT: StorageClass: C_EXT (0x2) ; SYM-NEXT: NumberOfAuxEntries: 1 ; SYM-NEXT: CSECT Auxiliary Entry { ; SYM-NEXT: Index: [[#INDX+13]] -; SYM-NEXT: ContainingCsectSymbolIndex: [[#INDX+8]] +; SYM-NEXT: ContainingCsectSymbolIndex: [[#INDX+10]] ; SYM-NEXT: ParameterHashIndex: 0x0 ; SYM-NEXT: TypeChkSectNum: 0x0 ; SYM-NEXT: SymbolAlignmentLog2: 0 @@ -299,15 +299,15 @@ ; SYM-NEXT: } ; SYM-NEXT: Symbol { ; SYM-NEXT: Index: [[#INDX+14]] -; SYM-NEXT: Name: arr -; SYM-NEXT: Value (RelocatableAddress): 0x48 +; SYM-NEXT: Name: globalB +; SYM-NEXT: Value (RelocatableAddress): 0x50 ; SYM-NEXT: Section: .data ; SYM-NEXT: Type: 0x0 ; SYM-NEXT: StorageClass: C_EXT (0x2) ; SYM-NEXT: NumberOfAuxEntries: 1 ; SYM-NEXT: CSECT Auxiliary Entry { ; SYM-NEXT: Index: [[#INDX+15]] -; SYM-NEXT: ContainingCsectSymbolIndex: [[#INDX+8]] +; SYM-NEXT: ContainingCsectSymbolIndex: [[#INDX+10]] ; SYM-NEXT: ParameterHashIndex: 0x0 ; SYM-NEXT: TypeChkSectNum: 0x0 ; SYM-NEXT: SymbolAlignmentLog2: 0 @@ -319,15 +319,15 @@ ; SYM-NEXT: } ; SYM-NEXT: Symbol { ; SYM-NEXT: Index: [[#INDX+16]] -; SYM-NEXT: Name: p -; SYM-NEXT: Value (RelocatableAddress): 0x70 +; SYM-NEXT: Name: arr +; SYM-NEXT: Value (RelocatableAddress): 0x54 ; SYM-NEXT: Section: .data ; SYM-NEXT: Type: 0x0 ; SYM-NEXT: StorageClass: C_EXT (0x2) ; SYM-NEXT: NumberOfAuxEntries: 1 ; SYM-NEXT: CSECT Auxiliary Entry { ; SYM-NEXT: Index: [[#INDX+17]] -; SYM-NEXT: ContainingCsectSymbolIndex: [[#INDX+8]] +; SYM-NEXT: ContainingCsectSymbolIndex: [[#INDX+10]] ; SYM-NEXT: ParameterHashIndex: 0x0 ; SYM-NEXT: TypeChkSectNum: 0x0 ; SYM-NEXT: SymbolAlignmentLog2: 0 @@ -339,20 +339,20 @@ ; SYM-NEXT: } ; SYM-NEXT: Symbol { ; SYM-NEXT: Index: [[#INDX+18]] -; SYM-NEXT: Name: foo -; SYM-NEXT: Value (RelocatableAddress): 0x74 +; SYM-NEXT: Name: p +; SYM-NEXT: Value (RelocatableAddress): 0x7C ; SYM-NEXT: Section: .data ; SYM-NEXT: Type: 0x0 ; SYM-NEXT: StorageClass: C_EXT (0x2) ; SYM-NEXT: NumberOfAuxEntries: 1 ; SYM-NEXT: CSECT Auxiliary Entry { ; SYM-NEXT: Index: [[#INDX+19]] -; SYM-NEXT: SectionLen: 12 +; SYM-NEXT: ContainingCsectSymbolIndex: [[#INDX+10]] ; SYM-NEXT: ParameterHashIndex: 0x0 ; SYM-NEXT: TypeChkSectNum: 0x0 -; SYM-NEXT: SymbolAlignmentLog2: 2 -; SYM-NEXT: SymbolType: XTY_SD (0x1) -; SYM-NEXT: StorageMappingClass: XMC_DS (0xA) +; SYM-NEXT: SymbolAlignmentLog2: 0 +; SYM-NEXT: SymbolType: XTY_LD (0x2) +; SYM-NEXT: StorageMappingClass: XMC_RW (0x5) ; SYM-NEXT: StabInfoIndex: 0x0 ; SYM-NEXT: StabSectNum: 0x0 ; SYM-NEXT: } @@ -441,23 +441,23 @@ ; DIS-NEXT: 3c: 4e 80 00 20 blr ; DIS: Disassembly of section .data: -; DIS: 00000040 : -; DIS-NEXT: 40: 00 00 00 01 -; DIS: 00000044 : -; DIS-NEXT: 44: 00 00 00 02 -; DIS: 00000048 : -; DIS-NEXT: 48: 00 00 00 03 +; DIS: 00000040 : +; DIS-NEXT: 40: 00 00 00 00 +; DIS-NEXT: 44: 00 00 00 80 +; DIS-NEXT: 48: 00 00 00 00 +; DIS: 0000004c : +; DIS-NEXT: 4c: 00 00 00 01 +; DIS: 00000050 : +; DIS-NEXT: 50: 00 00 00 02 +; DIS: 00000054 : +; DIS-NEXT: 54: 00 00 00 03 ; DIS-NEXT: ... -; DIS: 00000070

: -; DIS-NEXT: 70: 00 00 00 58 -; DIS: 00000074 : -; DIS-NEXT: 74: 00 00 00 00 -; DIS-NEXT: 78: 00 00 00 80 -; DIS-NEXT: 7c: 00 00 00 00 +; DIS: 0000007c

: +; DIS-NEXT: 7c: 00 00 00 64 ; DIS: 00000080 : -; DIS-NEXT: 80: 00 00 00 40 +; DIS-NEXT: 80: 00 00 00 4c ; DIS: 00000084 : -; DIS-NEXT: 84: 00 00 00 44 +; DIS-NEXT: 84: 00 00 00 50 ; DIS_REL: {{.*}}aix-xcoff-reloc.ll.tmp.o: file format aixcoff-rs6000 ; DIS_REL: RELOCATION RECORDS FOR [.text]: @@ -467,8 +467,8 @@ ; DIS_REL-NEXT: 0000001e R_TOC globalB ; DIS_REL: RELOCATION RECORDS FOR [.data]: ; DIS_REL-NEXT: OFFSET TYPE VALUE -; DIS_REL-NEXT: 00000030 R_POS arr -; DIS_REL-NEXT: 00000034 R_POS .foo -; DIS_REL-NEXT: 00000038 R_POS TOC +; DIS_REL-NEXT: 00000000 R_POS .foo +; DIS_REL-NEXT: 00000004 R_POS TOC +; DIS_REL-NEXT: 0000003c R_POS arr ; DIS_REL-NEXT: 00000040 R_POS globalA ; DIS_REL-NEXT: 00000044 R_POS globalB 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 @@ -142,29 +142,29 @@ ; OBJ-EMPTY: ; OBJ-NEXT: Disassembly of section .data: ; OBJ-EMPTY: -; OBJ-NEXT: 00000068 (idx: 15) f`o: -; OBJ-NEXT: 68: 00 00 00 0a +; OBJ-NEXT: 00000068 (idx: 13) f$o[DS]: +; OBJ-NEXT: 68: 00 00 00 00 +; OBJ-NEXT: 00000068: R_POS (idx: 7) .f$o +; OBJ-NEXT: 6c: 00 00 00 90 +; OBJ-NEXT: 0000006c: R_POS (idx: 23) TOC[TC0] +; OBJ-NEXT: 70: 00 00 00 00 ; OBJ-EMPTY: -; OBJ-NEXT: 0000006c (idx: 17) f$o[DS]: -; OBJ-NEXT: 6c: 00 00 00 00 -; OBJ-NEXT: 0000006c: R_POS (idx: 7) .f$o -; OBJ-NEXT: 70: 00 00 00 90 -; OBJ-NEXT: 00000070: R_POS (idx: 23) TOC[TC0] -; OBJ-NEXT: 74: 00 00 00 00 +; OBJ-NEXT: 00000074 (idx: 15) f&o[DS]: +; OBJ-NEXT: 74: 00 00 00 30 +; OBJ-NEXT: 00000074: R_POS (idx: 9) .f&o +; OBJ-NEXT: 78: 00 00 00 90 +; OBJ-NEXT: 00000078: R_POS (idx: 23) TOC[TC0] +; OBJ-NEXT: 7c: 00 00 00 00 ; OBJ-EMPTY: -; OBJ-NEXT: 00000078 (idx: 19) f&o[DS]: -; OBJ-NEXT: 78: 00 00 00 30 -; OBJ-NEXT: 00000078: R_POS (idx: 9) .f&o -; OBJ-NEXT: 7c: 00 00 00 90 -; OBJ-NEXT: 0000007c: R_POS (idx: 23) TOC[TC0] -; OBJ-NEXT: 80: 00 00 00 00 +; OBJ-NEXT: 00000080 (idx: 17) f&_o[DS]: +; OBJ-NEXT: 80: 00 00 00 60 +; OBJ-NEXT: 00000080: R_POS (idx: 11) .f&_o +; OBJ-NEXT: 84: 00 00 00 90 +; OBJ-NEXT: 00000084: R_POS (idx: 23) TOC[TC0] +; OBJ-NEXT: 88: 00 00 00 00 ; OBJ-EMPTY: -; OBJ-NEXT: 00000084 (idx: 21) f&_o[DS]: -; OBJ-NEXT: 84: 00 00 00 60 -; OBJ-NEXT: 00000084: R_POS (idx: 11) .f&_o -; OBJ-NEXT: 88: 00 00 00 90 -; OBJ-NEXT: 00000088: R_POS (idx: 23) TOC[TC0] -; OBJ-NEXT: 8c: 00 00 00 00 +; OBJ-NEXT: 0000008c (idx: 21) f`o: +; OBJ-NEXT: 8c: 00 00 00 0a ; OBJ-EMPTY: ; OBJ-NEXT: 00000090 (idx: 25) f=o[TC]: ; OBJ-NEXT: 90: 00 00 00 9c