diff --git a/llvm/include/llvm/BinaryFormat/XCOFF.h b/llvm/include/llvm/BinaryFormat/XCOFF.h --- a/llvm/include/llvm/BinaryFormat/XCOFF.h +++ b/llvm/include/llvm/BinaryFormat/XCOFF.h @@ -28,6 +28,7 @@ constexpr size_t NameSize = 8; constexpr size_t SymbolTableEntrySize = 18; constexpr size_t RelocationSerializationSize32 = 10; +constexpr size_t RelocationSerializationSize64 = 14; constexpr uint16_t RelocOverflow = 65535; constexpr uint8_t AllocRegNo = 31; @@ -276,6 +277,30 @@ int32_t Flags; }; +struct FileHeader64 { + uint16_t Magic; + uint16_t NumberOfSections; + int32_t TimeStamp; + uint64_t SymbolTableFileOffset; + uint16_t AuxiliaryHeaderSize; + uint16_t Flags; + int32_t NumberOfSymbolTableEntries; +}; + +struct SectionHeader64 { + char Name[XCOFF::NameSize]; + uint64_t PhysicalAddress; + uint64_t VirtualAddress; + uint64_t Size; + uint64_t FileOffsetToData; + uint64_t FileOffsetToRelocations; + uint64_t FileOffsetToLineNumbers; + uint32_t NumberOfRelocations; + uint32_t NumberOfLineNumbers; + int32_t Flags; + char Padding[4]; +}; + enum CFileStringType : uint8_t { XFT_FN = 0, ///< Specifies the source-file name. XFT_CT = 1, ///< Specifies the compiler time stamp. diff --git a/llvm/include/llvm/Object/XCOFFObjectFile.h b/llvm/include/llvm/Object/XCOFFObjectFile.h --- a/llvm/include/llvm/Object/XCOFFObjectFile.h +++ b/llvm/include/llvm/Object/XCOFFObjectFile.h @@ -260,6 +260,38 @@ uint8_t getRelocatedLength() const; }; +struct XCOFFRelocation64 { + // Masks for packing/unpacking the r_rsize field of relocations. + + // The msb is used to indicate if the bits being relocated are signed or + // unsigned. + static constexpr uint8_t XR_SIGN_INDICATOR_MASK = 0x80; + + // The 2nd msb is used to indicate that the binder has replaced/modified the + // original instruction. + static constexpr uint8_t XR_FIXUP_INDICATOR_MASK = 0x40; + + // The remaining bits specify the bit length of the relocatable reference + // minus one. + static constexpr uint8_t XR_BIASED_LENGTH_MASK = 0x3f; + +public: + support::ubig64_t VirtualAddress; + support::ubig32_t SymbolIndex; + + // Packed field, see XR_* masks for details of packing. + uint8_t Info; + + XCOFF::RelocationType Type; + +public: + bool isRelocationSigned() const; + bool isFixupIndicated() const; + + // Returns the number of bits being relocated. + uint8_t getRelocatedLength() const; +}; + class XCOFFSymbolRef; class XCOFFObjectFile : public ObjectFile { @@ -415,11 +447,16 @@ // Relocation-related interfaces. Expected - getLogicalNumberOfRelocationEntries(const XCOFFSectionHeader32 &Sec) const; + getLogicalNumberOfRelocationEntries32(const XCOFFSectionHeader32 &Sec) const; + + uint32_t + getNumberOfRelocationEntries64(const XCOFFSectionHeader64 &Sec) const; Expected> - relocations(const XCOFFSectionHeader32 &) const; + relocations32(const XCOFFSectionHeader32 &) const; + Expected> + relocations64(const XCOFFSectionHeader64 &) const; // This function returns string table entry. Expected getStringTableEntry(uint32_t Offset) 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 @@ -55,7 +55,7 @@ struct XCOFFRelocation { uint32_t SymbolTableIndex; - uint32_t FixupOffsetInCsect; + uint64_t FixupOffsetInCsect; uint8_t SignAndSize; uint8_t Type; }; @@ -76,8 +76,8 @@ struct ControlSection { const MCSectionXCOFF *const MCCsect; uint32_t SymbolTableIndex; - uint32_t Address; - uint32_t Size; + uint64_t Address; + uint64_t Size; SmallVector Syms; SmallVector Relocations; @@ -102,10 +102,10 @@ char Name[XCOFF::NameSize]; // The physical/virtual address of the section. For an object file // these values are equivalent. - uint32_t Address; - uint32_t Size; - uint32_t FileOffsetToData; - uint32_t FileOffsetToRelocations; + uint64_t Address; + uint64_t Size; + uint64_t FileOffsetToData; + uint64_t FileOffsetToRelocations; uint32_t RelocationCount; int32_t Flags; @@ -151,7 +151,7 @@ class XCOFFObjectWriter : public MCObjectWriter { uint32_t SymbolTableEntryCount = 0; - uint32_t SymbolTableOffset = 0; + uint64_t SymbolTableOffset = 0; uint16_t SectionCount = 0; uint32_t RelocationEntryOffset = 0; @@ -203,7 +203,7 @@ uint64_t writeObject(MCAssembler &, const MCAsmLayout &) override; - static bool nameShouldBeInStringTable(const StringRef &); + bool nameShouldBeInStringTable(const StringRef &); void writeSymbolName(const StringRef &); void writeSymbolTableEntryForCsectMemberLabel(const Symbol &, const ControlSection &, int16_t, @@ -344,8 +344,10 @@ void XCOFFObjectWriter::executePostLayoutBinding(MCAssembler &Asm, const MCAsmLayout &Layout) { + // TODO + // Add ".file" in the StringTableBuilder implicitly for XCOFF64 if (TargetObjectWriter->is64Bit()) - report_fatal_error("64-bit XCOFF object files are not supported yet."); + Strings.add(".file"); for (const auto &S : Asm) { const auto *MCSec = cast(&S); @@ -475,7 +477,7 @@ (TargetObjectWriter->is64Bit() || Fixup.getOffset() <= UINT32_MAX - Layout.getFragmentOffset(Fragment)) && "Fragment offset + fixup offset is overflowed in 32-bit mode."); - uint32_t FixupOffsetInCsect = + uint64_t FixupOffsetInCsect = Layout.getFragmentOffset(Fragment) + Fixup.getOffset(); XCOFFRelocation Reloc = {Index, FixupOffsetInCsect, SignAndSize, Type}; @@ -514,7 +516,7 @@ void XCOFFObjectWriter::writeSections(const MCAssembler &Asm, const MCAsmLayout &Layout) { - uint32_t CurrentAddressLocation = 0; + uint64_t CurrentAddressLocation = 0; for (const auto *Section : Sections) { // Nothing to write for this Section. if (Section->Index == Section::UninitializedIndex || Section->IsVirtual) @@ -559,9 +561,6 @@ if (Asm.isIncrementalLinkerCompatible()) report_fatal_error("Incremental linking not supported for XCOFF."); - if (TargetObjectWriter->is64Bit()) - report_fatal_error("64-bit XCOFF object files are not supported yet."); - finalizeSectionInfo(); uint64_t StartOffset = W.OS.tell(); @@ -578,29 +577,41 @@ } bool XCOFFObjectWriter::nameShouldBeInStringTable(const StringRef &SymbolName) { - return SymbolName.size() > XCOFF::NameSize; + return (SymbolName.size() > XCOFF::NameSize) || TargetObjectWriter->is64Bit(); } void XCOFFObjectWriter::writeSymbolName(const StringRef &SymbolName) { - if (nameShouldBeInStringTable(SymbolName)) { - W.write(0); + if (TargetObjectWriter->is64Bit()) { W.write(Strings.getOffset(SymbolName)); } else { - char Name[XCOFF::NameSize+1]; - std::strncpy(Name, SymbolName.data(), XCOFF::NameSize); - ArrayRef NameRef(Name, XCOFF::NameSize); - W.write(NameRef); + if (nameShouldBeInStringTable(SymbolName)) { + W.write(0); + W.write(Strings.getOffset(SymbolName)); + } else { + char Name[XCOFF::NameSize+1]; + std::strncpy(Name, SymbolName.data(), XCOFF::NameSize); + ArrayRef NameRef(Name, XCOFF::NameSize); + W.write(NameRef); + } } } void XCOFFObjectWriter::writeSymbolTableEntryForCsectMemberLabel( const Symbol &SymbolRef, const ControlSection &CSectionRef, int16_t SectionIndex, uint64_t SymbolOffset) { - // Name or Zeros and string table offset + if (TargetObjectWriter->is64Bit()) { + // Symbole value 64 bits + W.write(CSectionRef.Address + SymbolOffset); + } + // Name or Zeros and string table offset on 32 bits + // String table offset on 64 bits writeSymbolName(SymbolRef.getSymbolTableName()); - assert(SymbolOffset <= UINT32_MAX - CSectionRef.Address && + if (!TargetObjectWriter->is64Bit()) { + assert(SymbolOffset <= UINT32_MAX - CSectionRef.Address && "Symbol address overflows."); - W.write(CSectionRef.Address + SymbolOffset); + // Symbole value 32 bits + W.write(CSectionRef.Address + SymbolOffset); + } W.write(SectionIndex); // Basic/Derived type. See the description of the n_type field for symbol // table entries for a detailed description. Since we don't yet support @@ -615,7 +626,12 @@ W.write(1); // Now output the auxiliary entry. - W.write(CSectionRef.SymbolTableIndex); + if (TargetObjectWriter->is64Bit()) { + // Low 4 bytes lenght only on 64 bits + W.write( (uint32_t) (CSectionRef.SymbolTableIndex & 0xFFFFFFFF) ); + } else { + W.write(CSectionRef.SymbolTableIndex); + } // Parameter typecheck hash. Not supported. W.write(0); // Typecheck section number. Not supported. @@ -624,19 +640,35 @@ W.write(XCOFF::XTY_LD); // Storage mapping class. W.write(CSectionRef.MCCsect->getMappingClass()); - // Reserved (x_stab). - W.write(0); - // Reserved (x_snstab). - W.write(0); + if (TargetObjectWriter->is64Bit()) { + // High 4 bytes lenght only on 64 bits + W.write( (uint32_t) ((CSectionRef.SymbolTableIndex & 0xFFFFFFFF00000000) >> 32) ); + // Reserved (pad) + W.write(0); + // Auxiliary type entry + W.write(XCOFF::SymbolAuxType::AUX_CSECT); + } else { + // Reserved (x_stab). + W.write(0); + // Reserved (x_snstab). + W.write(0); + } } void XCOFFObjectWriter::writeSymbolTableEntryForControlSection( const ControlSection &CSectionRef, int16_t SectionIndex, XCOFF::StorageClass StorageClass) { - // n_name, n_zeros, n_offset - writeSymbolName(CSectionRef.getSymbolTableName()); - // n_value - W.write(CSectionRef.Address); + if (TargetObjectWriter->is64Bit()) { + // n_value + W.write(CSectionRef.Address); + // n_offset + writeSymbolName(CSectionRef.getSymbolTableName()); + }else { + // n_name, n_zeros, n_offset + writeSymbolName(CSectionRef.getSymbolTableName()); + // n_value + W.write(CSectionRef.Address); + } // n_scnum W.write(SectionIndex); // Basic/Derived type. See the description of the n_type field for symbol @@ -653,7 +685,12 @@ W.write(1); // Now output the auxiliary entry. - W.write(CSectionRef.Size); + if (TargetObjectWriter->is64Bit()) { + // Low 4 bytes lenght only on 64 bits + W.write((uint32_t) (CSectionRef.Size & 0xFFFFFFFF)); + } else { + W.write(CSectionRef.Size); + } // Parameter typecheck hash. Not supported. W.write(0); // Typecheck section number. Not supported. @@ -662,28 +699,48 @@ W.write(getEncodedType(CSectionRef.MCCsect)); // Storage mapping class. W.write(CSectionRef.MCCsect->getMappingClass()); - // Reserved (x_stab). - W.write(0); - // Reserved (x_snstab). - W.write(0); + if (TargetObjectWriter->is64Bit()) { + // High 4 bytes lenght only on 64 bits + W.write((uint32_t) ((CSectionRef.Size & 0xFFFFFFFF00000000) >> 32) ); + // Reserved (pad) + W.write(0); + // Auxiliary type entry + W.write(XCOFF::SymbolAuxType::AUX_CSECT); + } else { + // Reserved (x_stab). + W.write(0); + // Reserved (x_snstab). + W.write(0); + } } void XCOFFObjectWriter::writeFileHeader() { // Magic. - W.write(0x01df); + if (TargetObjectWriter->is64Bit()) { + W.write(0x01f7); + } else { + W.write(0x01df); + } // Number of sections. W.write(SectionCount); // Timestamp field. For reproducible output we write a 0, which represents no // timestamp. W.write(0); // Byte Offset to the start of the symbol table. - W.write(SymbolTableOffset); - // Number of entries in the symbol table. - W.write(SymbolTableEntryCount); + if (TargetObjectWriter->is64Bit()) { + W.write(SymbolTableOffset); + } else { + W.write(SymbolTableOffset); + // Number of entries in the symbol table (32 bits). + W.write(SymbolTableEntryCount); + } // Size of the optional header. W.write(0); // Flags. W.write(0); + // Number of entries in the symbol table (64 bits). + if (TargetObjectWriter->is64Bit()) + W.write(SymbolTableEntryCount); } void XCOFFObjectWriter::writeSectionHeaderTable() { @@ -698,28 +755,51 @@ // Write the Physical Address and Virtual Address. In an object file these // are the same. - W.write(Sec->Address); - W.write(Sec->Address); - - W.write(Sec->Size); - W.write(Sec->FileOffsetToData); - W.write(Sec->FileOffsetToRelocations); - - // Line number pointer. Not supported yet. - W.write(0); - - W.write(Sec->RelocationCount); - - // Line number counts. Not supported yet. - W.write(0); - - W.write(Sec->Flags); + if (TargetObjectWriter->is64Bit()) { + W.write(Sec->Address); + W.write(Sec->Address); + + W.write(Sec->Size); + W.write(Sec->FileOffsetToData); + W.write(Sec->FileOffsetToRelocations); + + // Line number pointer. Not supported yet. + W.write(0); + + W.write(Sec->RelocationCount); + + // Line number counts. Not supported yet. + W.write(0); + + W.write(Sec->Flags); + W.write(0); + } else { + W.write(Sec->Address); + W.write(Sec->Address); + + W.write(Sec->Size); + W.write(Sec->FileOffsetToData); + W.write(Sec->FileOffsetToRelocations); + + // Line number pointer. Not supported yet. + W.write(0); + + W.write(Sec->RelocationCount); + + // Line number counts. Not supported yet. + W.write(0); + + W.write(Sec->Flags); + } } } void XCOFFObjectWriter::writeRelocation(XCOFFRelocation Reloc, const ControlSection &CSection) { - W.write(CSection.Address + Reloc.FixupOffsetInCsect); + if (TargetObjectWriter->is64Bit()) + W.write(CSection.Address + Reloc.FixupOffsetInCsect); + else + W.write(CSection.Address + Reloc.FixupOffsetInCsect); W.write(Reloc.SymbolTableIndex); W.write(Reloc.SignAndSize); W.write(Reloc.Type); @@ -747,14 +827,21 @@ // Write symbol 0 as C_FILE. // FIXME: support 64-bit C_FILE symbol. // - // n_name. The n_name of a C_FILE symbol is the source filename when no - // auxiliary entries are present. The source filename is alternatively - // provided by an auxiliary entry, in which case the n_name of the C_FILE - // symbol is `.file`. - // FIXME: add the real source filename. - writeSymbolName(".file"); - // n_value. The n_value of a C_FILE symbol is its symbol table index. - W.write(0); + if (TargetObjectWriter->is64Bit()) { + //n_value + W.write(0); + //n_offset + writeSymbolName(".file"); + } else { + // n_name. The n_name of a C_FILE symbol is the source filename when no + // auxiliary entries are present. The source filename is alternatively + // provided by an auxiliary entry, in which case the n_name of the C_FILE + // symbol is `.file`. + // FIXME: add the real source filename. + writeSymbolName(".file"); + // n_value. The n_value of a C_FILE symbol is its symbol table index. + W.write(0); + } // n_scnum. N_DEBUG is a reserved section number for indicating a special // symbolic debugging symbol. W.write(XCOFF::ReservedSectionNum::N_DEBUG); @@ -808,8 +895,9 @@ for (auto &Csect : *Group) { const size_t CsectRelocCount = Csect.Relocations.size(); - if (CsectRelocCount >= XCOFF::RelocOverflow || - Section->RelocationCount >= XCOFF::RelocOverflow - CsectRelocCount) + if (!TargetObjectWriter->is64Bit() && ( + CsectRelocCount >= XCOFF::RelocOverflow || + Section->RelocationCount >= XCOFF::RelocOverflow - CsectRelocCount)) report_fatal_error( "relocation entries overflowed; overflow section is " "not implemented yet"); @@ -826,10 +914,14 @@ continue; Sec->FileOffsetToRelocations = RawPointer; - const uint32_t RelocationSizeInSec = - Sec->RelocationCount * XCOFF::RelocationSerializationSize32; + uint64_t RelocationSizeInSec; + if (TargetObjectWriter->is64Bit()) { + RelocationSizeInSec = Sec->RelocationCount * XCOFF::RelocationSerializationSize64; + } else { + RelocationSizeInSec = Sec->RelocationCount * XCOFF::RelocationSerializationSize32; + } RawPointer += RelocationSizeInSec; - if (RawPointer > UINT32_MAX) + if (RawPointer > UINT32_MAX && !TargetObjectWriter->is64Bit()) report_fatal_error("Relocation data overflowed this object file."); } @@ -856,7 +948,7 @@ // The address corrresponds to the address of sections and symbols in the // object file. We place the shared address 0 immediately after the // section header table. - uint32_t Address = 0; + uint64_t Address = 0; // Section indices are 1-based in XCOFF. int32_t SectionIndex = 1; bool HasTDataSection = false; @@ -922,15 +1014,21 @@ SymbolTableEntryCount = SymbolTableIndex; // Calculate the RawPointer value for each section. - uint64_t RawPointer = sizeof(XCOFF::FileHeader32) + auxiliaryHeaderSize() + + uint64_t RawPointer; + if (TargetObjectWriter->is64Bit()) { + RawPointer = sizeof(XCOFF::FileHeader64) + auxiliaryHeaderSize() + + SectionCount * sizeof(XCOFF::SectionHeader64); + } else { + RawPointer = sizeof(XCOFF::FileHeader32) + auxiliaryHeaderSize() + SectionCount * sizeof(XCOFF::SectionHeader32); + } for (auto *Sec : Sections) { if (Sec->Index == Section::UninitializedIndex || Sec->IsVirtual) continue; Sec->FileOffsetToData = RawPointer; RawPointer += Sec->Size; - if (RawPointer > UINT32_MAX) + if (RawPointer > UINT32_MAX && !TargetObjectWriter->is64Bit()) report_fatal_error("Section raw data overflowed this object file."); } diff --git a/llvm/lib/Object/XCOFFObjectFile.cpp b/llvm/lib/Object/XCOFFObjectFile.cpp --- a/llvm/lib/Object/XCOFFObjectFile.cpp +++ b/llvm/lib/Object/XCOFFObjectFile.cpp @@ -84,6 +84,20 @@ return (Info & XR_BIASED_LENGTH_MASK) + 1; } +bool XCOFFRelocation64::isRelocationSigned() const { + return Info & XR_SIGN_INDICATOR_MASK; +} + +bool XCOFFRelocation64::isFixupIndicated() const { + return Info & XR_FIXUP_INDICATOR_MASK; +} + +uint8_t XCOFFRelocation64::getRelocatedLength() const { + // The relocation encodes the bit length being relocated minus 1. Add back + // the 1 to get the actual length being relocated. + return (Info & XR_BIASED_LENGTH_MASK) + 1; +} + uintptr_t XCOFFObjectFile::getAdvancedSymbolEntryAddress(uintptr_t CurrentAddress, uint32_t Distance) { @@ -318,61 +332,96 @@ } relocation_iterator XCOFFObjectFile::section_rel_begin(DataRefImpl Sec) const { - if (is64Bit()) - report_fatal_error("64-bit support not implemented yet"); - const XCOFFSectionHeader32 *SectionEntPtr = toSection32(Sec); - auto RelocationsOrErr = relocations(*SectionEntPtr); - if (Error E = RelocationsOrErr.takeError()) - return relocation_iterator(RelocationRef()); DataRefImpl Ret; - Ret.p = reinterpret_cast(&*RelocationsOrErr.get().begin()); + if (is64Bit()) { + const XCOFFSectionHeader64 *SectionEntPtr = toSection64(Sec); + auto RelocationsOrErr = relocations64(*SectionEntPtr); + if (Error E = RelocationsOrErr.takeError()) + return relocation_iterator(RelocationRef()); + Ret.p = reinterpret_cast(&*RelocationsOrErr.get().begin()); + } else { + const XCOFFSectionHeader32 *SectionEntPtr = toSection32(Sec); + auto RelocationsOrErr = relocations32(*SectionEntPtr); + if (Error E = RelocationsOrErr.takeError()) + return relocation_iterator(RelocationRef()); + Ret.p = reinterpret_cast(&*RelocationsOrErr.get().begin()); + } return relocation_iterator(RelocationRef(Ret, this)); } relocation_iterator XCOFFObjectFile::section_rel_end(DataRefImpl Sec) const { - if (is64Bit()) - report_fatal_error("64-bit support not implemented yet"); - const XCOFFSectionHeader32 *SectionEntPtr = toSection32(Sec); - auto RelocationsOrErr = relocations(*SectionEntPtr); - if (Error E = RelocationsOrErr.takeError()) - return relocation_iterator(RelocationRef()); DataRefImpl Ret; - Ret.p = reinterpret_cast(&*RelocationsOrErr.get().end()); + if (is64Bit()) { + const XCOFFSectionHeader64 *SectionEntPtr = toSection64(Sec); + auto RelocationsOrErr = relocations64(*SectionEntPtr); + if (Error E = RelocationsOrErr.takeError()) + return relocation_iterator(RelocationRef()); + Ret.p = reinterpret_cast(&*RelocationsOrErr.get().end()); + } else { + const XCOFFSectionHeader32 *SectionEntPtr = toSection32(Sec); + auto RelocationsOrErr = relocations32(*SectionEntPtr); + if (Error E = RelocationsOrErr.takeError()) + return relocation_iterator(RelocationRef()); + Ret.p = reinterpret_cast(&*RelocationsOrErr.get().end()); + } return relocation_iterator(RelocationRef(Ret, this)); } void XCOFFObjectFile::moveRelocationNext(DataRefImpl &Rel) const { - Rel.p = reinterpret_cast(viewAs(Rel.p) + 1); + if (is64Bit()) + Rel.p = reinterpret_cast(viewAs(Rel.p) + 1); + else + Rel.p = reinterpret_cast(viewAs(Rel.p) + 1); } uint64_t XCOFFObjectFile::getRelocationOffset(DataRefImpl Rel) const { - if (is64Bit()) - report_fatal_error("64-bit support not implemented yet"); - const XCOFFRelocation32 *Reloc = viewAs(Rel.p); - const XCOFFSectionHeader32 *Sec32 = sectionHeaderTable32(); - const uint32_t RelocAddress = Reloc->VirtualAddress; - const uint16_t NumberOfSections = getNumberOfSections(); - for (uint16_t i = 0; i < NumberOfSections; ++i) { - // Find which section this relocation is belonging to, and get the - // relocation offset relative to the start of the section. - if (Sec32->VirtualAddress <= RelocAddress && - RelocAddress < Sec32->VirtualAddress + Sec32->SectionSize) { - return RelocAddress - Sec32->VirtualAddress; + if (is64Bit()) { + const XCOFFRelocation64 *Reloc = viewAs(Rel.p); + const XCOFFSectionHeader64 *Sec64 = sectionHeaderTable64(); + const uint64_t RelocAddress = Reloc->VirtualAddress; + const uint16_t NumberOfSections = getNumberOfSections(); + for (uint16_t i = 0; i < NumberOfSections; ++i) { + // Find which section this relocation is belonging to, and get the + // relocation offset relative to the start of the section. + if (Sec64->VirtualAddress <= RelocAddress && + RelocAddress < Sec64->VirtualAddress + Sec64->SectionSize) { + return RelocAddress - Sec64->VirtualAddress; + } + ++Sec64; + } + } else { + const XCOFFRelocation32 *Reloc = viewAs(Rel.p); + const XCOFFSectionHeader32 *Sec32 = sectionHeaderTable32(); + const uint32_t RelocAddress = Reloc->VirtualAddress; + const uint16_t NumberOfSections = getNumberOfSections(); + for (uint16_t i = 0; i < NumberOfSections; ++i) { + // Find which section this relocation is belonging to, and get the + // relocation offset relative to the start of the section. + if (Sec32->VirtualAddress <= RelocAddress && + RelocAddress < Sec32->VirtualAddress + Sec32->SectionSize) { + return RelocAddress - Sec32->VirtualAddress; + } + ++Sec32; } - ++Sec32; } return InvalidRelocOffset; } symbol_iterator XCOFFObjectFile::getRelocationSymbol(DataRefImpl Rel) const { - if (is64Bit()) - report_fatal_error("64-bit support not implemented yet"); - const XCOFFRelocation32 *Reloc = viewAs(Rel.p); - const uint32_t Index = Reloc->SymbolIndex; - - if (Index >= getLogicalNumberOfSymbolTableEntries32()) - return symbol_end(); - + uint32_t Index; + if (is64Bit()) { + const XCOFFRelocation64 *Reloc = viewAs(Rel.p); + Index = Reloc->SymbolIndex; + + if (Index >= getNumberOfSymbolTableEntries64()) + return symbol_end(); + } else { + const XCOFFRelocation32 *Reloc = viewAs(Rel.p); + Index = Reloc->SymbolIndex; + + if (Index >= getLogicalNumberOfSymbolTableEntries32()) + return symbol_end(); + } DataRefImpl SymDRI; SymDRI.p = getSymbolEntryAddressByIndex(Index); return symbol_iterator(SymbolRef(SymDRI, this)); @@ -380,16 +429,20 @@ uint64_t XCOFFObjectFile::getRelocationType(DataRefImpl Rel) const { if (is64Bit()) - report_fatal_error("64-bit support not implemented yet"); + return viewAs(Rel.p)->Type; return viewAs(Rel.p)->Type; } void XCOFFObjectFile::getRelocationTypeName( DataRefImpl Rel, SmallVectorImpl &Result) const { - if (is64Bit()) - report_fatal_error("64-bit support not implemented yet"); - const XCOFFRelocation32 *Reloc = viewAs(Rel.p); - StringRef Res = XCOFF::getRelocationTypeString(Reloc->Type); + StringRef Res; + if (is64Bit()) { + const XCOFFRelocation64 *Reloc = viewAs(Rel.p); + Res = XCOFF::getRelocationTypeString(Reloc->Type); + } else { + const XCOFFRelocation32 *Reloc = viewAs(Rel.p); + Res = XCOFF::getRelocationTypeString(Reloc->Type); + } Result.append(Res.begin(), Res.end()); } @@ -441,7 +494,7 @@ bool XCOFFObjectFile::isRelocatableObject() const { if (is64Bit()) - report_fatal_error("64-bit support not implemented yet"); + return !(fileHeader64()->Flags & NoRelMask); return !(fileHeader32()->Flags & NoRelMask); } @@ -645,7 +698,7 @@ // section header contains the actual count of relocation entries in the s_paddr // field. STYP_OVRFLO headers contain the section index of their corresponding // sections as their raw "NumberOfRelocations" field value. -Expected XCOFFObjectFile::getLogicalNumberOfRelocationEntries( +Expected XCOFFObjectFile::getLogicalNumberOfRelocationEntries32( const XCOFFSectionHeader32 &Sec) const { uint16_t SectionIndex = &Sec - sectionHeaderTable32() + 1; @@ -661,10 +714,10 @@ } Expected> -XCOFFObjectFile::relocations(const XCOFFSectionHeader32 &Sec) const { +XCOFFObjectFile::relocations32(const XCOFFSectionHeader32 &Sec) const { uintptr_t RelocAddr = getWithOffset(reinterpret_cast(FileHeader), Sec.FileOffsetToRelocationInfo); - auto NumRelocEntriesOrErr = getLogicalNumberOfRelocationEntries(Sec); + auto NumRelocEntriesOrErr = getLogicalNumberOfRelocationEntries32(Sec); if (Error E = NumRelocEntriesOrErr.takeError()) return std::move(E); @@ -683,6 +736,32 @@ return ArrayRef(StartReloc, StartReloc + NumRelocEntries); } +uint32_t XCOFFObjectFile::getNumberOfRelocationEntries64( + const XCOFFSectionHeader64 &Sec) const { + + uint16_t SectionIndex = &Sec - sectionHeaderTable64() + 1; + return Sec.NumberOfRelocations; +} + +Expected> +XCOFFObjectFile::relocations64(const XCOFFSectionHeader64 &Sec) const { + uintptr_t RelocAddr = getWithOffset(reinterpret_cast(FileHeader), + Sec.FileOffsetToRelocationInfo); + uint32_t NumRelocEntries = getNumberOfRelocationEntries64(Sec); + + static_assert( + sizeof(XCOFFRelocation64) == XCOFF::RelocationSerializationSize64, ""); + auto RelocationOrErr = + getObject(Data, reinterpret_cast(RelocAddr), + NumRelocEntries * sizeof(XCOFFRelocation64)); + if (Error E = RelocationOrErr.takeError()) + return std::move(E); + + const XCOFFRelocation64 *StartReloc = RelocationOrErr.get(); + + return ArrayRef(StartReloc, StartReloc + NumRelocEntries); +} + Expected XCOFFObjectFile::parseStringTable(const XCOFFObjectFile *Obj, uint64_t Offset) { // If there is a string table, then the buffer must contain at least 4 bytes diff --git a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCXCOFFObjectWriter.cpp b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCXCOFFObjectWriter.cpp --- a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCXCOFFObjectWriter.cpp +++ b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCXCOFFObjectWriter.cpp @@ -58,11 +58,12 @@ switch ((unsigned)Fixup.getKind()) { default: report_fatal_error("Unimplemented fixup kind."); + case PPC::fixup_ppc_half16ds: case PPC::fixup_ppc_half16: { const uint8_t SignAndSizeForHalf16 = EncodedSignednessIndicator | 15; switch (Modifier) { default: - report_fatal_error("Unsupported modifier for half16 fixup."); + report_fatal_error("Unsupported modifier for half16/half16ds fixup."); case MCSymbolRefExpr::VK_None: return {XCOFF::RelocationType::R_TOC, SignAndSizeForHalf16}; case MCSymbolRefExpr::VK_PPC_U: @@ -88,5 +89,16 @@ case MCSymbolRefExpr::VK_None: return {XCOFF::RelocationType::R_POS, EncodedSignednessIndicator | 31}; } + case FK_Data_8: + switch (Modifier) { + default: + report_fatal_error("Unsupported modifier"); + case MCSymbolRefExpr::VK_PPC_AIX_TLSGD: + return {XCOFF::RelocationType::R_TLS, EncodedSignednessIndicator | 63}; + case MCSymbolRefExpr::VK_PPC_AIX_TLSGDM: + return {XCOFF::RelocationType::R_TLSM, EncodedSignednessIndicator | 63}; + case MCSymbolRefExpr::VK_None: + return {XCOFF::RelocationType::R_POS, EncodedSignednessIndicator | 63}; + } } } diff --git a/llvm/test/CodeGen/PowerPC/aix-available-externally-linkage.ll b/llvm/test/CodeGen/PowerPC/aix-available-externally-linkage.ll --- a/llvm/test/CodeGen/PowerPC/aix-available-externally-linkage.ll +++ b/llvm/test/CodeGen/PowerPC/aix-available-externally-linkage.ll @@ -11,10 +11,10 @@ ; RUN: llvm-readobj --symbols %t.o | \ ; RUN: FileCheck --check-prefix=XCOFF32 %s -; RUN: not --crash llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff \ -; RUN: -mcpu=pwr4 -mattr=-altivec -filetype=obj -o %t.o 2>&1 < %s | \ +; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \ +; RUN: -mattr=-altivec -filetype=obj -o %t.o < %s +; RUN: llvm-readobj --symbols %t.o | \ ; RUN: FileCheck --check-prefix=XCOFF64 %s -; XCOFF64: LLVM ERROR: 64-bit XCOFF object files are not supported yet. @_ZN3Foo1aE = available_externally constant i32 -1 @@ -37,3 +37,20 @@ ; XCOFF32-NEXT: StabInfoIndex: 0x0 ; XCOFF32-NEXT: StabSectNum: 0x0 ; XCOFF32-NEXT: } + +; XCOFF64: Index: [[#Index:]]{{.*}}{{[[:space:]] *}}Name: _ZN3Foo1aE +; XCOFF64-NEXT: Value (RelocatableAddress): 0x0 +; XCOFF64-NEXT: Section: N_UNDEF +; XCOFF64-NEXT: Type: 0x0 +; XCOFF64-NEXT: StorageClass: C_EXT (0x2) +; XCOFF64-NEXT: NumberOfAuxEntries: 1 +; XCOFF64-NEXT: CSECT Auxiliary Entry { +; XCOFF64-NEXT: Index: [[#Index+1]] +; XCOFF64-NEXT: SectionLen: 0 +; XCOFF64-NEXT: ParameterHashIndex: 0x0 +; XCOFF64-NEXT: TypeChkSectNum: 0x0 +; XCOFF64-NEXT: SymbolAlignmentLog2: 0 +; XCOFF64-NEXT: SymbolType: XTY_ER (0x0) +; XCOFF64-NEXT: StorageMappingClass: XMC_UA (0x4) +; XCOFF64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; XCOFF64-NEXT: } 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 @@ -8,11 +8,9 @@ ; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false -filetype=obj -o %t.o < %s ; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefix=CHECKSYM %s -; RUN: not --crash llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff \ -; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false -filetype=obj -o %t.o 2>&1 < %s | \ -; RUN: FileCheck --check-prefix=XCOFF64 %s -; XCOFF64: LLVM ERROR: 64-bit XCOFF object files are not supported yet. - +; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \ +; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false -filetype=obj -o %t.o < %s +; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefix=CHECKSYM64 %s @foo_ext_weak_p = global void (...)* bitcast (void ()* @foo_ext_weak_ref to void (...)*) @b_w = extern_weak global i32 @@ -333,3 +331,264 @@ ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: ] + + +; CHECKSYM64: Symbols [ +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: 0 +; CHECKSYM64-NEXT: Name: .file +; CHECKSYM64-NEXT: Value (SymbolTableIndex): 0x0 +; CHECKSYM64-NEXT: Section: N_DEBUG +; CHECKSYM64-NEXT: Source Language ID: TB_C (0x0) +; CHECKSYM64-NEXT: CPU Version ID: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_FILE (0x67) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 0 +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: [[#Index:]] +; CHECKSYM64-NEXT: Name: .foo_ext_weak +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x0 +; CHECKSYM64-NEXT: Section: N_UNDEF +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_WEAKEXT (0x6F) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: [[#Index+1]] +; CHECKSYM64-NEXT: SectionLen: 0 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 0 +; CHECKSYM64-NEXT: SymbolType: XTY_ER (0x0) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_PR (0x0) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: [[#Index+2]] +; CHECKSYM64-NEXT: Name: foo_ext_weak_ref +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x0 +; CHECKSYM64-NEXT: Section: N_UNDEF +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_WEAKEXT (0x6F) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: [[#Index+3]] +; CHECKSYM64-NEXT: SectionLen: 0 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 0 +; CHECKSYM64-NEXT: SymbolType: XTY_ER (0x0) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_DS (0xA) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: [[#Index+4]] +; CHECKSYM64-NEXT: Name: b_w +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x0 +; CHECKSYM64-NEXT: Section: N_UNDEF +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_WEAKEXT (0x6F) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: [[#Index+5]] +; CHECKSYM64-NEXT: SectionLen: 0 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 0 +; CHECKSYM64-NEXT: SymbolType: XTY_ER (0x0) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_UA (0x4) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: [[#Index+6]] +; CHECKSYM64-NEXT: Name: .foo_ext_weak_ref +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x0 +; CHECKSYM64-NEXT: Section: N_UNDEF +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_WEAKEXT (0x6F) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: [[#Index+7]] +; CHECKSYM64-NEXT: SectionLen: 0 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 0 +; CHECKSYM64-NEXT: SymbolType: XTY_ER (0x0) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_PR (0x0) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: [[#Index+8]] +; CHECKSYM64-NEXT: Name: foo_ext_weak +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x0 +; CHECKSYM64-NEXT: Section: N_UNDEF +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_WEAKEXT (0x6F) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: [[#Index+9]] +; CHECKSYM64-NEXT: SectionLen: 0 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 0 +; CHECKSYM64-NEXT: SymbolType: XTY_ER (0x0) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_DS (0xA) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: [[#Index+10]] +; CHECKSYM64-NEXT: Name: .text +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x0 +; CHECKSYM64-NEXT: Section: .text +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: [[#Index+11]] +; CHECKSYM64-NEXT: SectionLen: 80 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 4 +; CHECKSYM64-NEXT: SymbolType: XTY_SD (0x1) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_PR (0x0) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: [[#Index+12]] +; CHECKSYM64-NEXT: Name: .main +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x0 +; CHECKSYM64-NEXT: Section: .text +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_EXT (0x2) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: [[#Index+13]] +; CHECKSYM64-NEXT: ContainingCsectSymbolIndex: 11 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 0 +; CHECKSYM64-NEXT: SymbolType: XTY_LD (0x2) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_PR (0x0) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: [[#Index+14]] +; CHECKSYM64-NEXT: Name: .data +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x50 +; CHECKSYM64-NEXT: Section: .data +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: [[#Index+15]] +; CHECKSYM64-NEXT: SectionLen: 8 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3 +; CHECKSYM64-NEXT: SymbolType: XTY_SD (0x1) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_RW (0x5) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: [[#Index+16]] +; CHECKSYM64-NEXT: Name: foo_ext_weak_p +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x50 +; CHECKSYM64-NEXT: Section: .data +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_EXT (0x2) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: [[#Index+17]] +; CHECKSYM64-NEXT: ContainingCsectSymbolIndex: 15 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 0 +; CHECKSYM64-NEXT: SymbolType: XTY_LD (0x2) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_RW (0x5) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: [[#Index+18]] +; CHECKSYM64-NEXT: Name: main +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x58 +; CHECKSYM64-NEXT: Section: .data +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_EXT (0x2) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: [[#Index+19]] +; CHECKSYM64-NEXT: SectionLen: 24 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3 +; CHECKSYM64-NEXT: SymbolType: XTY_SD (0x1) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_DS (0xA) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: [[#Index+20]] +; CHECKSYM64-NEXT: Name: TOC +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x70 +; CHECKSYM64-NEXT: Section: .data +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: [[#Index+21]] +; CHECKSYM64-NEXT: SectionLen: 0 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 2 +; CHECKSYM64-NEXT: SymbolType: XTY_SD (0x1) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_TC0 (0xF) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: [[#Index+22]] +; CHECKSYM64-NEXT: Name: foo_ext_weak_p +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x70 +; CHECKSYM64-NEXT: Section: .data +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: [[#Index+23]] +; CHECKSYM64-NEXT: SectionLen: 8 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3 +; CHECKSYM64-NEXT: SymbolType: XTY_SD (0x1) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_TC (0x3) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: [[#Index+24]] +; CHECKSYM64-NEXT: Name: b_w +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x78 +; CHECKSYM64-NEXT: Section: .data +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: [[#Index+25]] +; CHECKSYM64-NEXT: SectionLen: 8 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3 +; CHECKSYM64-NEXT: SymbolType: XTY_SD (0x1) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_TC (0x3) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-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 @@ -8,9 +8,9 @@ ; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false -filetype=obj -o %t.o < %s ; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefix=CHECKSYM %s -; RUN: not --crash llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff \ -; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false -filetype=obj -o %t.o 2>&1 < %s | FileCheck --check-prefix=XCOFF64 %s -; XCOFF64: LLVM ERROR: 64-bit XCOFF object files are not supported yet. +; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \ +; RUN: -mattr=-altivec -data-sections=false -xcoff-traceback-table=false -filetype=obj -o %t.o < %s +; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefix=CHECKSYM64 %s @bar_p = global i32 (...)* @bar_ref, align 4 @b_e = external global i32, align 4 @@ -394,3 +394,301 @@ ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: ] + +; CHECKSYM64: Symbols [ +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: 0 +; CHECKSYM64-NEXT: Name: .file +; CHECKSYM64-NEXT: Value (SymbolTableIndex): 0x0 +; CHECKSYM64-NEXT: Section: N_DEBUG +; CHECKSYM64-NEXT: Source Language ID: TB_C (0x0) +; CHECKSYM64-NEXT: CPU Version ID: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_FILE (0x67) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 0 +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: 1 +; CHECKSYM64-NEXT: Name: .bar_extern +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x0 +; CHECKSYM64-NEXT: Section: N_UNDEF +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_EXT (0x2) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: 2 +; CHECKSYM64-NEXT: SectionLen: 0 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 0 +; CHECKSYM64-NEXT: SymbolType: XTY_ER (0x0) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_PR (0x0) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: 3 +; CHECKSYM64-NEXT: Name: .bar_ref +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x0 +; CHECKSYM64-NEXT: Section: N_UNDEF +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_EXT (0x2) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: 4 +; CHECKSYM64-NEXT: SectionLen: 0 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 0 +; CHECKSYM64-NEXT: SymbolType: XTY_ER (0x0) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_PR (0x0) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: 5 +; CHECKSYM64-NEXT: Name: bar_ref +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x0 +; CHECKSYM64-NEXT: Section: N_UNDEF +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_EXT (0x2) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: 6 +; CHECKSYM64-NEXT: SectionLen: 0 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 0 +; CHECKSYM64-NEXT: SymbolType: XTY_ER (0x0) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_DS (0xA) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: 7 +; CHECKSYM64-NEXT: Name: b_e +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x0 +; CHECKSYM64-NEXT: Section: N_UNDEF +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_EXT (0x2) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: 8 +; CHECKSYM64-NEXT: SectionLen: 0 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 0 +; CHECKSYM64-NEXT: SymbolType: XTY_ER (0x0) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_UA (0x4) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: 9 +; CHECKSYM64-NEXT: Name: bar_extern +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x0 +; CHECKSYM64-NEXT: Section: N_UNDEF +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_EXT (0x2) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: 10 +; CHECKSYM64-NEXT: SectionLen: 0 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 0 +; CHECKSYM64-NEXT: SymbolType: XTY_ER (0x0) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_DS (0xA) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: 11 +; CHECKSYM64-NEXT: Name: .text +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x0 +; CHECKSYM64-NEXT: Section: .text +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: 12 +; CHECKSYM64-NEXT: SectionLen: 112 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 4 +; CHECKSYM64-NEXT: SymbolType: XTY_SD (0x1) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_PR (0x0) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: 13 +; CHECKSYM64-NEXT: Name: .foo +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x0 +; CHECKSYM64-NEXT: Section: .text +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_EXT (0x2) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: 14 +; CHECKSYM64-NEXT: ContainingCsectSymbolIndex: 11 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 0 +; CHECKSYM64-NEXT: SymbolType: XTY_LD (0x2) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_PR (0x0) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: 15 +; CHECKSYM64-NEXT: Name: .main +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x10 +; CHECKSYM64-NEXT: Section: .text +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_EXT (0x2) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: 16 +; CHECKSYM64-NEXT: ContainingCsectSymbolIndex: 11 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 0 +; CHECKSYM64-NEXT: SymbolType: XTY_LD (0x2) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_PR (0x0) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: 17 +; CHECKSYM64-NEXT: Name: .data +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x70 +; CHECKSYM64-NEXT: Section: .data +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: 18 +; CHECKSYM64-NEXT: SectionLen: 8 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3 +; CHECKSYM64-NEXT: SymbolType: XTY_SD (0x1) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_RW (0x5) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: 19 +; CHECKSYM64-NEXT: Name: bar_p +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x70 +; CHECKSYM64-NEXT: Section: .data +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_EXT (0x2) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: 20 +; CHECKSYM64-NEXT: ContainingCsectSymbolIndex: 17 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 0 +; CHECKSYM64-NEXT: SymbolType: XTY_LD (0x2) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_RW (0x5) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: 21 +; CHECKSYM64-NEXT: Name: foo +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x78 +; CHECKSYM64-NEXT: Section: .data +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_EXT (0x2) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: 22 +; CHECKSYM64-NEXT: SectionLen: 24 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3 +; CHECKSYM64-NEXT: SymbolType: XTY_SD (0x1) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_DS (0xA) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: 23 +; CHECKSYM64-NEXT: Name: main +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x90 +; CHECKSYM64-NEXT: Section: .data +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_EXT (0x2) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: 24 +; CHECKSYM64-NEXT: SectionLen: 24 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3 +; CHECKSYM64-NEXT: SymbolType: XTY_SD (0x1) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_DS (0xA) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: 25 +; CHECKSYM64-NEXT: Name: TOC +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0xA8 +; CHECKSYM64-NEXT: Section: .data +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: 26 +; CHECKSYM64-NEXT: SectionLen: 0 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 2 +; CHECKSYM64-NEXT: SymbolType: XTY_SD (0x1) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_TC0 (0xF) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: 27 +; CHECKSYM64-NEXT: Name: b_e +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0xA8 +; CHECKSYM64-NEXT: Section: .data +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: 28 +; CHECKSYM64-NEXT: SectionLen: 8 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3 +; CHECKSYM64-NEXT: SymbolType: XTY_SD (0x1) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_TC (0x3) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: 29 +; CHECKSYM64-NEXT: Name: bar_p +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0xB0 +; CHECKSYM64-NEXT: Section: .data +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: 30 +; CHECKSYM64-NEXT: SectionLen: 8 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3 +; CHECKSYM64-NEXT: SymbolType: XTY_SD (0x1) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_TC (0x3) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: ] diff --git a/llvm/test/CodeGen/PowerPC/aix-func-align.ll b/llvm/test/CodeGen/PowerPC/aix-func-align.ll --- a/llvm/test/CodeGen/PowerPC/aix-func-align.ll +++ b/llvm/test/CodeGen/PowerPC/aix-func-align.ll @@ -9,9 +9,9 @@ ; RUN: -xcoff-traceback-table=false -filetype=obj -o %t.o < %s ; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefix=SYMS %s -; RUN: not --crash llc -mtriple powerpc64-ibm-aix-xcoff -filetype=obj < %s 2>&1 | \ -; RUN: FileCheck --check-prefix=XCOFF64 %s -; XCOFF64: LLVM ERROR: 64-bit XCOFF object files are not supported yet. +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc64-ibm-aix-xcoff \ +; RUN: -xcoff-traceback-table=false -filetype=obj -o %t.o < %s +; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefix=SYMS64 %s define i32 @foo() align 32 { entry: @@ -47,3 +47,21 @@ ; SYMS-NEXT: StabSectNum: 0x0 ; SYMS-NEXT: } ; SYMS-NEXT: } + +; SYMS64: Symbol {{[{][[:space:]] *}}Index: [[#INDX:]]{{[[:space:]] *}}Name: .text +; SYMS64-NEXT: Value (RelocatableAddress): 0x0 +; SYMS64-NEXT: Section: .text +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+1]] +; SYMS64-NEXT: SectionLen: 72 +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 6 +; SYMS64-NEXT: SymbolType: XTY_SD (0x1) +; SYMS64-NEXT: StorageMappingClass: XMC_PR (0x0) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } diff --git a/llvm/test/CodeGen/PowerPC/aix-internal.ll b/llvm/test/CodeGen/PowerPC/aix-internal.ll --- a/llvm/test/CodeGen/PowerPC/aix-internal.ll +++ b/llvm/test/CodeGen/PowerPC/aix-internal.ll @@ -1,8 +1,10 @@ ; RUN: llc -mtriple powerpc-ibm-aix -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec \ ; RUN: -filetype=obj -o %t.o < %s ; RUN: llvm-readobj --syms %t.o | FileCheck %s -; RUN: not --crash llc -mtriple powerpc64-ibm-aix -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec \ -; RUN: -filetype=obj -o %t.o < %s 2>&1 | FileCheck --check-prefix=64-CHECK %s + +; RUN: llc -mtriple powerpc-ibm-aix -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec \ +; RUN: -filetype=obj -o %t.o < %s +; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefix=CHECK64 %s define internal i32 @foo() { ret i32 1 @@ -35,4 +37,29 @@ ; Make sure no label is emitted. ; CHECK-NOT: Name: foo -;64-CHECK: LLVM ERROR: 64-bit XCOFF object files are not supported yet. +; CHECK64: Symbol { +; CHECK64: Name: .foo +; CHECK64-NEXT: Value (RelocatableAddress): +; CHECK64-NEXT: Section: .text +; CHECK64-NEXT: Type: 0x0 +; CHECK64-NEXT: StorageClass: C_HIDEXT (0x6B) + +; CHECK64: Symbol { +; CHECK64-NEXT: Index: [[#INDX:]] +; CHECK64-NEXT: Name: foo +; CHECK64-NEXT: Value (RelocatableAddress): +; CHECK64-NEXT: Section: .data +; CHECK64-NEXT: Type: 0x0 +; CHECK64-NEXT: StorageClass: C_HIDEXT (0x6B) +; CHECK64-NEXT: NumberOfAuxEntries: 1 +; CHECK64-NEXT: CSECT Auxiliary Entry { +; CHECK64-NEXT: Index: [[#INDX+1]] +; CHECK64-NEXT: SectionLen: 12 +; CHECK64-NEXT: ParameterHashIndex: +; CHECK64-NEXT: TypeChkSectNum: +; CHECK64-NEXT: SymbolAlignmentLog2: +; CHECK64-NEXT: SymbolType: XTY_SD (0x1) +; CHECK64-NEXT: StorageMappingClass: XMC_DS (0xA) + +; Make sure no label is emitted. +; CHECK64-NOT: Name: foo diff --git a/llvm/test/CodeGen/PowerPC/aix-llvm-intrinsic.ll b/llvm/test/CodeGen/PowerPC/aix-llvm-intrinsic.ll --- a/llvm/test/CodeGen/PowerPC/aix-llvm-intrinsic.ll +++ b/llvm/test/CodeGen/PowerPC/aix-llvm-intrinsic.ll @@ -9,10 +9,10 @@ ; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefix=CHECKSYM %s ; RUN: llvm-objdump -r -d --symbol-description %t.o | FileCheck --check-prefix=CHECKRELOC %s -; RUN: not --crash llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff \ -; RUN: -mattr=-altivec -filetype=obj -o %t.o 2>&1 < %s | \ -; RUN: FileCheck --check-prefix=XCOFF64 %s -; XCOFF64: LLVM ERROR: 64-bit XCOFF object files are not supported yet. +; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \ +; RUN: -mattr=-altivec -filetype=obj -o %t.o < %s +; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefix=CHECKSYM64 %s +; RUN: llvm-objdump -r -d --symbol-description %t.o | FileCheck --check-prefix=CHECKRELOC64 %s %struct.S = type { i32, i32 } @@ -78,3 +78,45 @@ ; CHECKRELOC-NEXT: 14: 7c 85 23 78 mr 5, 4 ; CHECKRELOC-NEXT: 18: 4b ff ff e9 bl 0x0 ; CHECKRELOC-NEXT: 00000018: R_RBR (idx: 1) .memset[PR] + + +; CHECKSYM64: Symbol { +; CHECKSYM64-NEXT: Index: 0 +; CHECKSYM64-NEXT: Name: .file +; CHECKSYM64-NEXT: Value (SymbolTableIndex): 0x0 +; CHECKSYM64-NEXT: Section: N_DEBUG +; CHECKSYM64-NEXT: Source Language ID: TB_C (0x0) +; CHECKSYM64-NEXT: CPU Version ID: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_FILE (0x67) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 0 +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: 1 +; CHECKSYM64-NEXT: Name: .memset +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x0 +; CHECKSYM64-NEXT: Section: N_UNDEF +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_EXT (0x2) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: 2 +; CHECKSYM64-NEXT: SectionLen: 0 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 0 +; CHECKSYM64-NEXT: SymbolType: XTY_ER (0x0) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_PR (0x0) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } + +; CHECKRELOC64: 00000000 (idx: 7) .bar: +; CHECKRELOC64-NEXT: 0: 7c 08 02 a6 mflr 0 +; CHECKRELOC64-NEXT: 4: f8 01 00 10 std 0, 16(1) +; CHECKRELOC64-NEXT: 8: f8 21 ff 91 stdu 1, -112(1) +; CHECKRELOC64-NEXT: c: e8 62 00 00 ld 3, 0(2) +; CHECKRELOC64-NEXT: 0000000e: R_TOC (idx: 13) s[TC] +; CHECKRELOC64-NEXT: 10: 80 83 00 04 lwz 4, 4(3) +; CHECKRELOC64-NEXT: 14: 7c 85 23 78 mr 5, 4 +; CHECKRELOC64-NEXT: 18: 4b ff ff e9 bl 0x0 +; CHECKRELOC64-NEXT: 00000018: R_RBR (idx: 1) .memset[PR] diff --git a/llvm/test/CodeGen/PowerPC/aix-overflow-toc.py b/llvm/test/CodeGen/PowerPC/aix-overflow-toc.py --- a/llvm/test/CodeGen/PowerPC/aix-overflow-toc.py +++ b/llvm/test/CodeGen/PowerPC/aix-overflow-toc.py @@ -11,10 +11,9 @@ # RUN: -filetype=obj -o %t.o < %t.ll # RUN: llvm-objdump -D -r --symbol-description %t.o | FileCheck --check-prefix=DIS32 %s -# RUN: not --crash llc -mtriple powerpc64-ibm-aix-xcoff -data-sections=false \ -# RUN: -mcpu=pwr4 -mattr=-altivec -filetype=obj -o %t.o 2>&1 < %t.ll | \ -# RUN: FileCheck --check-prefix=XCOFF64 %s -# XCOFF64: LLVM ERROR: 64-bit XCOFF object files are not supported yet. +# RUN: llc -mtriple powerpc64-ibm-aix-xcoff -code-model=small -data-sections=false -mcpu=pwr4 -mattr=-altivec -O0 \ +# RUN: -filetype=obj -o %t.o < %t.ll +# RUN: llvm-objdump -D -r --symbol-description %t.o | FileCheck --check-prefix=DIS64 %s numentries = 12290 for x in range(0, numentries): @@ -66,3 +65,20 @@ # DIS32: 00018006: R_TOC (idx: 49167) a12288[TC] # DIS32: 1800c: 80 82 c0 04 lwz 4, -16380(2) # DIS32: 0001800e: R_TOC (idx: 49169) a12289[TC] + +# DIS64: 0: e8 82 00 00 ld 4, 0(2) +# DIS64: 00000002: R_TOC (idx: 24591) a0[TC] +# DIS64: c: e8 82 00 08 ld 4, 8(2) +# DIS64: 0000000e: R_TOC (idx: 24593) a1[TC] + +# DIS64: fffc: e8 82 ff f8 ld 4, -8(2) +# DIS64: 0000fffe: R_TOC (idx: 40973) a8191[TC] +# DIS64: 10004: e8 82 00 00 ld 4, 0(2) +# DIS64: 00010006: R_TOC (idx: 40975) a8192[TC] +# DIS64: 1000c: e8 82 00 08 ld 4, 8(2) +# DIS64: 0001000e: R_TOC (idx: 40977) a8193[TC] + +# DIS64: 18004: e8 82 80 00 ld 4, -32768(2) +# DIS64: 00018006: R_TOC (idx: 49167) a12288[TC] +# DIS64: 1800c: e8 82 80 08 ld 4, -32760(2) +# DIS64: 0001800e: R_TOC (idx: 49169) a12289[TC] 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 @@ -5,9 +5,12 @@ ; RUN: llvm-objdump -D %t.o | FileCheck --check-prefix=CHECKOBJ %s ; RUN: llvm-readobj -sections %t.o | FileCheck --check-prefix=CHECKSECT %s -; RUN: not --crash llc -mtriple powerpc64-ibm-aix-xcoff -filetype=obj < %s 2>&1 | \ -; RUN: FileCheck --check-prefix=XCOFF64 %s -; XCOFF64: LLVM ERROR: 64-bit XCOFF object files are not supported yet. +; RUN: llc -mcpu=pwr4 -mattr=-altivec -mtriple=powerpc64-ibm-aix-xcoff \ +; RUN: -verify-machineinstrs -data-sections=false -xcoff-traceback-table=false < %s | FileCheck %s +; RUN: llc -mcpu=pwr4 -mattr=-altivec -mtriple=powerpc64-ibm-aix-xcoff \ +; RUN: -verify-machineinstrs -data-sections=false -xcoff-traceback-table=false -filetype=obj -o %t.o < %s +; RUN: llvm-objdump -D %t.o | FileCheck --check-prefix=CHECKOBJ64 %s +; RUN: llvm-readobj -sections %t.o | FileCheck --check-prefix=CHECKSECT64 %s @a = global i64 320255973571806, align 8 @d = global double 5.000000e+00, align 8 @@ -68,3 +71,51 @@ ;CHECKSECT-NEXT: Type: STYP_DATA (0x40) ;CHECKSECT-NEXT: } ;CHECKSECT-NEXT: ] + +;CHECKOBJ64: 00000000 <.text>: +;CHECKOBJ64-NEXT: 0: 38 60 00 37 li 3, 55 +;CHECKOBJ64-NEXT: 4: 4e 80 00 20 blr{{[[:space:]] *}} +;CHECKOBJ64-NEXT: 00000008 <.rodata.str1.1>: +;CHECKOBJ64-NEXT: 8: 68 65 6c 6c xori 5, 3, 27756 +;CHECKOBJ64-NEXT: c: 6f 77 6f 72 xoris 23, 27, 28530 +;CHECKOBJ64-NEXT: 10: 0a 00 00 00 tdlti 0, 0{{[[:space:]] *}} +;CHECKOBJ64-NEXT: Disassembly of section .data:{{[[:space:]] *}} +;CHECKOBJ64-NEXT: 00000018 : +;CHECKOBJ64-NEXT: 18: 00 01 23 45 +;CHECKOBJ64-NEXT: 1c: 67 8a bc de oris 10, 28, 48350{{[[:space:]] *}} +;CHECKOBJ64-NEXT: 00000020 : +;CHECKOBJ64-NEXT: 20: 40 14 00 00 bdnzf 20, 0x20 +;CHECKOBJ64-NEXT: 24: 00 00 00 00 {{[[:space:]] *}} +;CHECKOBJ64-NEXT: 00000028 : +;CHECKOBJ64-NEXT: ... +;CHECKOBJ64-NEXT: 34: 00 00 00 40 +;CHECKOBJ64-NEXT: ... + +;CHECKSECT64: Sections [ +;CHECKSECT64-NEXT: Section { +;CHECKSECT64-NEXT: Index: 1 +;CHECKSECT64-NEXT: Name: .text +;CHECKSECT64-NEXT: PhysicalAddress: 0x0 +;CHECKSECT64-NEXT: VirtualAddress: 0x0 +;CHECKSECT64-NEXT: Size: 0x14 +;CHECKSECT64-NEXT: RawDataOffset: 0xA8 +;CHECKSECT64-NEXT: RelocationPointer: 0x0 +;CHECKSECT64-NEXT: LineNumberPointer: 0x0 +;CHECKSECT64-NEXT: NumberOfRelocations: 0 +;CHECKSECT64-NEXT: NumberOfLineNumbers: 0 +;CHECKSECT64-NEXT: Type: STYP_TEXT (0x20) +;CHECKSECT64-NEXT: } +;CHECKSECT64-NEXT: Section { +;CHECKSECT64-NEXT: Index: 2 +;CHECKSECT64-NEXT: Name: .data +;CHECKSECT64-NEXT: PhysicalAddress: 0x18 +;CHECKSECT64-NEXT: VirtualAddress: 0x18 +;CHECKSECT64-NEXT: Size: 0x28 +;CHECKSECT64-NEXT: RawDataOffset: 0xBC +;CHECKSECT64-NEXT: RelocationPointer: 0xE4 +;CHECKSECT64-NEXT: LineNumberPointer: 0x0 +;CHECKSECT64-NEXT: NumberOfRelocations: 2 +;CHECKSECT64-NEXT: NumberOfLineNumbers: 0 +;CHECKSECT64-NEXT: Type: STYP_DATA (0x40) +;CHECKSECT64-NEXT: } +;CHECKSECT64-NEXT: ] 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 @@ -10,8 +10,15 @@ ; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefixes=SYMS,SYMS-NODATASECT %s ; RUN: llvm-objdump -D --symbol-description %t.o | FileCheck --check-prefixes=OBJDUMP-NODATASECT %s -; RUN: not --crash llc -mtriple powerpc64-ibm-aix-xcoff -filetype=obj < %s 2>&1 | FileCheck --check-prefix=XCOFF64 %s -; XCOFF64: LLVM ERROR: 64-bit XCOFF object files are not supported yet. +; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -filetype=obj -o %t.o < %s +; RUN: llvm-readobj --section-headers %t.o | FileCheck --check-prefix=SECTION64 %s +; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefixes=SYMS64,SYMS64-DATASECT %s +; RUN: llvm-objdump -D --symbol-description %t.o | FileCheck --check-prefixes=OBJDUMP-DATASECT64 %s + +; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -data-sections=false -filetype=obj -o %t.o < %s +; RUN: llvm-readobj --section-headers %t.o | FileCheck --check-prefix=SECTION64 %s +; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefixes=SYMS64,SYMS64-NODATASECT %s +; RUN: llvm-objdump -D --symbol-description %t.o | FileCheck --check-prefixes=OBJDUMP-NODATASECT64 %s ; SECTION: File: {{.*}}aix-tls-xcoff-variables.ll.tmp.o ; SECTION-NEXT: Format: aixcoff-rs6000 @@ -644,3 +651,600 @@ @tls_global_long_long_weak_zero_initialized = weak thread_local global i64 0, align 8 @tls_global_alias_int_external_val_initialized = thread_local alias i32, i32* @tls_global_int_external_val_initialized @const_ivar = constant i32 6, align 4 + + +; SECTION64: File: {{.*}}aix-tls-xcoff-variables.ll.tmp.o +; SECTION64-NEXT: Format: aix5coff64-rs6000 +; SECTION64-NEXT: Arch: powerpc64 +; SECTION64-NEXT: AddressSize: 64bit +; SECTION64-NEXT: Sections [ +; SECTION64-NEXT: Section { +; SECTION64-NEXT: Index: 1 +; SECTION64-NEXT: Name: .text +; SECTION64-NEXT: PhysicalAddress: 0x0 +; SECTION64-NEXT: VirtualAddress: 0x0 +; SECTION64-NEXT: Size: 0x4 +; SECTION64-NEXT: RawDataOffset: 0xF0 +; SECTION64-NEXT: RelocationPointer: 0x0 +; SECTION64-NEXT: LineNumberPointer: 0x0 +; SECTION64-NEXT: NumberOfRelocations: 0 +; SECTION64-NEXT: NumberOfLineNumbers: 0 +; SECTION64-NEXT: Type: STYP_TEXT (0x20) +; SECTION64-NEXT: } +; SECTION64-NEXT: Section { +; SECTION64-NEXT: Index: 2 +; SECTION64-NEXT: Name: .tdata +; SECTION64-NEXT: PhysicalAddress: 0x0 +; SECTION64-NEXT: VirtualAddress: 0x0 +; SECTION64-NEXT: Size: 0x30 +; SECTION64-NEXT: RawDataOffset: 0xF4 +; SECTION64-NEXT: RelocationPointer: 0x0 +; SECTION64-NEXT: LineNumberPointer: 0x0 +; SECTION64-NEXT: NumberOfRelocations: 0 +; SECTION64-NEXT: NumberOfLineNumbers: 0 +; SECTION64-NEXT: Type: STYP_TDATA (0x400) +; SECTION64-NEXT: } +; SECTION64-NEXT: Section { +; SECTION64-NEXT: Index: 3 +; SECTION64-NEXT: Name: .tbss +; SECTION64-NEXT: PhysicalAddress: 0x30 +; SECTION64-NEXT: VirtualAddress: 0x30 +; SECTION64-NEXT: Size: 0x18 +; SECTION64-NEXT: RawDataOffset: 0x0 +; SECTION64-NEXT: RelocationPointer: 0x0 +; SECTION64-NEXT: LineNumberPointer: 0x0 +; SECTION64-NEXT: NumberOfRelocations: 0 +; SECTION64-NEXT: NumberOfLineNumbers: 0 +; SECTION64-NEXT: Type: STYP_TBSS (0x800) +; SECTION64-NEXT: } +; SECTION64-NEXT: ] + + +; SYMS64: File: {{.*}}aix-tls-xcoff-variables.ll.tmp.o +; SYMS64-NEXT: Format: aix5coff64-rs6000 +; SYMS64-NEXT: Arch: powerpc64 +; SYMS64-NEXT: AddressSize: 64bit +; SYMS64-NEXT: Symbols [ +; SYMS64-NEXT: Symbol { +; SYMS64-NEXT: Index: 0 +; SYMS64-NEXT: Name: .file +; SYMS64-NEXT: Value (SymbolTableIndex): 0x0 +; SYMS64-NEXT: Section: N_DEBUG +; SYMS64-NEXT: Source Language ID: TB_C (0x0) +; SYMS64-NEXT: CPU Version ID: 0x0 +; SYMS64-NEXT: StorageClass: C_FILE (0x67) +; SYMS64-NEXT: NumberOfAuxEntries: 0 +; SYMS64-NEXT: } +; SYMS64-NEXT: Symbol { +; SYMS64-NEXT: Index: [[#INDX:]] +; SYMS64-NEXT: Name: tls_global_int_external_uninitialized +; SYMS64-NEXT: Value (RelocatableAddress): 0x0 +; SYMS64-NEXT: Section: N_UNDEF +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+1]] +; SYMS64-NEXT: SectionLen: 0 +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 0 +; SYMS64-NEXT: SymbolType: XTY_ER (0x0) +; SYMS64-NEXT: StorageMappingClass: XMC_UL (0x15) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } +; SYMS64-NEXT: Symbol { +; SYMS64-NEXT: Index: [[#INDX+2]] +; SYMS64-NEXT: Name: tls_global_double_external_uninitialized +; SYMS64-NEXT: Value (RelocatableAddress): 0x0 +; SYMS64-NEXT: Section: N_UNDEF +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+3]] +; SYMS64-NEXT: SectionLen: 0 +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 0 +; SYMS64-NEXT: SymbolType: XTY_ER (0x0) +; SYMS64-NEXT: StorageMappingClass: XMC_UL (0x15) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64-NEXT: Symbol { +; SYMS64-NEXT: Index: [[#INDX+4]] +; SYMS64-NEXT: Name: .text +; SYMS64-NEXT: Value (RelocatableAddress): 0x0 +; SYMS64-NEXT: Section: .text +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+5]] +; SYMS64-NEXT: SectionLen: 0 +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 2 +; SYMS64-NEXT: SymbolType: XTY_SD (0x1) +; SYMS64-NEXT: StorageMappingClass: XMC_PR (0x0) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64-NODATASECT: Symbol { +; SYMS64-NODATASECT-NEXT: Index: [[#INDX+6]] +; SYMS64-NODATASECT-NEXT: Name: .rodata +; SYMS64-NODATASECT-NEXT: Value (RelocatableAddress): 0x0 +; SYMS64-NODATASECT-NEXT: Section: .text +; SYMS64-NODATASECT-NEXT: Type: 0x0 +; SYMS64-NODATASECT-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYMS64-NODATASECT-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NODATASECT-NEXT: CSECT Auxiliary Entry { +; SYMS64-NODATASECT-NEXT: Index: [[#INDX+7]] +; SYMS64-NODATASECT-NEXT: SectionLen: 4 +; SYMS64-NODATASECT-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NODATASECT-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NODATASECT-NEXT: SymbolAlignmentLog2: 2 +; SYMS64-NODATASECT-NEXT: SymbolType: XTY_SD (0x1) +; SYMS64-NODATASECT-NEXT: StorageMappingClass: XMC_RO (0x1) +; SYMS64-NODATASECT-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NODATASECT-NEXT: } +; SYMS64-NODATASECT-NEXT: } + +; SYMS64: Symbol { +; SYMS64-DATASECT: Index: [[#INDX+6]] +; SYMS64-NODATASECT: Index: [[#INDX+8]] +; SYMS64-NEXT: Name: const_ivar +; SYMS64-NEXT: Value (RelocatableAddress): 0x0 +; SYMS64-NEXT: Section: .text +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-DATASECT: Index: [[#INDX+7]] +; SYMS64-DATASECT-NEXT: SectionLen: 4 +; SYMS64-NODATASECT: Index: [[#INDX+9]] +; SYMS64-NODATASECT-NEXT: ContainingCsectSymbolIndex: [[#INDX+6]] +; SYMS64: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-DATASECT: SymbolAlignmentLog2: 2 +; SYMS64-DATASECT-NEXT: SymbolType: XTY_SD (0x1) +; SYMS64-NODATASECT: SymbolAlignmentLog2: 0 +; SYMS64-NODATASECT-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64: StorageMappingClass: XMC_RO (0x1) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64-NODATASECT: Symbol { +; SYMS64-NODATASECT-NEXT: Index: [[#INDX+10]] +; SYMS64-NODATASECT-NEXT: Name: .tdata +; SYMS64-NODATASECT-NEXT: Value (RelocatableAddress): 0x0 +; SYMS64-NODATASECT-NEXT: Section: .tdata +; SYMS64-NODATASECT-NEXT: Type: 0x0 +; SYMS64-NODATASECT-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYMS64-NODATASECT-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NODATASECT-NEXT: CSECT Auxiliary Entry { +; SYMS64-NODATASECT-NEXT: Index: [[#INDX+11]] +; SYMS64-NODATASECT-NEXT: SectionLen: 48 +; SYMS64-NODATASECT-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NODATASECT-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NODATASECT-NEXT: SymbolAlignmentLog2: 3 +; SYMS64-NODATASECT-NEXT: SymbolType: XTY_SD (0x1) +; SYMS64-NODATASECT-NEXT: StorageMappingClass: XMC_TL (0x14) +; SYMS64-NODATASECT-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NODATASECT-NEXT: } +; SYMS64-NODATASECT-NEXT: } + +; SYMS64: Symbol { +; SYMS64-DATASECT: Index: [[#INDX+8]] +; SYMS64-NODATASECT: Index: [[#INDX+12]] +; SYMS64: Name: tls_global_int_external_val_initialized +; SYMS64-NEXT: Value (RelocatableAddress): 0x0 +; SYMS64-NEXT: Section: .tdata +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-DATASECT: Index: [[#INDX+9]] +; SYMS64-DATASECT-NEXT: SectionLen: 4 +; SYMS64-NODATASECT: Index: [[#INDX+13]] +; SYMS64-NODATASECT-NEXT: ContainingCsectSymbolIndex: [[#INDX+10]] +; SYMS64: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-DATASECT: SymbolAlignmentLog2: 2 +; SYMS64-DATASECT-NEXT: SymbolType: XTY_SD (0x1) +; SYMS64-NODATASECT: SymbolAlignmentLog2: 0 +; SYMS64-NODATASECT-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64: StorageMappingClass: XMC_TL (0x14) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-DATASECT: Index: [[#INDX+10]] +; SYMS64-NODATASECT: Index: [[#INDX+14]] +; SYMS64: Name: tls_global_alias_int_external_val_initialized +; SYMS64-NEXT: Value (RelocatableAddress): 0x0 +; SYMS64-NEXT: Section: .tdata +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-DATASECT: Index: [[#INDX+11]] +; SYMS64-DATASECT-NEXT: ContainingCsectSymbolIndex: [[#INDX+8]] +; SYMS64-NODATASECT: Index: [[#INDX+15]] +; SYMS64-NODATASECT-NEXT: ContainingCsectSymbolIndex: [[#INDX+10]] +; SYMS64: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 0 +; SYMS64-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64-NEXT: StorageMappingClass: XMC_TL (0x14) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-DATASECT: Index: [[#INDX+12]] +; SYMS64-NODATASECT: Index: [[#INDX+16]] +; SYMS64: Name: tls_global_int_external_zero_initialized +; SYMS64-NEXT: Value (RelocatableAddress): 0x4 +; SYMS64-NEXT: Section: .tdata +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-DATASECT: Index: [[#INDX+13]] +; SYMS64-DATASECT-NEXT: SectionLen: 4 +; SYMS64-NODATASECT: Index: [[#INDX+17]] +; SYMS64-NODATASECT-NEXT: ContainingCsectSymbolIndex: [[#INDX+10]] +; SYMS64: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-DATASECT: SymbolAlignmentLog2: 2 +; SYMS64-DATASECT-NEXT: SymbolType: XTY_SD (0x1) +; SYMS64-NODATASECT: SymbolAlignmentLog2: 0 +; SYMS64-NODATASECT-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64: StorageMappingClass: XMC_TL (0x14) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-DATASECT: Index: [[#INDX+14]] +; SYMS64-NODATASECT: Index: [[#INDX+18]] +; SYMS64: Name: tls_global_int_local_val_initialized +; SYMS64-NEXT: Value (RelocatableAddress): 0x8 +; SYMS64-NEXT: Section: .tdata +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-DATASECT: Index: [[#INDX+15]] +; SYMS64-DATASECT-NEXT: SectionLen: 4 +; SYMS64-NODATASECT: Index: [[#INDX+19]] +; SYMS64-NODATASECT-NEXT: ContainingCsectSymbolIndex: [[#INDX+10]] +; SYMS64: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-DATASECT: SymbolAlignmentLog2: 2 +; SYMS64-DATASECT-NEXT: SymbolType: XTY_SD (0x1) +; SYMS64-NODATASECT: SymbolAlignmentLog2: 0 +; SYMS64-NODATASECT-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64: StorageMappingClass: XMC_TL (0x14) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-DATASECT: Index: [[#INDX+16]] +; SYMS64-NODATASECT: Index: [[#INDX+20]] +; SYMS64: Name: tls_global_int_weak_zero_initialized +; SYMS64-NEXT: Value (RelocatableAddress): 0xC +; SYMS64-NEXT: Section: .tdata +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_WEAKEXT (0x6F) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-DATASECT: Index: [[#INDX+17]] +; SYMS64-DATASECT-NEXT: SectionLen: 4 +; SYMS64-NODATASECT: Index: [[#INDX+21]] +; SYMS64-NODATASECT-NEXT: ContainingCsectSymbolIndex: [[#INDX+10]] +; SYMS64: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-DATASECT: SymbolAlignmentLog2: 2 +; SYMS64-DATASECT-NEXT: SymbolType: XTY_SD (0x1) +; SYMS64-NODATASECT: SymbolAlignmentLog2: 0 +; SYMS64-NODATASECT-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64: StorageMappingClass: XMC_TL (0x14) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-DATASECT: Index: [[#INDX+18]] +; SYMS64-NODATASECT: Index: [[#INDX+22]] +; SYMS64: Name: tls_global_int_weak_val_initialized +; SYMS64-NEXT: Value (RelocatableAddress): 0x10 +; SYMS64-NEXT: Section: .tdata +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_WEAKEXT (0x6F) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-DATASECT: Index: [[#INDX+19]] +; SYMS64-DATASECT-NEXT: SectionLen: 4 +; SYMS64-NODATASECT: Index: [[#INDX+23]] +; SYMS64-NODATASECT-NEXT: ContainingCsectSymbolIndex: [[#INDX+10]] +; SYMS64: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-DATASECT: SymbolAlignmentLog2: 2 +; SYMS64-DATASECT-NEXT: SymbolType: XTY_SD (0x1) +; SYMS64-NODATASECT: SymbolAlignmentLog2: 0 +; SYMS64-NODATASECT-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64: StorageMappingClass: XMC_TL (0x14) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-DATASECT: Index: [[#INDX+20]] +; SYMS64-NODATASECT: Index: [[#INDX+24]] +; SYMS64: Name: tls_global_long_long_internal_val_initialized +; SYMS64-NEXT: Value (RelocatableAddress): 0x18 +; SYMS64-NEXT: Section: .tdata +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-DATASECT: Index: [[#INDX+21]] +; SYMS64-DATASECT-NEXT: SectionLen: 8 +; SYMS64-NODATASECT: Index: [[#INDX+25]] +; SYMS64-NODATASECT-NEXT: ContainingCsectSymbolIndex: [[#INDX+10]] +; SYMS64: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-DATASECT: SymbolAlignmentLog2: 3 +; SYMS64-DATASECT-NEXT: SymbolType: XTY_SD (0x1) +; SYMS64-NODATASECT: SymbolAlignmentLog2: 0 +; SYMS64-NODATASECT-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64: StorageMappingClass: XMC_TL (0x14) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-DATASECT: Index: [[#INDX+22]] +; SYMS64-NODATASECT: Index: [[#INDX+26]] +; SYMS64: Name: tls_global_long_long_weak_val_initialized +; SYMS64-NEXT: Value (RelocatableAddress): 0x20 +; SYMS64-NEXT: Section: .tdata +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_WEAKEXT (0x6F) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-DATASECT: Index: [[#INDX+23]] +; SYMS64-DATASECT-NEXT: SectionLen: 8 +; SYMS64-NODATASECT: Index: [[#INDX+27]] +; SYMS64-NODATASECT-NEXT: ContainingCsectSymbolIndex: [[#INDX+10]] +; SYMS64: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-DATASECT: SymbolAlignmentLog2: 3 +; SYMS64-DATASECT-NEXT: SymbolType: XTY_SD (0x1) +; SYMS64-NODATASECT: SymbolAlignmentLog2: 0 +; SYMS64-NODATASECT-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64: StorageMappingClass: XMC_TL (0x14) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-DATASECT: Index: [[#INDX+24]] +; SYMS64-NODATASECT: Index: [[#INDX+28]] +; SYMS64: Name: tls_global_long_long_weak_zero_initialized +; SYMS64-NEXT: Value (RelocatableAddress): 0x28 +; SYMS64-NEXT: Section: .tdata +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_WEAKEXT (0x6F) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-DATASECT: Index: [[#INDX+25]] +; SYMS64-DATASECT-NEXT: SectionLen: 8 +; SYMS64-NODATASECT: Index: [[#INDX+29]] +; SYMS64-NODATASECT-NEXT: ContainingCsectSymbolIndex: [[#INDX+10]] +; SYMS64: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-DATASECT: SymbolAlignmentLog2: 3 +; SYMS64-DATASECT-NEXT: SymbolType: XTY_SD (0x1) +; SYMS64-NODATASECT: SymbolAlignmentLog2: 0 +; SYMS64-NODATASECT-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64: StorageMappingClass: XMC_TL (0x14) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-DATASECT: Index: [[#INDX+26]] +; SYMS64-NODATASECT: Index: [[#INDX+30]] +; SYMS64: Name: tls_global_int_local_zero_initialized +; SYMS64-NEXT: Value (RelocatableAddress): 0x30 +; SYMS64-NEXT: Section: .tbss +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-DATASECT: Index: [[#INDX+27]] +; SYMS64-NODATASECT: Index: [[#INDX+31]] +; SYMS64: SectionLen: 4 +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 2 +; SYMS64-NEXT: SymbolType: XTY_CM (0x3) +; SYMS64-NEXT: StorageMappingClass: XMC_UL (0x15) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-DATASECT: Index: [[#INDX+28]] +; SYMS64-NODATASECT: Index: [[#INDX+32]] +; SYMS64: Name: tls_global_int_common_zero_initialized +; SYMS64-NEXT: Value (RelocatableAddress): 0x34 +; SYMS64-NEXT: Section: .tbss +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-DATASECT: Index: [[#INDX+29]] +; SYMS64-NODATASECT: Index: [[#INDX+33]] +; SYMS64: SectionLen: 4 +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 2 +; SYMS64-NEXT: SymbolType: XTY_CM (0x3) +; SYMS64-NEXT: StorageMappingClass: XMC_UL (0x15) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-DATASECT: Index: [[#INDX+30]] +; SYMS64-NODATASECT: Index: [[#INDX+34]] +; SYMS64: Name: tls_global_double_common_zero_initialized +; SYMS64-NEXT: Value (RelocatableAddress): 0x38 +; SYMS64-NEXT: Section: .tbss +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-DATASECT: Index: [[#INDX+31]] +; SYMS64-NODATASECT: Index: [[#INDX+35]] +; SYMS64: SectionLen: 8 +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 3 +; SYMS64-NEXT: SymbolType: XTY_CM (0x3) +; SYMS64-NEXT: StorageMappingClass: XMC_UL (0x15) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-DATASECT: Index: [[#INDX+32]] +; SYMS64-NODATASECT: Index: [[#INDX+36]] +; SYMS64: Name: tls_global_long_long_internal_zero_initialized +; SYMS64-NEXT: Value (RelocatableAddress): 0x40 +; SYMS64-NEXT: Section: .tbss +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-DATASECT: Index: [[#INDX+33]] +; SYMS64-NODATASECT: Index: [[#INDX+37]] +; SYMS64: SectionLen: 8 +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 3 +; SYMS64-NEXT: SymbolType: XTY_CM (0x3) +; SYMS64-NEXT: StorageMappingClass: XMC_UL (0x15) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + + +; OBJDUMP-DATASECT64: Disassembly of section .text: +; OBJDUMP-DATASECT64-EMPTY: +; OBJDUMP-DATASECT64-NEXT: 00000000 (idx: 7) const_ivar[RO]: +; OBJDUMP-DATASECT64-NEXT: 0: 00 00 00 06 +; OBJDUMP-DATASECT64-EMPTY: +; OBJDUMP-DATASECT64-NEXT: Disassembly of section .tdata: +; OBJDUMP-DATASECT64-EMPTY: +; OBJDUMP-DATASECT64-NEXT: 00000000 (idx: 11) tls_global_alias_int_external_val_initialized: +; OBJDUMP-DATASECT64-NEXT: 0: 00 00 00 01 +; OBJDUMP-DATASECT64-EMPTY: +; OBJDUMP-DATASECT64-NEXT: 00000004 (idx: 13) tls_global_int_external_zero_initialized[TL]: +; OBJDUMP-DATASECT64-NEXT: 4: 00 00 00 00 +; OBJDUMP-DATASECT64-EMPTY: +; OBJDUMP-DATASECT64-NEXT: 00000008 (idx: 15) tls_global_int_local_val_initialized[TL]: +; OBJDUMP-DATASECT64-NEXT: 8: 00 00 00 02 +; OBJDUMP-DATASECT64-EMPTY: +; OBJDUMP-DATASECT64-NEXT: 0000000c (idx: 17) tls_global_int_weak_zero_initialized[TL]: +; OBJDUMP-DATASECT64-NEXT: c: 00 00 00 00 +; OBJDUMP-DATASECT64-EMPTY: +; OBJDUMP-DATASECT64-NEXT: 00000010 (idx: 19) tls_global_int_weak_val_initialized[TL]: +; OBJDUMP-DATASECT64-NEXT: 10: 00 00 00 01 +; OBJDUMP-DATASECT64-NEXT: 14: 00 00 00 00 +; OBJDUMP-DATASECT64-EMPTY: +; OBJDUMP-DATASECT64-NEXT: 00000018 (idx: 21) tls_global_long_long_internal_val_initialized[TL]: +; OBJDUMP-DATASECT64-NEXT: 18: 00 00 00 00 +; OBJDUMP-DATASECT64-NEXT: 1c: 00 00 00 01 +; OBJDUMP-DATASECT64-EMPTY: +; OBJDUMP-DATASECT64-NEXT: 00000020 (idx: 23) tls_global_long_long_weak_val_initialized[TL]: +; OBJDUMP-DATASECT64-NEXT: 20: 00 00 00 00 +; OBJDUMP-DATASECT64-NEXT: 24: 00 00 00 01 +; OBJDUMP-DATASECT64-EMPTY: +; OBJDUMP-DATASECT64-NEXT: 00000028 (idx: 25) tls_global_long_long_weak_zero_initialized[TL]: +; OBJDUMP-DATASECT64-NEXT: ... +; OBJDUMP-DATASECT64-EMPTY: + +; OBJDUMP-DATASECT64-NEXT: Disassembly of section .tbss: +; OBJDUMP-DATASECT64-EMPTY: +; OBJDUMP-DATASECT64-NEXT: 00000030 (idx: 27) tls_global_int_local_zero_initialized[UL]: +; OBJDUMP-DATASECT64-NEXT: ... +; OBJDUMP-DATASECT64-EMPTY: +; OBJDUMP-DATASECT64-NEXT: 00000034 (idx: 29) tls_global_int_common_zero_initialized[UL]: +; OBJDUMP-DATASECT64-NEXT: ... +; OBJDUMP-DATASECT64-EMPTY: +; OBJDUMP-DATASECT64-NEXT: 00000038 (idx: 31) tls_global_double_common_zero_initialized[UL] +; OBJDUMP-DATASECT64-NEXT: ... +; OBJDUMP-DATASECT64-EMPTY: +; OBJDUMP-DATASECT64-NEXT: 00000040 (idx: 33) tls_global_long_long_internal_zero_initialized[UL]: +; OBJDUMP-DATASECT64-NEXT: ... + +; OBJDUMP-NODATASECT64: Disassembly of section .text: +; OBJDUMP-NODATASECT64-EMPTY: +; OBJDUMP-NODATASECT64-NEXT: 00000000 (idx: 9) const_ivar: +; OBJDUMP-NODATASECT64-NEXT: 0: 00 00 00 06 +; OBJDUMP-NODATASECT64-EMPTY: +; OBJDUMP-NODATASECT64-NEXT: Disassembly of section .tdata: +; OBJDUMP-NODATASECT64-EMPTY: +; OBJDUMP-NODATASECT64: 00000000 (idx: 13) tls_global_int_external_val_initialized: +; OBJDUMP-NODATASECT64-NEXT: 0: 00 00 00 01 +; OBJDUMP-NODATASECT64-EMPTY: +; OBJDUMP-NODATASECT64-NEXT: 00000004 (idx: 17) tls_global_int_external_zero_initialized: +; OBJDUMP-NODATASECT64-NEXT: 4: 00 00 00 00 +; OBJDUMP-NODATASECT64-EMPTY: +; OBJDUMP-NODATASECT64-NEXT: 00000008 (idx: 19) tls_global_int_local_val_initialized: +; OBJDUMP-NODATASECT64-NEXT: 8: 00 00 00 02 +; OBJDUMP-NODATASECT64-EMPTY: +; OBJDUMP-NODATASECT64-NEXT: 0000000c (idx: 21) tls_global_int_weak_zero_initialized: +; OBJDUMP-NODATASECT64-NEXT: c: 00 00 00 00 +; OBJDUMP-NODATASECT64-EMPTY: +; OBJDUMP-NODATASECT64-NEXT: 00000010 (idx: 23) tls_global_int_weak_val_initialized: +; OBJDUMP-NODATASECT64-NEXT: 10: 00 00 00 01 +; OBJDUMP-NODATASECT64-NEXT: 14: 00 00 00 00 +; OBJDUMP-NODATASECT64-EMPTY: +; OBJDUMP-NODATASECT64-NEXT: 00000018 (idx: 25) tls_global_long_long_internal_val_initialized: +; OBJDUMP-NODATASECT64-NEXT: 18: 00 00 00 00 +; OBJDUMP-NODATASECT64-NEXT: 1c: 00 00 00 01 +; OBJDUMP-NODATASECT64-EMPTY: +; OBJDUMP-NODATASECT64-NEXT: 00000020 (idx: 27) tls_global_long_long_weak_val_initialized: +; OBJDUMP-NODATASECT64-NEXT: 20: 00 00 00 00 +; OBJDUMP-NODATASECT64-NEXT: 24: 00 00 00 01 +; OBJDUMP-NODATASECT64-EMPTY: +; OBJDUMP-NODATASECT64-NEXT: 00000028 (idx: 29) tls_global_long_long_weak_zero_initialized: +; OBJDUMP-NODATASECT64-NEXT: ... +; OBJDUMP-NODATASECT64-EMPTY: + +; OBJDUMP-NODATASECT64-NEXT: Disassembly of section .tbss: +; OBJDUMP-NODATASECT64-EMPTY: +; OBJDUMP-NODATASECT64-NEXT: 00000030 (idx: 31) tls_global_int_local_zero_initialized[UL]: +; OBJDUMP-NODATASECT64-NEXT: ... +; OBJDUMP-NODATASECT64-EMPTY: +; OBJDUMP-NODATASECT64-NEXT: 00000034 (idx: 33) tls_global_int_common_zero_initialized[UL]: +; OBJDUMP-NODATASECT64-NEXT: ... +; OBJDUMP-NODATASECT64-EMPTY: +; OBJDUMP-NODATASECT64-NEXT: 00000038 (idx: 35) tls_global_double_common_zero_initialized[UL]: +; OBJDUMP-NODATASECT64-NEXT: ... +; OBJDUMP-NODATASECT64-EMPTY: +; OBJDUMP-NODATASECT64-NEXT: 00000040 (idx: 37) tls_global_long_long_internal_zero_initialized[UL]: +; OBJDUMP-NODATASECT64-NEXT: ... diff --git a/llvm/test/CodeGen/PowerPC/aix-user-defined-memcpy.ll b/llvm/test/CodeGen/PowerPC/aix-user-defined-memcpy.ll --- a/llvm/test/CodeGen/PowerPC/aix-user-defined-memcpy.ll +++ b/llvm/test/CodeGen/PowerPC/aix-user-defined-memcpy.ll @@ -12,9 +12,19 @@ ; RUN: -mcpu=pwr4 -mattr=-altivec < %s | \ ; RUN: FileCheck %s -; RUN: not --crash llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff \ -; RUN: -mcpu=pwr4 -mattr=-altivec -filetype=obj < %s 2>&1 | FileCheck \ -; RUN: --check-prefix=64-CHECK %s +; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \ +; RUN: -mattr=-altivec -filetype=obj -xcoff-traceback-table=false -o %t.o < %s + +; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefix=64-SYM %s + +; RUN: llvm-readobj --relocs --expand-relocs %t.o | FileCheck \ +; RUN: --check-prefix=64-REL %s + +; RUN: llvm-objdump -D %t.o | FileCheck --check-prefix=64-DIS %s + +; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff \ +; RUN: -mcpu=pwr4 -mattr=-altivec < %s | \ +; RUN: FileCheck %s ; Test verifies: ; If there exists a user-defined function whose name is the same as the @@ -118,4 +128,78 @@ ; 32-DIS-NEXT: 2c: 7c 08 03 a6 mtlr 0 ; 32-DIS-NEXT: 30: 4e 80 00 20 blr -; 64-CHECK: LLVM ERROR: 64-bit XCOFF object files are not supported yet. +; 64-SYM: Symbol {{[{][[:space:]] *}}Index: [[#Index:]]{{[[:space:]] *}}Name: .memcpy +; 64-SYM-NEXT: Value (RelocatableAddress): 0x0 +; 64-SYM-NEXT: Section: .text +; 64-SYM-NEXT: Type: 0x0 +; 64-SYM-NEXT: StorageClass: C_EXT (0x2) +; 64-SYM-NEXT: NumberOfAuxEntries: 1 +; 64-SYM-NEXT: CSECT Auxiliary Entry { +; 64-SYM-NEXT: Index: 4 +; 64-SYM-NEXT: ContainingCsectSymbolIndex: 1 +; 64-SYM-NEXT: ParameterHashIndex: 0x0 +; 64-SYM-NEXT: TypeChkSectNum: 0x0 +; 64-SYM-NEXT: SymbolAlignmentLog2: 0 +; 64-SYM-NEXT: SymbolType: XTY_LD (0x2) +; 64-SYM-NEXT: StorageMappingClass: XMC_PR (0x0) +; 64-SYM-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; 64-SYM-NEXT: } +; 64-SYM-NEXT: } + +; 64-SYM-NOT: .memcpy + +; 64-REL: Relocations [ +; 64-REL-NEXT: Section (index: 2) .data { +; 64-REL-NEXT: Relocation { +; 64-REL-NEXT: Virtual Address: 0x38 +; 64-REL-NEXT: Symbol: .memcpy (3) +; 64-REL-NEXT: IsSigned: No +; 64-REL-NEXT: FixupBitValue: 0 +; 64-REL-NEXT: Length: 64 +; 64-REL-NEXT: Type: R_POS (0x0) +; 64-REL-NEXT: } +; 64-REL-NEXT: Relocation { +; 64-REL-NEXT: Virtual Address: 0x40 +; 64-REL-NEXT: Symbol: TOC (11) +; 64-REL-NEXT: IsSigned: No +; 64-REL-NEXT: FixupBitValue: 0 +; 64-REL-NEXT: Length: 64 +; 64-REL-NEXT: Type: R_POS (0x0) +; 64-REL-NEXT: } +; 64-REL-NEXT: Relocation { +; 64-REL-NEXT: Virtual Address: 0x50 +; 64-REL-NEXT: Symbol: .call_memcpy (5) +; 64-REL-NEXT: IsSigned: No +; 64-REL-NEXT: FixupBitValue: 0 +; 64-REL-NEXT: Length: 64 +; 64-REL-NEXT: Type: R_POS (0x0) +; 64-REL-NEXT: } +; 64-REL-NEXT: Relocation { +; 64-REL-NEXT: Virtual Address: 0x58 +; 64-REL-NEXT: Symbol: TOC (11) +; 64-REL-NEXT: IsSigned: No +; 64-REL-NEXT: FixupBitValue: 0 +; 64-REL-NEXT: Length: 64 +; 64-REL-NEXT: Type: R_POS (0x0) +; 64-REL-NEXT: } +; 64-REL-NEXT: } +; 64-REL-NEXT: ] + +; 64-REL-NOT: Type: R_RBR (0x1A) + +; 64-DIS: Disassembly of section .text: +; 64-DIS: 00000000 <.text>: +; 64-DIS-NEXT: 0: 38 60 00 03 li 3, 3 +; 64-DIS-NEXT: 4: 4e 80 00 20 blr +; 64-DIS-NEXT: 8: 60 00 00 00 nop +; 64-DIS-NEXT: c: 60 00 00 00 nop +; 64-DIS: 00000010 <.call_memcpy>: +; 64-DIS-NEXT: 10: 7c 08 02 a6 mflr 0 +; 64-DIS-NEXT: 14: f8 01 00 10 std 0, 16(1) +; 64-DIS-NEXT: 18: f8 21 ff 91 stdu 1, -112(1) +; 64-DIS-NEXT: 1c: 4b ff ff e5 bl 0x0 +; 64-DIS-NEXT: 20: 60 00 00 00 nop +; 64-DIS-NEXT: 24: 38 21 00 70 addi 1, 1, 112 +; 64-DIS-NEXT: 28: e8 01 00 10 ld 0, 16(1) +; 64-DIS-NEXT: 2c: 7c 08 03 a6 mtlr 0 +; 64-DIS-NEXT: 30: 4e 80 00 20 blr 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 @@ -8,10 +8,9 @@ ; RUN: -mattr=-altivec -data-sections=false -filetype=obj -o %t.o < %s ; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefix=CHECKSYM %s -; RUN: not --crash llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff \ -; RUN: -mattr=-altivec -data-sections=false -filetype=obj -o %t.o 2>&1 < %s | \ -; RUN: FileCheck --check-prefix=XCOFF64 %s -; XCOFF64: LLVM ERROR: 64-bit XCOFF object files are not supported yet. +; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -xcoff-traceback-table=false -mcpu=pwr4 \ +; RUN: -mattr=-altivec -data-sections=false -filetype=obj -o %t.o < %s +; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefix=CHECKSYM64 %s @foo_weak_p = global void (...)* bitcast (void ()* @foo_ref_weak to void (...)*), align 4 @b = weak global i32 0, align 4 @@ -371,3 +370,263 @@ ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: } ; CHECKSYM-NEXT: ] + +; CHECKSYM64: Symbols [ +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: 0 +; CHECKSYM64-NEXT: Name: .file +; CHECKSYM64-NEXT: Value (SymbolTableIndex): 0x0 +; CHECKSYM64-NEXT: Section: N_DEBUG +; CHECKSYM64-NEXT: Source Language ID: TB_C (0x0) +; CHECKSYM64-NEXT: CPU Version ID: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_FILE (0x67) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 0 +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: [[#Index:]] +; CHECKSYM64-NEXT: Name: .text +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x0 +; CHECKSYM64-NEXT: Section: .text +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: [[#Index+1]] +; CHECKSYM64-NEXT: SectionLen: 136 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 4 +; CHECKSYM64-NEXT: SymbolType: XTY_SD (0x1) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_PR (0x0) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: [[#Index+2]] +; CHECKSYM64-NEXT: Name: .foo_weak +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x0 +; CHECKSYM64-NEXT: Section: .text +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_WEAKEXT (0x6F) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: [[#Index+3]] +; CHECKSYM64-NEXT: ContainingCsectSymbolIndex: [[#Index]] +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 0 +; CHECKSYM64-NEXT: SymbolType: XTY_LD (0x2) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_PR (0x0) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: [[#Index+4]] +; CHECKSYM64-NEXT: Name: .foo_ref_weak +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x20 +; CHECKSYM64-NEXT: Section: .text +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_WEAKEXT (0x6F) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: [[#Index+5]] +; CHECKSYM64-NEXT: ContainingCsectSymbolIndex: [[#Index]] +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 0 +; CHECKSYM64-NEXT: SymbolType: XTY_LD (0x2) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_PR (0x0) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: [[#Index+6]] +; CHECKSYM64-NEXT: Name: .main +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x30 +; CHECKSYM64-NEXT: Section: .text +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_EXT (0x2) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: [[#Index+7]] +; CHECKSYM64-NEXT: ContainingCsectSymbolIndex: [[#Index]] +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 0 +; CHECKSYM64-NEXT: SymbolType: XTY_LD (0x2) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_PR (0x0) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: [[#Index+8]] +; CHECKSYM64-NEXT: Name: .data +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x88 +; CHECKSYM64-NEXT: Section: .data +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: [[#Index+9]] +; CHECKSYM64-NEXT: SectionLen: 12 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3 +; CHECKSYM64-NEXT: SymbolType: XTY_SD (0x1) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_RW (0x5) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: [[#Index+10]] +; CHECKSYM64-NEXT: Name: foo_weak_p +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x88 +; CHECKSYM64-NEXT: Section: .data +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_EXT (0x2) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: [[#Index+11]] +; CHECKSYM64-NEXT: ContainingCsectSymbolIndex: [[#Index+8]] +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 0 +; CHECKSYM64-NEXT: SymbolType: XTY_LD (0x2) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_RW (0x5) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: [[#Index+12]] +; CHECKSYM64-NEXT: Name: b +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x90 +; CHECKSYM64-NEXT: Section: .data +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_WEAKEXT (0x6F) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: [[#Index+13]] +; CHECKSYM64-NEXT: ContainingCsectSymbolIndex: [[#Index+8]] +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 0 +; CHECKSYM64-NEXT: SymbolType: XTY_LD (0x2) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_RW (0x5) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: [[#Index+14]] +; CHECKSYM64-NEXT: Name: foo_weak +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0x98 +; CHECKSYM64-NEXT: Section: .data +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_WEAKEXT (0x6F) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: [[#Index+15]] +; CHECKSYM64-NEXT: SectionLen: 24 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3 +; CHECKSYM64-NEXT: SymbolType: XTY_SD (0x1) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_DS (0xA) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: [[#Index+16]] +; CHECKSYM64-NEXT: Name: foo_ref_weak +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0xB0 +; CHECKSYM64-NEXT: Section: .data +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_WEAKEXT (0x6F) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: [[#Index+17]] +; CHECKSYM64-NEXT: SectionLen: 24 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3 +; CHECKSYM64-NEXT: SymbolType: XTY_SD (0x1) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_DS (0xA) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: [[#Index+18]] +; CHECKSYM64-NEXT: Name: main +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0xC8 +; CHECKSYM64-NEXT: Section: .data +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_EXT (0x2) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: [[#Index+19]] +; CHECKSYM64-NEXT: SectionLen: 24 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3 +; CHECKSYM64-NEXT: SymbolType: XTY_SD (0x1) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_DS (0xA) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: [[#Index+20]] +; CHECKSYM64-NEXT: Name: TOC +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0xE0 +; CHECKSYM64-NEXT: Section: .data +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: [[#Index+21]] +; CHECKSYM64-NEXT: SectionLen: 0 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 2 +; CHECKSYM64-NEXT: SymbolType: XTY_SD (0x1) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_TC0 (0xF) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: [[#Index+22]] +; CHECKSYM64-NEXT: Name: foo_weak_p +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0xE0 +; CHECKSYM64-NEXT: Section: .data +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: [[#Index+23]] +; CHECKSYM64-NEXT: SectionLen: 8 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3 +; CHECKSYM64-NEXT: SymbolType: XTY_SD (0x1) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_TC (0x3) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: Symbol { +; CHECKSYM64-NEXT: Index: [[#Index+24]] +; CHECKSYM64-NEXT: Name: b +; CHECKSYM64-NEXT: Value (RelocatableAddress): 0xE8 +; CHECKSYM64-NEXT: Section: .data +; CHECKSYM64-NEXT: Type: 0x0 +; CHECKSYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; CHECKSYM64-NEXT: NumberOfAuxEntries: 1 +; CHECKSYM64-NEXT: CSECT Auxiliary Entry { +; CHECKSYM64-NEXT: Index: [[#Index+25]] +; CHECKSYM64-NEXT: SectionLen: 8 +; CHECKSYM64-NEXT: ParameterHashIndex: 0x0 +; CHECKSYM64-NEXT: TypeChkSectNum: 0x0 +; CHECKSYM64-NEXT: SymbolAlignmentLog2: 3 +; CHECKSYM64-NEXT: SymbolType: XTY_SD (0x1) +; CHECKSYM64-NEXT: StorageMappingClass: XMC_TC (0x3) +; CHECKSYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: } +; CHECKSYM64-NEXT: ] diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-data-only-notoc.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-data-only-notoc.ll --- a/llvm/test/CodeGen/PowerPC/aix-xcoff-data-only-notoc.ll +++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-data-only-notoc.ll @@ -1,12 +1,11 @@ ; RUN: llc -mtriple powerpc-ibm-aix-xcoff < %s | FileCheck %s -; RUN: llc -mtriple powerpc64-ibm-aix-xcoff < %s 2>&1 | FileCheck %s +; RUN: llc -mtriple powerpc64-ibm-aix-xcoff < %s | FileCheck %s ; RUN: llc -mtriple powerpc-ibm-aix-xcoff -filetype=obj -o %t.o < %s ; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefix=SYMS %s -; RUN: not --crash llc -mtriple powerpc64-ibm-aix-xcoff -filetype=obj < %s 2>&1 | \ -; RUN: FileCheck --check-prefix=OBJ64 %s -; OBJ64: LLVM ERROR: 64-bit XCOFF object files are not supported yet. +; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -filetype=obj -o %t.o < %s +; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefix=SYMS %s @a = external global i32, align 4 @b = external global i64, align 8 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 @@ -9,9 +9,10 @@ ; RUN: FileCheck --check-prefix=OBJ %s ; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefix=SYMS %s -; RUN: not --crash llc -mtriple powerpc64-ibm-aix-xcoff -data-sections=false -filetype=obj < %s 2>&1 | \ -; RUN: FileCheck --check-prefix=XCOFF64 %s -; XCOFF64: LLVM ERROR: 64-bit XCOFF object files are not supported yet. +; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -data-sections=false -filetype=obj -o %t.o < %s +; RUN: llvm-readobj --section-headers --file-header %t.o | \ +; RUN: FileCheck --check-prefix=OBJ64 %s +; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefix=SYMS64 %s @ivar = local_unnamed_addr global i32 35, align 4 @llvar = local_unnamed_addr global i64 36, align 8 @@ -204,6 +205,64 @@ ; OBJ-NEXT: } ; OBJ: ] +; OBJ64: File: {{.*}}aix-xcoff-data.ll.tmp.o +; OBJ64-NEXT: Format: aix5coff64-rs6000 +; OBJ64-NEXT: Arch: powerpc64 +; OBJ64-NEXT: AddressSize: 64bit +; OBJ64-NEXT: FileHeader { +; OBJ64-NEXT: Magic: 0x1F7 +; OBJ64-NEXT: NumberOfSections: 3 +; OBJ64-NEXT: TimeStamp: +; OBJ64-NEXT: SymbolTableOffset: 0x170 +; OBJ64-NEXT: SymbolTableEntries: 45 +; OBJ64-NEXT: OptionalHeaderSize: 0x0 +; OBJ64-NEXT: Flags: 0x0 +; OBJ64-NEXT: } + +; OBJ64: Sections [ +; OBJ64: Section { +; OBJ64-NEXT: Index: [[#OBJ_INDX:]] +; OBJ64-NEXT: Name: .text +; OBJ64-NEXT: PhysicalAddress: 0x0 +; OBJ64-NEXT: VirtualAddress: 0x0 +; OBJ64-NEXT: Size: 0x0 +; OBJ64-NEXT: RawDataOffset: 0xF0 +; OBJ64-NEXT: RelocationPointer: 0x0 +; OBJ64-NEXT: LineNumberPointer: 0x0 +; OBJ64-NEXT: NumberOfRelocations: 0 +; OBJ64-NEXT: NumberOfLineNumbers: 0 +; OBJ64-NEXT: Type: STYP_TEXT (0x20) +; OBJ64-NEXT: } + +; OBJ64: Section { +; OBJ64-NEXT: Index: [[#OBJ_INDX+1]] +; OBJ64-NEXT: Name: .data +; OBJ64-NEXT: PhysicalAddress: 0x0 +; OBJ64-NEXT: VirtualAddress: 0x0 +; OBJ64-NEXT: Size: 0x80 +; OBJ64-NEXT: RawDataOffset: 0xF0 +; OBJ64-NEXT: RelocationPointer: 0x0 +; OBJ64-NEXT: LineNumberPointer: 0x0 +; OBJ64-NEXT: NumberOfRelocations: 0 +; OBJ64-NEXT: NumberOfLineNumbers: 0 +; OBJ64-NEXT: Type: STYP_DATA (0x40) +; OBJ64-NEXT: } + +; OBJ64: Section { +; OBJ64-NEXT: Index: [[#OBJ_INDX+2]] +; OBJ64-NEXT: Name: .bss +; OBJ64-NEXT: PhysicalAddress: 0x80 +; OBJ64-NEXT: VirtualAddress: 0x80 +; OBJ64-NEXT: Size: 0x6C +; OBJ64-NEXT: RawDataOffset: 0x0 +; OBJ64-NEXT: RelocationPointer: 0x0 +; OBJ64-NEXT: LineNumberPointer: 0x0 +; OBJ64-NEXT: NumberOfRelocations: 0 +; OBJ64-NEXT: NumberOfLineNumbers: 0 +; OBJ64-NEXT: Type: STYP_BSS (0x80) +; OBJ64-NEXT: } +; OBJ64: ] + ; SYMS: File: {{.*}}aix-xcoff-data.ll.tmp.o ; SYMS-NEXT: Format: aixcoff-rs6000 ; SYMS-NEXT: Arch: powerpc @@ -681,3 +740,459 @@ ; SYMS-NEXT: } ; SYMS-NEXT: } ; SYMS: ] + +; SYMS64: File: {{.*}}aix-xcoff-data.ll.tmp.o +; SYMS64-NEXT: Format: aix5coff64-rs6000 +; SYMS64-NEXT: Arch: powerpc64 +; SYMS64-NEXT: AddressSize: 64bit +; SYMS64: Symbols [ +; SYMS64-NEXT: Symbol { +; SYMS64-NEXT: Index: 0 +; SYMS64-NEXT: Name: .file +; SYMS64-NEXT: Value (SymbolTableIndex): 0x0 +; SYMS64-NEXT: Section: N_DEBUG +; SYMS64-NEXT: Source Language ID: TB_C (0x0) +; SYMS64-NEXT: CPU Version ID: 0x0 +; SYMS64-NEXT: StorageClass: C_FILE (0x67) +; SYMS64-NEXT: NumberOfAuxEntries: 0 +; SYMS64-NEXT: } +; SYMS64-NEXT: Symbol { +; SYMS64-NEXT: Index: [[#INDX:]] +; SYMS64-NEXT: Name: .text +; SYMS64-NEXT: Value (RelocatableAddress): 0x0 +; SYMS64-NEXT: Section: .text +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+1]] +; SYMS64-NEXT: SectionLen: 0 +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 2 +; SYMS64-NEXT: SymbolType: XTY_SD (0x1) +; SYMS64-NEXT: StorageMappingClass: XMC_PR (0x0) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+2]] +; SYMS64-NEXT: Name: .data +; SYMS64-NEXT: Value (RelocatableAddress): 0x0 +; SYMS64-NEXT: Section: .data +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+3]] +; SYMS64-NEXT: SectionLen: 128 +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 5 +; SYMS64-NEXT: SymbolType: XTY_SD (0x1) +; SYMS64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+4]] +; SYMS64-NEXT: Name: ivar +; SYMS64-NEXT: Value (RelocatableAddress): 0x0 +; SYMS64-NEXT: Section: .data +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+5]] +; SYMS64-NEXT: ContainingCsectSymbolIndex: [[#INDX+2]] +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 0 +; SYMS64-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+6]] +; SYMS64-NEXT: Name: llvar +; SYMS64-NEXT: Value (RelocatableAddress): 0x8 +; SYMS64-NEXT: Section: .data +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+7]] +; SYMS64-NEXT: ContainingCsectSymbolIndex: [[#INDX+2]] +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 0 +; SYMS64-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+8]] +; SYMS64-NEXT: Name: svar +; SYMS64-NEXT: Value (RelocatableAddress): 0x10 +; SYMS64-NEXT: Section: .data +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+9]] +; SYMS64-NEXT: ContainingCsectSymbolIndex: [[#INDX+2]] +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 0 +; SYMS64-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+10]] +; SYMS64-NEXT: Name: fvar +; SYMS64-NEXT: Value (RelocatableAddress): 0x14 +; SYMS64-NEXT: Section: .data +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+11]] +; SYMS64-NEXT: ContainingCsectSymbolIndex: [[#INDX+2]] +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 0 +; SYMS64-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+12]] +; SYMS64-NEXT: Name: dvar +; SYMS64-NEXT: Value (RelocatableAddress): 0x18 +; SYMS64-NEXT: Section: .data +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+13]] +; SYMS64-NEXT: ContainingCsectSymbolIndex: [[#INDX+2]] +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 0 +; SYMS64-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+14]] +; SYMS64-NEXT: Name: over_aligned +; SYMS64-NEXT: Value (RelocatableAddress): 0x20 +; SYMS64-NEXT: Section: .data +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+15]] +; SYMS64-NEXT: ContainingCsectSymbolIndex: [[#INDX+2]] +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 0 +; SYMS64-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+16]] +; SYMS64-NEXT: Name: chrarray +; SYMS64-NEXT: Value (RelocatableAddress): 0x28 +; SYMS64-NEXT: Section: .data +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+17]] +; SYMS64-NEXT: ContainingCsectSymbolIndex: [[#INDX+2]] +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 0 +; SYMS64-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+18]] +; SYMS64-NEXT: Name: dblarr +; SYMS64-NEXT: Value (RelocatableAddress): 0x30 +; SYMS64-NEXT: Section: .data +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+19]] +; SYMS64-NEXT: ContainingCsectSymbolIndex: [[#INDX+2]] +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 0 +; SYMS64-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+20]] +; SYMS64-NEXT: Name: d_0 +; SYMS64-NEXT: Value (RelocatableAddress): 0x50 +; SYMS64-NEXT: Section: .data +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+21]] +; SYMS64-NEXT: ContainingCsectSymbolIndex: [[#INDX+2]] +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 0 +; SYMS64-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+22]] +; SYMS64-NEXT: Name: s_0 +; SYMS64-NEXT: Value (RelocatableAddress): 0x58 +; SYMS64-NEXT: Section: .data +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+23]] +; SYMS64-NEXT: ContainingCsectSymbolIndex: [[#INDX+2]] +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 0 +; SYMS64-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+24]] +; SYMS64-NEXT: Name: f_0 +; SYMS64-NEXT: Value (RelocatableAddress): 0x5C +; SYMS64-NEXT: Section: .data +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+25]] +; SYMS64-NEXT: ContainingCsectSymbolIndex: [[#INDX+2]] +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 0 +; SYMS64-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+26]] +; SYMS64-NEXT: Name: astruct +; SYMS64-NEXT: Value (RelocatableAddress): 0x60 +; SYMS64-NEXT: Section: .data +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+27]] +; SYMS64-NEXT: ContainingCsectSymbolIndex: [[#INDX+2]] +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 0 +; SYMS64-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+28]] +; SYMS64-NEXT: Name: bstruct +; SYMS64-NEXT: Value (RelocatableAddress): 0x70 +; SYMS64-NEXT: Section: .data +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+29]] +; SYMS64-NEXT: ContainingCsectSymbolIndex: [[#INDX+2]] +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 0 +; SYMS64-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+30]] +; SYMS64-NEXT: Name: a +; SYMS64-NEXT: Value (RelocatableAddress): 0x80 +; SYMS64-NEXT: Section: .bss +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+31]] +; SYMS64-NEXT: SectionLen: 4 +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 2 +; SYMS64-NEXT: SymbolType: XTY_CM (0x3) +; SYMS64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+32]] +; SYMS64-NEXT: Name: b +; SYMS64-NEXT: Value (RelocatableAddress): 0x88 +; SYMS64-NEXT: Section: .bss +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+33]] +; SYMS64-NEXT: SectionLen: 8 +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 3 +; SYMS64-NEXT: SymbolType: XTY_CM (0x3) +; SYMS64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+34]] +; SYMS64-NEXT: Name: c +; SYMS64-NEXT: Value (RelocatableAddress): 0x90 +; SYMS64-NEXT: Section: .bss +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+35]] +; SYMS64-NEXT: SectionLen: 2 +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 1 +; SYMS64-NEXT: SymbolType: XTY_CM (0x3) +; SYMS64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+36]] +; SYMS64-NEXT: Name: d +; SYMS64-NEXT: Value (RelocatableAddress): 0x98 +; SYMS64-NEXT: Section: .bss +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+37]] +; SYMS64-NEXT: SectionLen: 8 +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 3 +; SYMS64-NEXT: SymbolType: XTY_CM (0x3) +; SYMS64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+38]] +; SYMS64-NEXT: Name: f +; SYMS64-NEXT: Value (RelocatableAddress): 0xA0 +; SYMS64-NEXT: Section: .bss +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+39]] +; SYMS64-NEXT: SectionLen: 4 +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 2 +; SYMS64-NEXT: SymbolType: XTY_CM (0x3) +; SYMS64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+40]] +; SYMS64-NEXT: Name: over_aligned_comm +; SYMS64-NEXT: Value (RelocatableAddress): 0xC0 +; SYMS64-NEXT: Section: .bss +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+41]] +; SYMS64-NEXT: SectionLen: 8 +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 5 +; SYMS64-NEXT: SymbolType: XTY_CM (0x3) +; SYMS64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+42]] +; SYMS64-NEXT: Name: array +; SYMS64-NEXT: Value (RelocatableAddress): 0xC8 +; SYMS64-NEXT: Section: .bss +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+43]] +; SYMS64-NEXT: SectionLen: 33 +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 0 +; SYMS64-NEXT: SymbolType: XTY_CM (0x3) +; SYMS64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } +; SYMS64: ] diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-externL.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-externL.ll --- a/llvm/test/CodeGen/PowerPC/aix-xcoff-externL.ll +++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-externL.ll @@ -8,10 +8,10 @@ ; RUN: llvm-readobj --symbols %t.o | \ ; RUN: FileCheck --check-prefix=XCOFF32 %s -; RUN: not --crash llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff \ -; RUN: -mcpu=pwr4 -mattr=-altivec -filetype=obj -o %t.o 2>&1 < %s | \ +; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \ +; RUN: -mattr=-altivec -filetype=obj -o %t.o < %s +; RUN: llvm-readobj --symbols %t.o | \ ; RUN: FileCheck --check-prefix=XCOFF64 %s -; XCOFF64: LLVM ERROR: 64-bit XCOFF object files are not supported yet. @La = external global i32, align 4 @@ -62,3 +62,40 @@ ; XCOFF32-NEXT: StabSectNum: 0x0 ; XCOFF32-NEXT: } ; XCOFF32-NEXT: } + +; XCOFF64: Index: [[#IND:]]{{.*}}{{[[:space:]] *}}Name: .Lb +; XCOFF64-NEXT: Value (RelocatableAddress): 0x0 +; XCOFF64-NEXT: Section: N_UNDEF +; XCOFF64-NEXT: Type: 0x0 +; XCOFF64-NEXT: StorageClass: C_EXT (0x2) +; XCOFF64-NEXT: NumberOfAuxEntries: 1 +; XCOFF64-NEXT: CSECT Auxiliary Entry { +; XCOFF64-NEXT: Index: [[#IND+1]] +; XCOFF64-NEXT: SectionLen: 0 +; XCOFF64-NEXT: ParameterHashIndex: 0x0 +; XCOFF64-NEXT: TypeChkSectNum: 0x0 +; XCOFF64-NEXT: SymbolAlignmentLog2: 0 +; XCOFF64-NEXT: SymbolType: XTY_ER (0x0) +; XCOFF64-NEXT: StorageMappingClass: XMC_PR (0x0) +; XCOFF64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; XCOFF64-NEXT: } +; XCOFF64-NEXT: } +; XCOFF64-NEXT: Symbol { +; XCOFF64-NEXT: Index: [[#IND+2]] +; XCOFF64-NEXT: Name: La +; XCOFF64-NEXT: Value (RelocatableAddress): 0x0 +; XCOFF64-NEXT: Section: N_UNDEF +; XCOFF64-NEXT: Type: 0x0 +; XCOFF64-NEXT: StorageClass: C_EXT (0x2) +; XCOFF64-NEXT: NumberOfAuxEntries: 1 +; XCOFF64-NEXT: CSECT Auxiliary Entry { +; XCOFF64-NEXT: Index: [[#IND+3]] +; XCOFF64-NEXT: SectionLen: 0 +; XCOFF64-NEXT: ParameterHashIndex: 0x0 +; XCOFF64-NEXT: TypeChkSectNum: 0x0 +; XCOFF64-NEXT: SymbolAlignmentLog2: 0 +; XCOFF64-NEXT: SymbolType: XTY_ER (0x0) +; XCOFF64-NEXT: StorageMappingClass: XMC_UA (0x4) +; XCOFF64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; XCOFF64-NEXT: } +; XCOFF64-NEXT: } diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-huge-relocs.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-huge-relocs.ll --- a/llvm/test/CodeGen/PowerPC/aix-xcoff-huge-relocs.ll +++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-huge-relocs.ll @@ -20,13 +20,14 @@ ; RUN: -mcpu=pwr4 -mattr=-altivec -filetype=obj -o %t.o %t.ll ; RUN: llvm-readobj --section-headers %t.o | FileCheck --check-prefix=XCOFF32 %s -; RUN: not --crash llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff \ -; RUN: -mcpu=pwr4 -mattr=-altivec -filetype=obj -o %t.o %t.overflow.ll 2>&1 | \ -; RUN: FileCheck --check-prefix=XCOFF64 %s -; RUN: not --crash llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff \ -; RUN: -mcpu=pwr4 -mattr=-altivec -filetype=obj -o %t.o %t.ll 2>&1 | \ -; RUN: FileCheck --check-prefix=XCOFF64 %s -; XCOFF64: LLVM ERROR: 64-bit XCOFF object files are not supported yet. +; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff \ +; RUN: -mcpu=pwr4 -mattr=-altivec -filetype=obj -o %t.o %t.overflow.ll +; RUN: llvm-readobj --section-headers %t.o | FileCheck --check-prefix=XCOFF64_OVERF %s + +; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff \ +; RUN: -mcpu=pwr4 -mattr=-altivec -filetype=obj -o %t.o %t.ll +; RUN: llvm-readobj --section-headers %t.o | FileCheck --check-prefix=XCOFF64 %s + @c = external global i8, align 1 @arr = global [SIZE x i8*] [MACRO], align 8 @@ -47,3 +48,37 @@ ; XCOFF32-NEXT: } ; XCOFF32-NOT: Name: .ovrflo ; XCOFF32-NOT: Type: STYP_OVRFLO + +; XCOFF64-NOT: Name: .ovrflo +; XCOFF64-NOT: Type: STYP_OVRFLO +; XCOFF64: Section { +; XCOFF64: Name: .data +; XCOFF64-NEXT: PhysicalAddress: 0x0 +; XCOFF64-NEXT: VirtualAddress: 0x0 +; XCOFF64-NEXT: Size: 0x7FFF0 +; XCOFF64-NEXT: RawDataOffset: 0xA8 +; XCOFF64-NEXT: RelocationPointer: 0x80098 +; XCOFF64-NEXT: LineNumberPointer: 0x0 +; XCOFF64-NEXT: NumberOfRelocations: 65534 +; XCOFF64-NEXT: NumberOfLineNumbers: 0 +; XCOFF64-NEXT: Type: STYP_DATA (0x40) +; XCOFF64-NEXT: } +; XCOFF64-NOT: Name: .ovrflo +; XCOFF64-NOT: Type: STYP_OVRFLO + +; XCOFF64_OVERF-NOT: Name: .ovrflo +; XCOFF64_OVERF-NOT: Type: STYP_OVRFLO +; XCOFF64_OVERF: Section { +; XCOFF64_OVERF: Name: .data +; XCOFF64_OVERF-NEXT: PhysicalAddress: 0x0 +; XCOFF64_OVERF-NEXT: VirtualAddress: 0x0 +; XCOFF64_OVERF-NEXT: Size: 0x7FFF8 +; XCOFF64_OVERF-NEXT: RawDataOffset: 0xA8 +; XCOFF64_OVERF-NEXT: RelocationPointer: 0x800A0 +; XCOFF64_OVERF-NEXT: LineNumberPointer: 0x0 +; XCOFF64_OVERF-NEXT: NumberOfRelocations: 65535 +; XCOFF64_OVERF-NEXT: NumberOfLineNumbers: 0 +; XCOFF64_OVERF-NEXT: Type: STYP_DATA (0x40) +; XCOFF64_OVERF-NEXT: } +; XCOFF64_OVERF-NOT: Name: .ovrflo +; XCOFF64_OVERF-NOT: Type: STYP_OVRFLO diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-lcomm.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-lcomm.ll --- a/llvm/test/CodeGen/PowerPC/aix-xcoff-lcomm.ll +++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-lcomm.ll @@ -6,9 +6,10 @@ ; RUN: FileCheck --check-prefix=OBJ %s ; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefix=SYMS %s -; RUN: not --crash llc -mtriple powerpc64-ibm-aix-xcoff -filetype=obj < %s 2>&1 | \ +; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -filetype=obj -o %t.o < %s +; RUN: llvm-readobj --section-headers --file-header %t.o | \ ; RUN: FileCheck --check-prefix=OBJ64 %s -; OBJ64: LLVM ERROR: 64-bit XCOFF object files are not supported yet. +; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefix=SYMS64 %s @a = internal global i32 0, align 4 @b = internal global i64 0, align 8 @@ -110,3 +111,93 @@ ; SYMS-NEXT: } ; SYMS-NEXT: } ; SYMS-NEXT: ] + +; OBJ64: File: {{.*}}aix-xcoff-lcomm.ll.tmp.o +; OBJ64-NEXT: Format: aix5coff64-rs6000 +; OBJ64-NEXT: Arch: powerpc64 +; OBJ64-NEXT: AddressSize: 64bit +; OBJ64-NEXT: FileHeader { +; OBJ64-NEXT: Magic: 0x1F7 +; OBJ64-NEXT: NumberOfSections: 2 +; OBJ64-NEXT: TimeStamp: +; OBJ64-NEXT: SymbolTableOffset: 0xA8 +; OBJ64-NEXT: SymbolTableEntries: 9 +; OBJ64-NEXT: OptionalHeaderSize: 0x0 +; OBJ64-NEXT: Flags: 0x0 +; OBJ64-NEXT: } +; OBJ64-NEXT: Sections [ +; OBJ64: Section {{[{][[:space:]] *}}Index: 2 +; OBJ64-NEXT: Name: .bss +; OBJ64-NEXT: PhysicalAddress: 0x0 +; OBJ64-NEXT: VirtualAddress: 0x0 +; OBJ64-NEXT: Size: 0x14 +; OBJ64-NEXT: RawDataOffset: 0x0 +; OBJ64-NEXT: RelocationPointer: 0x0 +; OBJ64-NEXT: LineNumberPointer: 0x0 +; OBJ64-NEXT: NumberOfRelocations: 0 +; OBJ64-NEXT: NumberOfLineNumbers: 0 +; OBJ64-NEXT: Type: STYP_BSS (0x80) +; OBJ64-NEXT: } +; OBJ64-NEXT: ] + +; SYMS64: File: {{.*}}aix-xcoff-lcomm.ll.tmp.o +; SYMS64-NEXT: Format: aix5coff64-rs6000 +; SYMS64-NEXT: Arch: powerpc64 +; SYMS64-NEXT: AddressSize: 64bit +; SYMS64-NEXT: Symbols [ +; SYMS64: Symbol {{[{][[:space:]] *}}Index: [[#Index:]]{{[[:space:]] *}}Name: a +; SYMS64-NEXT: Value (RelocatableAddress): 0x0 +; SYMS64-NEXT: Section: .bss +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#Index + 1]] +; SYMS64-NEXT: SectionLen: 4 +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 2 +; SYMS64-NEXT: SymbolType: XTY_CM (0x3) +; SYMS64-NEXT: StorageMappingClass: XMC_BS (0x9) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } +; SYMS64-NEXT: Symbol { +; SYMS64-NEXT: Index: [[#Index + 2]] +; SYMS64-NEXT: Name: b +; SYMS64-NEXT: Value (RelocatableAddress): 0x8 +; SYMS64-NEXT: Section: .bss +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#Index + 3]] +; SYMS64-NEXT: SectionLen: 8 +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 3 +; SYMS64-NEXT: SymbolType: XTY_CM (0x3) +; SYMS64-NEXT: StorageMappingClass: XMC_BS (0x9) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } +; SYMS64-NEXT: Symbol { +; SYMS64-NEXT: Index: [[#Index + 4]] +; SYMS64-NEXT: Name: c +; SYMS64-NEXT: Value (RelocatableAddress): 0x10 +; SYMS64-NEXT: Section: .bss +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#Index + 5]] +; SYMS64-NEXT: SectionLen: 2 +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 1 +; SYMS64-NEXT: SymbolType: XTY_CM (0x3) +; SYMS64-NEXT: StorageMappingClass: XMC_BS (0x9) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } +; SYMS64-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 @@ -6,10 +6,8 @@ ; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc-ibm-aix-xcoff -data-sections=false -filetype=obj -o %t.o < %s ; RUN: llvm-readobj -r --expand-relocs -t %t.o | FileCheck --check-prefixes=RELOC,SYM %s -; RUN: not --crash llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff \ -; RUN: -data-sections=false -filetype=obj < %s 2>&1 | \ -; RUN: FileCheck --check-prefix=XCOFF64 %s -; XCOFF64: LLVM ERROR: 64-bit XCOFF object files are not supported yet. +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff -data-sections=false -filetype=obj -o %t.o < %s +; RUN: llvm-readobj -r --expand-relocs -t %t.o | FileCheck --check-prefixes=RELOC64,SYM64 %s @common = common global i32 0, align 4 @pointer = global i32* @common, align 4 @@ -97,3 +95,72 @@ ; SYM-NEXT: StabSectNum: 0x0 ; SYM-NEXT: } ; SYM-NEXT: } + +; RELOC64: Relocations [ +; RELOC64-NEXT: Section (index: {{[0-9]+}}) .data { +; RELOC64-NEXT: Relocation { +; RELOC64-NEXT: Virtual Address: 0x0 +; RELOC64-NEXT: Symbol: common ([[#COM_INDX:]]) +; RELOC64-NEXT: IsSigned: No +; RELOC64-NEXT: FixupBitValue: 0 +; RELOC64-NEXT: Length: 64 +; RELOC64-NEXT: Type: R_POS (0x0) +; RELOC64-NEXT: } +; RELOC64-NEXT: } +; RELOC64-NEXT: ] + +; SYM64: Symbol {{[{][[:space:]] *}}Index: [[#INDX:]]{{[[:space:]] *}}Name: .data +; SYM64-NEXT: Value (RelocatableAddress): 0x0 +; SYM64-NEXT: Section: .data +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#INDX+1]] +; SYM64-NEXT: SectionLen: 8 +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 3 +; SYM64-NEXT: SymbolType: XTY_SD (0x1) +; SYM64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: [[#INDX+2]] +; SYM64-NEXT: Name: pointer +; SYM64-NEXT: Value (RelocatableAddress): 0x0 +; SYM64-NEXT: Section: .data +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_EXT (0x2) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#INDX+3]] +; SYM64-NEXT: ContainingCsectSymbolIndex: [[#INDX]] +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 0 +; SYM64-NEXT: SymbolType: XTY_LD (0x2) +; SYM64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: [[#COM_INDX]] +; SYM64-NEXT: Name: common +; SYM64-NEXT: Value (RelocatableAddress): 0x8 +; SYM64-NEXT: Section: .bss +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_EXT (0x2) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#COM_INDX+1]] +; SYM64-NEXT: SectionLen: 4 +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 2 +; SYM64-NEXT: SymbolType: XTY_CM (0x3) +; SYM64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } 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 @@ -7,9 +7,14 @@ ; RUN: llvm-objdump -D %t.o | FileCheck --check-prefix=DIS %s ; RUN: llvm-objdump -r %t.o | FileCheck --check-prefix=DIS_REL %s -; RUN: not --crash llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff -mattr=-altivec -data-sections=false -filetype=obj < %s 2>&1 | \ -; RUN: FileCheck --check-prefix=XCOFF64 %s -; XCOFF64: LLVM ERROR: 64-bit XCOFF object files are not supported yet. +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff -mattr=-altivec \ +; RUN: -xcoff-traceback-table=false -data-sections=false -filetype=obj -o %t.o < %s +; RUN: llvm-readobj --section-headers --file-header %t.o | \ +; RUN: FileCheck --check-prefix=OBJ64 %s +; RUN: llvm-readobj --relocs --expand-relocs %t.o | FileCheck --check-prefix=RELOC64 %s +; RUN: llvm-readobj -t %t.o | FileCheck --check-prefix=SYM64 %s +; RUN: llvm-objdump -D %t.o | FileCheck --check-prefix=DIS64 %s +; RUN: llvm-objdump -r %t.o | FileCheck --check-prefix=DIS_REL64 %s @globalA = global i32 1, align 4 @globalB = global i32 2, align 4 @@ -472,3 +477,437 @@ ; DIS_REL-NEXT: 00000038 R_POS TOC ; DIS_REL-NEXT: 00000040 R_POS globalA ; DIS_REL-NEXT: 00000044 R_POS globalB + +; OBJ64: File: {{.*}}aix-xcoff-reloc.ll.tmp.o +; OBJ64-NEXT: Format: aix5coff64-rs6000 +; OBJ64-NEXT: Arch: powerpc64 +; OBJ64-NEXT: AddressSize: 64bit +; OBJ64-NEXT: FileHeader { +; OBJ64-NEXT: Magic: 0x1F7 +; OBJ64-NEXT: NumberOfSections: 2 +; OBJ64-NEXT: TimeStamp: None (0x0) +; OBJ64-NEXT: SymbolTableOffset: 0x1B8 +; OBJ64-NEXT: SymbolTableEntries: 27 +; OBJ64-NEXT: OptionalHeaderSize: 0x0 +; OBJ64-NEXT: Flags: 0x0 +; OBJ64-NEXT: } +; OBJ64-NEXT: Sections [ +; OBJ64-NEXT: Section { +; OBJ64-NEXT: Index: 1 +; OBJ64-NEXT: Name: .text +; OBJ64-NEXT: PhysicalAddress: 0x0 +; OBJ64-NEXT: VirtualAddress: 0x0 +; OBJ64-NEXT: Size: 0x40 +; OBJ64-NEXT: RawDataOffset: 0xA8 +; OBJ64-NEXT: RelocationPointer: 0x148 +; OBJ64-NEXT: LineNumberPointer: 0x0 +; OBJ64-NEXT: NumberOfRelocations: 3 +; OBJ64-NEXT: NumberOfLineNumbers: 0 +; OBJ64-NEXT: Type: STYP_TEXT (0x20) +; OBJ64-NEXT: } +; OBJ64-NEXT: Section { +; OBJ64-NEXT: Index: 2 +; OBJ64-NEXT: Name: .data +; OBJ64-NEXT: PhysicalAddress: 0x40 +; OBJ64-NEXT: VirtualAddress: 0x40 +; OBJ64-NEXT: Size: 0x60 +; OBJ64-NEXT: RawDataOffset: 0xE8 +; OBJ64-NEXT: RelocationPointer: 0x172 +; OBJ64-NEXT: LineNumberPointer: 0x0 +; OBJ64-NEXT: NumberOfRelocations: 5 +; OBJ64-NEXT: NumberOfLineNumbers: 0 +; OBJ64-NEXT: Type: STYP_DATA (0x40) +; OBJ64-NEXT: } +; OBJ64-NEXT: ] + + +; RELOC64: File: {{.*}}aix-xcoff-reloc.ll.tmp.o +; RELOC64-NEXT: Format: aix5coff64-rs6000 +; RELOC64-NEXT: Arch: powerpc64 +; RELOC64-NEXT: AddressSize: 64bit +; RELOC64-NEXT: Relocations [ +; RELOC64-NEXT: Section (index: 1) .text { +; RELOC64-NEXT: Relocation { +; RELOC64-NEXT: Virtual Address: 0x10 +; RELOC64-NEXT: Symbol: .bar (1) +; RELOC64-NEXT: IsSigned: Yes +; RELOC64-NEXT: FixupBitValue: 0 +; RELOC64-NEXT: Length: 26 +; RELOC64-NEXT: Type: R_RBR (0x1A) +; RELOC64-NEXT: } +; RELOC64-NEXT: Relocation { +; RELOC64-NEXT: Virtual Address: 0x1A +; RELOC64-NEXT: Symbol: globalA (23) +; RELOC64-NEXT: IsSigned: No +; RELOC64-NEXT: FixupBitValue: 0 +; RELOC64-NEXT: Length: 16 +; RELOC64-NEXT: Type: R_TOC (0x3) +; RELOC64-NEXT: } +; RELOC64-NEXT: Relocation { +; RELOC64-NEXT: Virtual Address: 0x1E +; RELOC64-NEXT: Symbol: globalB (25) +; RELOC64-NEXT: IsSigned: No +; RELOC64-NEXT: FixupBitValue: 0 +; RELOC64-NEXT: Length: 16 +; RELOC64-NEXT: Type: R_TOC (0x3) +; RELOC64-NEXT: } +; RELOC64-NEXT: } +; RELOC64-NEXT: Section (index: 2) .data { +; RELOC64-NEXT: Relocation { +; RELOC64-NEXT: Virtual Address: 0x70 +; RELOC64-NEXT: Symbol: arr (15) +; RELOC64-NEXT: IsSigned: No +; RELOC64-NEXT: FixupBitValue: 0 +; RELOC64-NEXT: Length: 64 +; RELOC64-NEXT: Type: R_POS (0x0) +; RELOC64-NEXT: } +; RELOC64-NEXT: Relocation { +; RELOC64-NEXT: Virtual Address: 0x78 +; RELOC64-NEXT: Symbol: .foo (7) +; RELOC64-NEXT: IsSigned: No +; RELOC64-NEXT: FixupBitValue: 0 +; RELOC64-NEXT: Length: 64 +; RELOC64-NEXT: Type: R_POS (0x0) +; RELOC64-NEXT: } +; RELOC64-NEXT: Relocation { +; RELOC64-NEXT: Virtual Address: 0x80 +; RELOC64-NEXT: Symbol: TOC (21) +; RELOC64-NEXT: IsSigned: No +; RELOC64-NEXT: FixupBitValue: 0 +; RELOC64-NEXT: Length: 64 +; RELOC64-NEXT: Type: R_POS (0x0) +; RELOC64-NEXT: } +; RELOC64-NEXT: Relocation { +; RELOC64-NEXT: Virtual Address: 0x90 +; RELOC64-NEXT: Symbol: globalA (11) +; RELOC64-NEXT: IsSigned: No +; RELOC64-NEXT: FixupBitValue: 0 +; RELOC64-NEXT: Length: 64 +; RELOC64-NEXT: Type: R_POS (0x0) +; RELOC64-NEXT: } +; RELOC64-NEXT: Relocation { +; RELOC64-NEXT: Virtual Address: 0x98 +; RELOC64-NEXT: Symbol: globalB (13) +; RELOC64-NEXT: IsSigned: No +; RELOC64-NEXT: FixupBitValue: 0 +; RELOC64-NEXT: Length: 64 +; RELOC64-NEXT: Type: R_POS (0x0) +; RELOC64-NEXT: } +; RELOC64-NEXT: } +; RELOC64-NEXT: ] + +; SYM64: Symbols [ +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: 0 +; SYM64-NEXT: Name: .file +; SYM64-NEXT: Value (SymbolTableIndex): 0x0 +; SYM64-NEXT: Section: N_DEBUG +; SYM64-NEXT: Source Language ID: TB_C (0x0) +; SYM64-NEXT: CPU Version ID: 0x0 +; SYM64-NEXT: StorageClass: C_FILE (0x67) +; SYM64-NEXT: NumberOfAuxEntries: 0 +; SYM64-NEXT: } +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: [[#INDX:]] +; SYM64-NEXT: Name: .bar +; SYM64-NEXT: Value (RelocatableAddress): 0x0 +; SYM64-NEXT: Section: N_UNDEF +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_EXT (0x2) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#INDX+1]] +; SYM64-NEXT: SectionLen: 0 +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 0 +; SYM64-NEXT: SymbolType: XTY_ER (0x0) +; SYM64-NEXT: StorageMappingClass: XMC_PR (0x0) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: [[#INDX+2]] +; SYM64-NEXT: Name: bar +; SYM64-NEXT: Value (RelocatableAddress): 0x0 +; SYM64-NEXT: Section: N_UNDEF +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_EXT (0x2) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#INDX+3]] +; SYM64-NEXT: SectionLen: 0 +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 0 +; SYM64-NEXT: SymbolType: XTY_ER (0x0) +; SYM64-NEXT: StorageMappingClass: XMC_DS (0xA) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: [[#INDX+4]] +; SYM64-NEXT: Name: .text +; SYM64-NEXT: Value (RelocatableAddress): 0x0 +; SYM64-NEXT: Section: .text +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#INDX+5]] +; SYM64-NEXT: SectionLen: 64 +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 4 +; SYM64-NEXT: SymbolType: XTY_SD (0x1) +; SYM64-NEXT: StorageMappingClass: XMC_PR (0x0) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: [[#INDX+6]] +; SYM64-NEXT: Name: .foo +; SYM64-NEXT: Value (RelocatableAddress): 0x0 +; SYM64-NEXT: Section: .text +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_EXT (0x2) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#INDX+7]] +; SYM64-NEXT: ContainingCsectSymbolIndex: [[#INDX+4]] +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 0 +; SYM64-NEXT: SymbolType: XTY_LD (0x2) +; SYM64-NEXT: StorageMappingClass: XMC_PR (0x0) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: [[#INDX+8]] +; SYM64-NEXT: Name: .data +; SYM64-NEXT: Value (RelocatableAddress): 0x40 +; SYM64-NEXT: Section: .data +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#INDX+9]] +; SYM64-NEXT: SectionLen: 56 +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 3 +; SYM64-NEXT: SymbolType: XTY_SD (0x1) +; SYM64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: [[#INDX+10]] +; SYM64-NEXT: Name: globalA +; SYM64-NEXT: Value (RelocatableAddress): 0x40 +; SYM64-NEXT: Section: .data +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_EXT (0x2) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#INDX+11]] +; SYM64-NEXT: ContainingCsectSymbolIndex: [[#INDX+8]] +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 0 +; SYM64-NEXT: SymbolType: XTY_LD (0x2) +; SYM64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: [[#INDX+12]] +; SYM64-NEXT: Name: globalB +; SYM64-NEXT: Value (RelocatableAddress): 0x44 +; SYM64-NEXT: Section: .data +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_EXT (0x2) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#INDX+13]] +; SYM64-NEXT: ContainingCsectSymbolIndex: [[#INDX+8]] +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 0 +; SYM64-NEXT: SymbolType: XTY_LD (0x2) +; SYM64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: [[#INDX+14]] +; SYM64-NEXT: Name: arr +; SYM64-NEXT: Value (RelocatableAddress): 0x48 +; SYM64-NEXT: Section: .data +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_EXT (0x2) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#INDX+15]] +; SYM64-NEXT: ContainingCsectSymbolIndex: [[#INDX+8]] +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 0 +; SYM64-NEXT: SymbolType: XTY_LD (0x2) +; SYM64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: [[#INDX+16]] +; SYM64-NEXT: Name: p +; SYM64-NEXT: Value (RelocatableAddress): 0x70 +; SYM64-NEXT: Section: .data +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_EXT (0x2) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#INDX+17]] +; SYM64-NEXT: ContainingCsectSymbolIndex: [[#INDX+8]] +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 0 +; SYM64-NEXT: SymbolType: XTY_LD (0x2) +; SYM64-NEXT: StorageMappingClass: XMC_RW (0x5) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: [[#INDX+18]] +; SYM64-NEXT: Name: foo +; SYM64-NEXT: Value (RelocatableAddress): 0x78 +; SYM64-NEXT: Section: .data +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_EXT (0x2) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#INDX+19]] +; SYM64-NEXT: SectionLen: 24 +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 3 +; SYM64-NEXT: SymbolType: XTY_SD (0x1) +; SYM64-NEXT: StorageMappingClass: XMC_DS (0xA) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: [[#INDX+20]] +; SYM64-NEXT: Name: TOC +; SYM64-NEXT: Value (RelocatableAddress): 0x90 +; SYM64-NEXT: Section: .data +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#INDX+21]] +; SYM64-NEXT: SectionLen: 0 +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 2 +; SYM64-NEXT: SymbolType: XTY_SD (0x1) +; SYM64-NEXT: StorageMappingClass: XMC_TC0 (0xF) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: [[#INDX+22]] +; SYM64-NEXT: Name: globalA +; SYM64-NEXT: Value (RelocatableAddress): 0x90 +; SYM64-NEXT: Section: .data +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#INDX+23]] +; SYM64-NEXT: SectionLen: 8 +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 3 +; SYM64-NEXT: SymbolType: XTY_SD (0x1) +; SYM64-NEXT: StorageMappingClass: XMC_TC (0x3) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: [[#INDX+24]] +; SYM64-NEXT: Name: globalB +; SYM64-NEXT: Value (RelocatableAddress): 0x98 +; SYM64-NEXT: Section: .data +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#INDX+25]] +; SYM64-NEXT: SectionLen: 8 +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 3 +; SYM64-NEXT: SymbolType: XTY_SD (0x1) +; SYM64-NEXT: StorageMappingClass: XMC_TC (0x3) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } +; SYM64-NEXT: ] + + +; DIS64: {{.*}}aix-xcoff-reloc.ll.tmp.o: file format aix5coff64-rs6000 +; DIS64: Disassembly of section .text: +; DIS64: 00000000 <.text>: +; DIS64-NEXT: 0: 7c 08 02 a6 mflr 0 +; DIS64-NEXT: 4: f8 01 00 10 std 0, 16(1) +; DIS64-NEXT: 8: f8 21 ff 91 stdu 1, -112(1) +; DIS64-NEXT: c: 38 60 00 01 li 3, 1 +; DIS64-NEXT: 10: 4b ff ff f1 bl 0x0 +; DIS64-NEXT: 14: 60 00 00 00 nop +; DIS64-NEXT: 18: e8 82 00 00 ld 4, 0(2) +; DIS64-NEXT: 1c: e8 a2 00 08 ld 5, 8(2) +; DIS64-NEXT: 20: 80 84 00 00 lwz 4, 0(4) +; DIS64-NEXT: 24: 80 a5 00 00 lwz 5, 0(5) +; DIS64-NEXT: 28: 7c 63 22 14 add 3, 3, 4 +; DIS64-NEXT: 2c: 7c 63 2a 14 add 3, 3, 5 +; DIS64-NEXT: 30: 38 21 00 70 addi 1, 1, 112 +; DIS64-NEXT: 34: e8 01 00 10 ld 0, 16(1) +; DIS64-NEXT: 38: 7c 08 03 a6 mtlr 0 +; DIS64-NEXT: 3c: 4e 80 00 20 blr + +; DIS64: Disassembly of section .data: +; DIS64: 00000040 : +; DIS64-NEXT: 40: 00 00 00 01 +; DIS64: 00000044 : +; DIS64-NEXT: 44: 00 00 00 02 +; DIS64: 00000048 : +; DIS64-NEXT: 48: 00 00 00 03 +; DIS64-NEXT: ... +; DIS64: 00000070

: +; DIS64-NEXT: 70: 00 00 00 00 +; DIS64-NEXT: 74: 00 00 00 58 +; DIS64: 00000078 : +; DIS64-NEXT: ... +; DIS64-NEXT: 84: 00 00 00 90 +; DIS64: 00000090 : +; DIS64-NEXT: 90: 00 00 00 00 +; DIS64-NEXT: 94: 00 00 00 40 +; DIS64: 00000098 : +; DIS64-NEXT: 98: 00 00 00 00 +; DIS64-NEXT: 9c: 00 00 00 44 + +; DIS_REL64: {{.*}}aix-xcoff-reloc.ll.tmp.o: file format aix5coff64-rs6000 +; DIS_REL64: RELOCATION RECORDS FOR [.text]: +; DIS_REL64-NEXT: OFFSET TYPE VALUE +; DIS_REL64-NEXT: 00000010 R_RBR .bar +; DIS_REL64-NEXT: 0000001a R_TOC globalA +; DIS_REL64-NEXT: 0000001e R_TOC globalB +; DIS_REL64: RELOCATION RECORDS FOR [.data]: +; DIS_REL64-NEXT: OFFSET TYPE VALUE +; DIS_REL64-NEXT: 00000030 R_POS arr +; DIS_REL64-NEXT: 00000038 R_POS .foo +; DIS_REL64-NEXT: 00000040 R_POS TOC +; DIS_REL64-NEXT: 00000050 R_POS globalA +; DIS_REL64-NEXT: 00000058 R_POS globalB diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-rodata.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-rodata.ll --- a/llvm/test/CodeGen/PowerPC/aix-xcoff-rodata.ll +++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-rodata.ll @@ -9,9 +9,11 @@ ; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefix=SYMS %s ; RUN: llvm-objdump -D %t.o | FileCheck --check-prefix=DIS %s -; RUN: not --crash llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc64-ibm-aix-xcoff -data-sections=false -filetype=obj < %s 2>&1 | \ -; RUN: FileCheck --check-prefix=XCOFF64 %s -; XCOFF64: LLVM ERROR: 64-bit XCOFF object files are not supported yet. +; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc64-ibm-aix-xcoff -data-sections=false -filetype=obj -o %t.o < %s +; RUN: llvm-readobj --section-headers --file-header %t.o | \ +; RUN: FileCheck --check-prefix=OBJ64 %s +; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefix=SYMS64 %s +; RUN: llvm-objdump -D %t.o | FileCheck --check-prefix=DIS64 %s @const_ivar = constant i32 35, align 4 @const_llvar = constant i64 36, align 8 @@ -333,3 +335,255 @@ ; DIS-NEXT: 44: 00 00 00 00 ; DIS-NEXT: 48: 40 10 00 00 ; DIS-NEXT: 4c: 00 00 00 00 + +; OBJ64: File: {{.*}}aix-xcoff-rodata.ll.tmp.o +; OBJ64-NEXT: Format: aix5coff64-rs6000 +; OBJ64-NEXT: Arch: powerpc64 +; OBJ64-NEXT: AddressSize: 64bit +; OBJ64-NEXT: FileHeader { +; OBJ64-NEXT: Magic: 0x1F7 +; OBJ64-NEXT: NumberOfSections: 1 +; OBJ64-NEXT: TimeStamp: None (0x0) +; OBJ64-NEXT: SymbolTableOffset: 0xB0 +; OBJ64-NEXT: SymbolTableEntries: 21 +; OBJ64-NEXT: OptionalHeaderSize: 0x0 +; OBJ64-NEXT: Flags: 0x0 +; OBJ64-NEXT: } + +; OBJ64: Sections [ +; OBJ64: Section { +; OBJ64-NEXT: Index: 1 +; OBJ64-NEXT: Name: .text +; OBJ64-NEXT: PhysicalAddress: 0x0 +; OBJ64-NEXT: VirtualAddress: 0x0 +; OBJ64-NEXT: Size: 0x50 +; OBJ64-NEXT: RawDataOffset: 0x60 +; OBJ64-NEXT: RelocationPointer: 0x0 +; OBJ64-NEXT: LineNumberPointer: 0x0 +; OBJ64-NEXT: NumberOfRelocations: 0 +; OBJ64-NEXT: NumberOfLineNumbers: 0 +; OBJ64-NEXT: Type: STYP_TEXT (0x20) +; OBJ64-NEXT: } +; OBJ64-NEXT: ] + + +; SYMS64: File: {{.*}}aix-xcoff-rodata.ll.tmp.o +; SYMS64-NEXT: Format: aix5coff64-rs6000 +; SYMS64-NEXT: Arch: powerpc64 +; SYMS64-NEXT: AddressSize: 64bit +; SYMS64: Symbols [ +; SYMS64: Symbol {{[{][[:space:]] *}}Index: [[#INDX:]]{{[[:space:]] *}}Name: .rodata +; SYMS64-NEXT: Value (RelocatableAddress): 0x0 +; SYMS64-NEXT: Section: .text +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+1]] +; SYMS64-NEXT: SectionLen: 80 +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 5 +; SYMS64-NEXT: SymbolType: XTY_SD (0x1) +; SYMS64-NEXT: StorageMappingClass: XMC_RO (0x1) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+2]] +; SYMS64-NEXT: Name: const_ivar +; SYMS64-NEXT: Value (RelocatableAddress): 0x0 +; SYMS64-NEXT: Section: .text +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+3]] +; SYMS64-NEXT: ContainingCsectSymbolIndex: [[#INDX]] +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 0 +; SYMS64-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64-NEXT: StorageMappingClass: XMC_RO (0x1) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+4]] +; SYMS64-NEXT: Name: const_llvar +; SYMS64-NEXT: Value (RelocatableAddress): 0x8 +; SYMS64-NEXT: Section: .text +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+5]] +; SYMS64-NEXT: ContainingCsectSymbolIndex: [[#INDX]] +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 0 +; SYMS64-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64-NEXT: StorageMappingClass: XMC_RO (0x1) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+6]] +; SYMS64-NEXT: Name: const_svar +; SYMS64-NEXT: Value (RelocatableAddress): 0x10 +; SYMS64-NEXT: Section: .text +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+7]] +; SYMS64-NEXT: ContainingCsectSymbolIndex: [[#INDX]] +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 0 +; SYMS64-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64-NEXT: StorageMappingClass: XMC_RO (0x1) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+8]] +; SYMS64-NEXT: Name: const_fvar +; SYMS64-NEXT: Value (RelocatableAddress): 0x14 +; SYMS64-NEXT: Section: .text +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+9]] +; SYMS64-NEXT: ContainingCsectSymbolIndex: [[#INDX]] +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 0 +; SYMS64-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64-NEXT: StorageMappingClass: XMC_RO (0x1) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+10]] +; SYMS64-NEXT: Name: const_dvar +; SYMS64-NEXT: Value (RelocatableAddress): 0x18 +; SYMS64-NEXT: Section: .text +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+11]] +; SYMS64-NEXT: ContainingCsectSymbolIndex: [[#INDX]] +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 0 +; SYMS64-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64-NEXT: StorageMappingClass: XMC_RO (0x1) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+12]] +; SYMS64-NEXT: Name: const_over_aligned +; SYMS64-NEXT: Value (RelocatableAddress): 0x20 +; SYMS64-NEXT: Section: .text +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+13]] +; SYMS64-NEXT: ContainingCsectSymbolIndex: [[#INDX]] +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 0 +; SYMS64-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64-NEXT: StorageMappingClass: XMC_RO (0x1) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+14]] +; SYMS64-NEXT: Name: const_chrarray +; SYMS64-NEXT: Value (RelocatableAddress): 0x28 +; SYMS64-NEXT: Section: .text +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+15]] +; SYMS64-NEXT: ContainingCsectSymbolIndex: [[#INDX]] +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 0 +; SYMS64-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64-NEXT: StorageMappingClass: XMC_RO (0x1) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } + +; SYMS64: Symbol { +; SYMS64-NEXT: Index: [[#INDX+16]] +; SYMS64-NEXT: Name: const_dblarr +; SYMS64-NEXT: Value (RelocatableAddress): 0x30 +; SYMS64-NEXT: Section: .text +; SYMS64-NEXT: Type: 0x0 +; SYMS64-NEXT: StorageClass: C_EXT (0x2) +; SYMS64-NEXT: NumberOfAuxEntries: 1 +; SYMS64-NEXT: CSECT Auxiliary Entry { +; SYMS64-NEXT: Index: [[#INDX+17]] +; SYMS64-NEXT: ContainingCsectSymbolIndex: [[#INDX]] +; SYMS64-NEXT: ParameterHashIndex: 0x0 +; SYMS64-NEXT: TypeChkSectNum: 0x0 +; SYMS64-NEXT: SymbolAlignmentLog2: 0 +; SYMS64-NEXT: SymbolType: XTY_LD (0x2) +; SYMS64-NEXT: StorageMappingClass: XMC_RO (0x1) +; SYMS64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYMS64-NEXT: } +; SYMS64-NEXT: } +; SYMS64: ] + +; DIS64: Disassembly of section .text: +; DIS64: 00000000 : +; DIS64-NEXT: 0: 00 00 00 23 +; DIS64-NEXT: 4: 00 00 00 00 + +; DIS64: 00000008 : +; DIS64-NEXT: 8: 00 00 00 00 +; DIS64-NEXT: c: 00 00 00 24 + +; DIS64: 00000010 : +; DIS64-NEXT: 10: 00 25 00 00 + +; DIS64: 00000014 : +; DIS64-NEXT: 14: 44 48 00 00 + +; DIS64: 00000018 : +; DIS64-NEXT: 18: 40 8c 20 00 +; DIS64-NEXT: 1c: 00 00 00 00 + +; DIS64: 00000020 : +; DIS64-NEXT: 20: 40 8c 20 00 +; DIS64-NEXT: 24: 00 00 00 00 + +; DIS64: 00000028 : +; DIS64-NEXT: 28: 61 62 63 64 +; DIS64-NEXT: 2c: 00 00 00 00 + +; DIS64: 00000030 : +; DIS64-NEXT: 30: 3f f0 00 00 +; DIS64-NEXT: 34: 00 00 00 00 +; DIS64-NEXT: 38: 40 00 00 00 +; DIS64-NEXT: 3c: 00 00 00 00 +; DIS64-NEXT: 40: 40 08 00 00 +; DIS64-NEXT: 44: 00 00 00 00 +; DIS64-NEXT: 48: 40 10 00 00 +; DIS64-NEXT: 4c: 00 00 00 00 diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-toc.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-toc.ll --- a/llvm/test/CodeGen/PowerPC/aix-xcoff-toc.ll +++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-toc.ll @@ -3,15 +3,15 @@ ; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc-ibm-aix-xcoff \ ; RUN: -xcoff-traceback-table=false < %s | FileCheck --check-prefixes CHECK,CHECK32 %s ; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc64-ibm-aix-xcoff \ -; RUN: -xcoff-traceback-table=false < %s 2>&1 | FileCheck --check-prefixes CHECK,CHECK64 %s +; RUN: -xcoff-traceback-table=false < %s | FileCheck --check-prefixes CHECK,CHECK64 %s ; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc-ibm-aix-xcoff \ ; RUN: --xcoff-traceback-table=false -filetype=obj -o %t.o < %s ; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefix=SYM %s -; RUN: not --crash llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc64-ibm-aix-xcoff -filetype=obj -o %t.o 2>&1 \ -; RUN: < %s | FileCheck --check-prefix=XCOFF64 %s -; XCOFF64: LLVM ERROR: 64-bit XCOFF object files are not supported yet. +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc64-ibm-aix-xcoff \ +; RUN: --xcoff-traceback-table=false -filetype=obj -o %t.o < %s +; RUN: llvm-readobj --syms %t.o | FileCheck --check-prefix=SYM64 %s @a = external global i32, align 4 @b = external global i64, align 8 @@ -359,3 +359,270 @@ ; SYM-NEXT: StabSectNum: 0x0 ; SYM-NEXT: } ; SYM-NEXT: } + +; SYM64: File: {{.*}}aix-xcoff-toc.ll.tmp.o +; SYM64: Symbol {{[{][[:space:]] *}}Index: [[#UNDEF_INDX:]]{{[[:space:]] *}}Name: a +; SYM64-NEXT: Value (RelocatableAddress): 0x0 +; SYM64-NEXT: Section: N_UNDEF +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_EXT (0x2) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#UNDEF_INDX+1]] +; SYM64-NEXT: SectionLen: 0 +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 0 +; SYM64-NEXT: SymbolType: XTY_ER (0x0) +; SYM64-NEXT: StorageMappingClass: XMC_UA (0x4) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: [[#UNDEF_INDX+2]] +; SYM64-NEXT: Name: b +; SYM64-NEXT: Value (RelocatableAddress): 0x0 +; SYM64-NEXT: Section: N_UNDEF +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_EXT (0x2) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#UNDEF_INDX+3]] +; SYM64-NEXT: SectionLen: 0 +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 0 +; SYM64-NEXT: SymbolType: XTY_ER (0x0) +; SYM64-NEXT: StorageMappingClass: XMC_UA (0x4) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: [[#UNDEF_INDX+4]] +; SYM64-NEXT: Name: c +; SYM64-NEXT: Value (RelocatableAddress): 0x0 +; SYM64-NEXT: Section: N_UNDEF +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_EXT (0x2) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#UNDEF_INDX+5]] +; SYM64-NEXT: SectionLen: 0 +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 0 +; SYM64-NEXT: SymbolType: XTY_ER (0x0) +; SYM64-NEXT: StorageMappingClass: XMC_UA (0x4) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: [[#UNDEF_INDX+6]] +; SYM64-NEXT: Name: .foo +; SYM64-NEXT: Value (RelocatableAddress): 0x0 +; SYM64-NEXT: Section: N_UNDEF +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_EXT (0x2) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#UNDEF_INDX+7]] +; SYM64-NEXT: SectionLen: 0 +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 0 +; SYM64-NEXT: SymbolType: XTY_ER (0x0) +; SYM64-NEXT: StorageMappingClass: XMC_PR (0x0) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: [[#UNDEF_INDX+8]] +; SYM64-NEXT: Name: foo +; SYM64-NEXT: Value (RelocatableAddress): 0x0 +; SYM64-NEXT: Section: N_UNDEF +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_EXT (0x2) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#UNDEF_INDX+9]] +; SYM64-NEXT: SectionLen: 0 +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 0 +; SYM64-NEXT: SymbolType: XTY_ER (0x0) +; SYM64-NEXT: StorageMappingClass: XMC_DS (0xA) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } + +; Test TOC entry symbol generation. + +; SYM64: Symbol {{[{][[:space:]] *}}Index: [[#TOC_INDX:]]{{[[:space:]] *}}Name: TOC +; SYM64-NEXT: Value (RelocatableAddress): 0xC0 +; SYM64-NEXT: Section: .data +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#TOC_INDX+1]] +; SYM64-NEXT: SectionLen: 0 +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 2 +; SYM64-NEXT: SymbolType: XTY_SD (0x1) +; SYM64-NEXT: StorageMappingClass: XMC_TC0 (0xF) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: [[#TOC_INDX+2]] +; SYM64-NEXT: Name: a +; SYM64-NEXT: Value (RelocatableAddress): 0xC0 +; SYM64-NEXT: Section: .data +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#TOC_INDX+3]] +; SYM64-NEXT: SectionLen: 8 +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 3 +; SYM64-NEXT: SymbolType: XTY_SD (0x1) +; SYM64-NEXT: StorageMappingClass: XMC_TC (0x3) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: [[#TOC_INDX+4]] +; SYM64-NEXT: Name: b +; SYM64-NEXT: Value (RelocatableAddress): 0xC8 +; SYM64-NEXT: Section: .data +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#TOC_INDX+5]] +; SYM64-NEXT: SectionLen: 8 +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 3 +; SYM64-NEXT: SymbolType: XTY_SD (0x1) +; SYM64-NEXT: StorageMappingClass: XMC_TC (0x3) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: [[#TOC_INDX+6]] +; SYM64-NEXT: Name: c +; SYM64-NEXT: Value (RelocatableAddress): 0xD0 +; SYM64-NEXT: Section: .data +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#TOC_INDX+7]] +; SYM64-NEXT: SectionLen: 8 +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 3 +; SYM64-NEXT: SymbolType: XTY_SD (0x1) +; SYM64-NEXT: StorageMappingClass: XMC_TC (0x3) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: [[#TOC_INDX+8]] +; SYM64-NEXT: Name: globa +; SYM64-NEXT: Value (RelocatableAddress): 0xD8 +; SYM64-NEXT: Section: .data +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#TOC_INDX+9]] +; SYM64-NEXT: SectionLen: 8 +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 3 +; SYM64-NEXT: SymbolType: XTY_SD (0x1) +; SYM64-NEXT: StorageMappingClass: XMC_TC (0x3) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: [[#TOC_INDX+10]] +; SYM64-NEXT: Name: ptr +; SYM64-NEXT: Value (RelocatableAddress): 0xE0 +; SYM64-NEXT: Section: .data +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#TOC_INDX+11]] +; SYM64-NEXT: SectionLen: 8 +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 3 +; SYM64-NEXT: SymbolType: XTY_SD (0x1) +; SYM64-NEXT: StorageMappingClass: XMC_TC (0x3) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: [[#TOC_INDX+12]] +; SYM64-NEXT: Name: bar +; SYM64-NEXT: Value (RelocatableAddress): 0xE8 +; SYM64-NEXT: Section: .data +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#TOC_INDX+13]] +; SYM64-NEXT: SectionLen: 8 +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 3 +; SYM64-NEXT: SymbolType: XTY_SD (0x1) +; SYM64-NEXT: StorageMappingClass: XMC_TC (0x3) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: [[#TOC_INDX+14]] +; SYM64-NEXT: Name: foo +; SYM64-NEXT: Value (RelocatableAddress): 0xF0 +; SYM64-NEXT: Section: .data +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#TOC_INDX+15]] +; SYM64-NEXT: SectionLen: 8 +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 3 +; SYM64-NEXT: SymbolType: XTY_SD (0x1) +; SYM64-NEXT: StorageMappingClass: XMC_TC (0x3) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } +; SYM64-NEXT: Symbol { +; SYM64-NEXT: Index: [[#TOC_INDX+16]] +; SYM64-NEXT: Name: foobar +; SYM64-NEXT: Value (RelocatableAddress): 0xF8 +; SYM64-NEXT: Section: .data +; SYM64-NEXT: Type: 0x0 +; SYM64-NEXT: StorageClass: C_HIDEXT (0x6B) +; SYM64-NEXT: NumberOfAuxEntries: 1 +; SYM64-NEXT: CSECT Auxiliary Entry { +; SYM64-NEXT: Index: [[#TOC_INDX+17]] +; SYM64-NEXT: SectionLen: 8 +; SYM64-NEXT: ParameterHashIndex: 0x0 +; SYM64-NEXT: TypeChkSectNum: 0x0 +; SYM64-NEXT: SymbolAlignmentLog2: 3 +; SYM64-NEXT: SymbolType: XTY_SD (0x1) +; SYM64-NEXT: StorageMappingClass: XMC_TC (0x3) +; SYM64-NEXT: Auxiliary Type: AUX_CSECT (0xFB) +; SYM64-NEXT: } +; SYM64-NEXT: } diff --git a/llvm/tools/llvm-readobj/XCOFFDumper.cpp b/llvm/tools/llvm-readobj/XCOFFDumper.cpp --- a/llvm/tools/llvm-readobj/XCOFFDumper.cpp +++ b/llvm/tools/llvm-readobj/XCOFFDumper.cpp @@ -44,6 +44,7 @@ void printSectAuxEntForStat(const XCOFFSectAuxEntForStat *AuxEntPtr); void printSymbol(const SymbolRef &); void printRelocations(ArrayRef Sections); + void printRelocations64(ArrayRef Sections); const XCOFFObjectFile &Obj; }; } // anonymous namespace @@ -104,7 +105,8 @@ void XCOFFDumper::printRelocations() { if (Obj.is64Bit()) - llvm_unreachable("64-bit relocation output not implemented!"); + //llvm_unreachable("64-bit relocation output not implemented!"); + printRelocations64(Obj.sections64()); else printRelocations(Obj.sections32()); } @@ -133,7 +135,43 @@ if (Sec.Flags != XCOFF::STYP_TEXT && Sec.Flags != XCOFF::STYP_DATA && Sec.Flags != XCOFF::STYP_TDATA && Sec.Flags != XCOFF::STYP_DWARF) continue; - auto Relocations = unwrapOrError(Obj.getFileName(), Obj.relocations(Sec)); + auto Relocations = unwrapOrError(Obj.getFileName(), Obj.relocations32(Sec)); + if (Relocations.empty()) + continue; + + W.startLine() << "Section (index: " << Index << ") " << Sec.getName() + << " {\n"; + for (auto Reloc : Relocations) { + StringRef SymbolName = unwrapOrError( + Obj.getFileName(), Obj.getSymbolNameByIndex(Reloc.SymbolIndex)); + + DictScope RelocScope(W, "Relocation"); + W.printHex("Virtual Address", Reloc.VirtualAddress); + W.printNumber("Symbol", SymbolName, Reloc.SymbolIndex); + W.printString("IsSigned", Reloc.isRelocationSigned() ? "Yes" : "No"); + W.printNumber("FixupBitValue", Reloc.isFixupIndicated() ? 1 : 0); + W.printNumber("Length", Reloc.getRelocatedLength()); + W.printEnum("Type", (uint8_t)Reloc.Type, + makeArrayRef(RelocationTypeNameclass)); + } + W.unindent(); + W.startLine() << "}\n"; + } +} + +void XCOFFDumper::printRelocations64(ArrayRef Sections) { + if (!opts::ExpandRelocs) + report_fatal_error("Unexpanded relocation output not implemented."); + + ListScope LS(W, "Relocations"); + uint16_t Index = 0; + for (const auto &Sec : Sections) { + ++Index; + // Only the .text, .data, .tdata, and STYP_DWARF sections have relocation. + if (Sec.Flags != XCOFF::STYP_TEXT && Sec.Flags != XCOFF::STYP_DATA && + Sec.Flags != XCOFF::STYP_TDATA && Sec.Flags != XCOFF::STYP_DWARF) + continue; + auto Relocations = unwrapOrError(Obj.getFileName(), Obj.relocations64(Sec)); if (Relocations.empty()) continue;