Index: lld/ELF/Arch/PPC64.cpp =================================================================== --- lld/ELF/Arch/PPC64.cpp +++ lld/ELF/Arch/PPC64.cpp @@ -14,6 +14,8 @@ #include "llvm/Support/Endian.h" using namespace llvm; +using namespace llvm::object; +using namespace llvm::support::endian; using namespace llvm::ELF; using namespace lld; using namespace lld::elf; @@ -38,11 +40,13 @@ class PPC64 final : public TargetInfo { public: PPC64(); + uint32_t calcEFlags() const override; RelExpr getRelExpr(RelType Type, const Symbol &S, const uint8_t *Loc) const override; void writePlt(uint8_t *Buf, uint64_t GotPltEntryAddr, uint64_t PltEntryAddr, int32_t Index, unsigned RelOff) const override; void relocateOne(uint8_t *Loc, RelType Type, uint64_t Val) const override; + void writeGotHeader(uint8_t *Buf) const override; }; } // namespace @@ -65,6 +69,8 @@ GotPltEntrySize = 8; PltEntrySize = 32; PltHeaderSize = 0; + if (Config->EKind == ELF64LEKind) + GotHeaderEntriesNum = 1; // We need 64K pages (at least under glibc/Linux, the loader won't // set different permissions on a finer granularity than that). @@ -81,6 +87,38 @@ DefaultImageBase = 0x10000000; } +static uint32_t getEFlags(InputFile *File) { + // Get the e_flag from the input file and if it is unspecified, then set it to + // the e_flag appropriate for the ABI. + uint32_t EFlags = 0; + switch (Config->EKind) { + case ELF64BEKind: + EFlags = + cast>(ObjectFiles[0])->getObj().getHeader()->e_flags; + return EFlags == 0 ? 1 : EFlags; + case ELF64LEKind: + EFlags = + cast>(ObjectFiles[0])->getObj().getHeader()->e_flags; + return EFlags == 0 ? 2 : EFlags; + default: + llvm_unreachable("unknown Config->EKind"); + } +} + +uint32_t PPC64::calcEFlags() const { + assert(!ObjectFiles.empty()); + uint32_t Ret = getEFlags(ObjectFiles[0]); + + // Verify that all input files have the same e_flags. + for (InputFile *F : makeArrayRef(ObjectFiles).slice(1)) { + if (Ret == getEFlags(F)) + continue; + error("incompatible e_flags: " + toString(F)); + return 0; + } + return Ret; +} + RelExpr PPC64::getRelExpr(RelType Type, const Symbol &S, const uint8_t *Loc) const { switch (Type) { @@ -100,6 +138,11 @@ } } +void PPC64::writeGotHeader(uint8_t *Buf) const { + if (Config->EKind == ELF64LEKind) + write64(Buf, getPPC64TocBase()); +} + void PPC64::writePlt(uint8_t *Buf, uint64_t GotPltEntryAddr, uint64_t PltEntryAddr, int32_t Index, unsigned RelOff) const { Index: lld/ELF/SyntheticSections.cpp =================================================================== --- lld/ELF/SyntheticSections.cpp +++ lld/ELF/SyntheticSections.cpp @@ -590,7 +590,7 @@ Target->GotEntrySize, ".got") {} void GotSection::addEntry(Symbol &Sym) { - Sym.GotIndex = NumEntries; + Sym.GotIndex = Target->GotHeaderEntriesNum + NumEntries; ++NumEntries; } @@ -621,20 +621,24 @@ return B.GlobalDynIndex * Config->Wordsize; } -void GotSection::finalizeContents() { Size = NumEntries * Config->Wordsize; } +void GotSection::finalizeContents() { + Size = (NumEntries + Target->GotHeaderEntriesNum) * Config->Wordsize; +} bool GotSection::empty() const { // We need to emit a GOT even if it's empty if there's a relocation that is // relative to GOT(such as GOTOFFREL) or there's a symbol that points to a GOT // (i.e. _GLOBAL_OFFSET_TABLE_) that the target defines relative to the .got. - return NumEntries == 0 && !HasGotOffRel && - !(ElfSym::GlobalOffsetTable && !Target->GotBaseSymInGotPlt); + return (NumEntries == 0 && !Target->GotHeaderEntriesNum) && !HasGotOffRel && + !ElfSym::GlobalOffsetTable; } void GotSection::writeTo(uint8_t *Buf) { // Buf points to the start of this section's buffer, // whereas InputSectionBase::relocateAlloc() expects its argument // to point to the start of the output section. + Target->writeGotHeader(Buf); + Buf += Target->GotHeaderEntriesNum * Target->GotEntrySize; relocateAlloc(Buf - OutSecOff, Buf - OutSecOff + Size); } Index: lld/ELF/Target.h =================================================================== --- lld/ELF/Target.h +++ lld/ELF/Target.h @@ -28,6 +28,7 @@ virtual bool isPicRel(RelType Type) const { return true; } virtual RelType getDynRel(RelType Type) const { return Type; } virtual void writeGotPltHeader(uint8_t *Buf) const {} + virtual void writeGotHeader(uint8_t *Buf) const {} virtual void writeGotPlt(uint8_t *Buf, const Symbol &S) const {}; virtual void writeIgotPlt(uint8_t *Buf, const Symbol &S) const; virtual int64_t getImplicitAddend(const uint8_t *Buf, RelType Type) const; @@ -98,6 +99,9 @@ // to support lazy loading. unsigned GotPltHeaderEntriesNum = 3; + // On PPC ELF V2 abi, the first entry in the .got is the .TOC. + unsigned GotHeaderEntriesNum = 0; + // Set to 0 for variant 2 unsigned TcbSize = 0; Index: lld/ELF/Writer.cpp =================================================================== --- lld/ELF/Writer.cpp +++ lld/ELF/Writer.cpp @@ -190,8 +190,14 @@ Symtab->addAbsolute("__gnu_local_gp", STV_HIDDEN, STB_GLOBAL); } - ElfSym::GlobalOffsetTable = addOptionalRegular( - "_GLOBAL_OFFSET_TABLE_", Out::ElfHeader, Target->GotBaseSymOff); + // PPC64 does not define any _GLOBAL_OFFSET_TABLE_ symbol. Instead it uses the + // symbol .TOC. which points to the .got section + GotBaseSymOff. + if (Config->EMachine == EM_PPC64) + ElfSym::GlobalOffsetTable = + addOptionalRegular(".TOC.", Out::ElfHeader, Target->GotBaseSymOff); + else + ElfSym::GlobalOffsetTable = addOptionalRegular( + "_GLOBAL_OFFSET_TABLE_", Out::ElfHeader, Target->GotBaseSymOff); // __ehdr_start is the location of ELF file headers. Note that we define // this symbol unconditionally even when using a linker script, which Index: lld/test/ELF/basic-ppc64.s =================================================================== --- /dev/null +++ lld/test/ELF/basic-ppc64.s @@ -0,0 +1,342 @@ +# # RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %s -o %t +# RUN: ld.lld --hash-style=sysv -discard-all -shared %t -o %t2 +# RUN: llvm-readobj -file-headers -sections -section-data -program-headers %t2 | FileCheck %s +# REQUIRES: ppc +.abiversion 2 +# Exits with return code 55 on linux. +.text + li 0,1 + li 3,55 + sc + +// CHECK: Format: ELF64-ppc64 +// CHECK-NEXT: Arch: powerpc64le +// CHECK-NEXT: AddressSize: 64bit +// CHECK-NEXT: LoadName: +// CHECK-NEXT: ElfHeader { +// CHECK-NEXT: Ident { +// CHECK-NEXT: Magic: (7F 45 4C 46) +// CHECK-NEXT: Class: 64-bit (0x2) +// CHECK-NEXT: DataEncoding: LittleEndian (0x1) +// CHECK-NEXT: FileVersion: 1 +// CHECK-NEXT: OS/ABI: SystemV (0x0) +// CHECK-NEXT: ABIVersion: 0 +// CHECK-NEXT: Unused: (00 00 00 00 00 00 00) +// CHECK-NEXT: } +// CHECK-NEXT: Type: SharedObject (0x3) +// CHECK-NEXT: Machine: EM_PPC64 (0x15) +// CHECK-NEXT: Version: 1 +// CHECK-NEXT: Entry: 0x10000 +// CHECK-NEXT: ProgramHeaderOffset: 0x40 +// CHECK-NEXT: SectionHeaderOffset: 0x200F8 +// CHECK-NEXT: Flags [ (0x2) +// CHECK-NEXT: 0x2 +// CHECK-NEXT: ] +// CHECK-NEXT: HeaderSize: 64 +// CHECK-NEXT: ProgramHeaderEntrySize: 56 +// CHECK-NEXT: ProgramHeaderCount: 7 +// CHECK-NEXT: SectionHeaderEntrySize: 64 +// CHECK-NEXT: SectionHeaderCount: 11 +// CHECK-NEXT: StringTableSectionIndex: 9 +// CHECK-NEXT: } +// CHECK-NEXT: Sections [ +// CHECK-NEXT: Section { +// CHECK-NEXT: Index: 0 +// CHECK-NEXT: Name: (0) +// CHECK-NEXT: Type: SHT_NULL (0x0) +// CHECK-NEXT: Flags [ (0x0) +// CHECK-NEXT: ] +// CHECK-NEXT: Address: 0x0 +// CHECK-NEXT: Offset: 0x0 +// CHECK-NEXT: Size: 0 +// CHECK-NEXT: Link: 0 +// CHECK-NEXT: Info: 0 +// CHECK-NEXT: AddressAlignment: 0 +// CHECK-NEXT: EntrySize: 0 +// CHECK-NEXT: SectionData ( +// CHECK-NEXT: ) +// CHECK-NEXT: } +// CHECK-NEXT: Section { +// CHECK-NEXT: Index: 1 +// CHECK-NEXT: Name: .dynsym (1) +// CHECK-NEXT: Type: SHT_DYNSYM (0xB) +// CHECK-NEXT: Flags [ (0x2) +// CHECK-NEXT: SHF_ALLOC (0x2) +// CHECK-NEXT: ] +// CHECK-NEXT: Address: 0x1C8 +// CHECK-NEXT: Offset: 0x1C8 +// CHECK-NEXT: Size: 24 +// CHECK-NEXT: Link: 3 +// CHECK-NEXT: Info: 1 +// CHECK-NEXT: AddressAlignment: 8 +// CHECK-NEXT: EntrySize: 24 +// CHECK-NEXT: SectionData ( +// CHECK-NEXT: 0000: 00000000 00000000 00000000 00000000 |................| +// CHECK-NEXT: 0010: 00000000 00000000 |........| +// CHECK-NEXT: ) +// CHECK-NEXT: } +// CHECK-NEXT: Section { +// CHECK-NEXT: Index: 2 +// CHECK-NEXT: Name: .hash (9) +// CHECK-NEXT: Type: SHT_HASH (0x5) +// CHECK-NEXT: Flags [ (0x2) +// CHECK-NEXT: SHF_ALLOC (0x2) +// CHECK-NEXT: ] +// CHECK-NEXT: Address: 0x1E0 +// CHECK-NEXT: Offset: 0x1E0 +// CHECK-NEXT: Size: 16 +// CHECK-NEXT: Link: 1 +// CHECK-NEXT: Info: 0 +// CHECK-NEXT: AddressAlignment: 4 +// CHECK-NEXT: EntrySize: 4 +// CHECK-NEXT: SectionData ( +// CHECK-NEXT: 0000: 01000000 01000000 00000000 00000000 |................| +// CHECK-NEXT: ) +// CHECK-NEXT: } +// CHECK-NEXT: Section { +// CHECK-NEXT: Index: 3 +// CHECK-NEXT: Name: .dynstr (15) +// CHECK-NEXT: Type: SHT_STRTAB (0x3) +// CHECK-NEXT: Flags [ (0x2) +// CHECK-NEXT: SHF_ALLOC (0x2) +// CHECK-NEXT: ] +// CHECK-NEXT: Address: 0x1F0 +// CHECK-NEXT: Offset: 0x1F0 +// CHECK-NEXT: Size: 1 +// CHECK-NEXT: Link: 0 +// CHECK-NEXT: Info: 0 +// CHECK-NEXT: AddressAlignment: 1 +// CHECK-NEXT: EntrySize: 0 +// CHECK-NEXT: SectionData ( +// CHECK-NEXT: 0000: 00 |.| +// CHECK-NEXT: ) +// CHECK-NEXT: } +// CHECK-NEXT: Section { +// CHECK-NEXT: Index: 4 +// CHECK-NEXT: Name: .text (23) +// CHECK-NEXT: Type: SHT_PROGBITS (0x1) +// CHECK-NEXT: Flags [ (0x6) +// CHECK-NEXT: SHF_ALLOC (0x2) +// CHECK-NEXT: SHF_EXECINSTR (0x4) +// CHECK-NEXT: ] +// CHECK-NEXT: Address: 0x10000 +// CHECK-NEXT: Offset: 0x10000 +// CHECK-NEXT: Size: 12 +// CHECK-NEXT: Link: 0 +// CHECK-NEXT: Info: 0 +// CHECK-NEXT: AddressAlignment: 4 +// CHECK-NEXT: EntrySize: 0 +// CHECK-NEXT: SectionData ( +// CHECK-NEXT: 0000: 01000038 37006038 02000044 |...87.`8...D| +// CHECK-NEXT: ) +// CHECK-NEXT: } +// CHECK-NEXT: Section { +// CHECK-NEXT: Index: 5 +// CHECK-NEXT: Name: .dynamic (29) +// CHECK-NEXT: Type: SHT_DYNAMIC (0x6) +// CHECK-NEXT: Flags [ (0x3) +// CHECK-NEXT: SHF_ALLOC (0x2) +// CHECK-NEXT: SHF_WRITE (0x1) +// CHECK-NEXT: ] +// CHECK-NEXT: Address: 0x20000 +// CHECK-NEXT: Offset: 0x20000 +// CHECK-NEXT: Size: 96 +// CHECK-NEXT: Link: 3 +// CHECK-NEXT: Info: 0 +// CHECK-NEXT: AddressAlignment: 8 +// CHECK-NEXT: EntrySize: 16 +// CHECK-NEXT: SectionData ( +// CHECK-NEXT: 0000: 06000000 00000000 C8010000 00000000 |................| +// CHECK-NEXT: 0010: 0B000000 00000000 18000000 00000000 |................| +// CHECK-NEXT: 0020: 05000000 00000000 F0010000 00000000 |................| +// CHECK-NEXT: 0030: 0A000000 00000000 01000000 00000000 |................| +// CHECK-NEXT: 0040: 04000000 00000000 E0010000 00000000 |................| +// CHECK-NEXT: 0050: 00000000 00000000 00000000 00000000 |................| +// CHECK-NEXT: ) +// CHECK-NEXT: } +// CHECK-NEXT: Section { +// CHECK-NEXT: Index: 6 +// CHECK-NEXT: Name: .got (38) +// CHECK-NEXT: Type: SHT_PROGBITS (0x1) +// CHECK-NEXT: Flags [ (0x3) +// CHECK-NEXT: SHF_ALLOC (0x2) +// CHECK-NEXT: SHF_WRITE (0x1) +// CHECK-NEXT: ] +// CHECK-NEXT: Address: 0x20060 +// CHECK-NEXT: Offset: 0x20060 +// CHECK-NEXT: Size: 8 +// CHECK-NEXT: Link: 0 +// CHECK-NEXT: Info: 0 +// CHECK-NEXT: AddressAlignment: 8 +// CHECK-NEXT: EntrySize: 0 +// CHECK-NEXT: SectionData ( +// CHECK-NEXT: 0000: 60800200 00000000 |`.......| +// CHECK-NEXT: ) +// CHECK-NEXT: } +// CHECK-NEXT: Section { +// CHECK-NEXT: Index: 7 +// CHECK-NEXT: Name: .comment (43) +// CHECK-NEXT: Type: SHT_PROGBITS (0x1) +// CHECK-NEXT: Flags [ (0x30) +// CHECK-NEXT: SHF_MERGE (0x10) +// CHECK-NEXT: SHF_STRINGS (0x20) +// CHECK-NEXT: ] +// CHECK-NEXT: Address: 0x0 +// CHECK-NEXT: Offset: 0x20068 +// CHECK-NEXT: Size: 8 +// CHECK-NEXT: Link: 0 +// CHECK-NEXT: Info: 0 +// CHECK-NEXT: AddressAlignment: 1 +// CHECK-NEXT: EntrySize: 1 +// CHECK-NEXT: SectionData ( +// CHECK-NEXT: 0000: 4C4C4420 312E3000 |LLD 1.0.| +// CHECK-NEXT: ) +// CHECK-NEXT: } +// CHECK-NEXT: Section { +// CHECK-NEXT: Index: 8 +// CHECK-NEXT: Name: .symtab (52) +// CHECK-NEXT: Type: SHT_SYMTAB (0x2) +// CHECK-NEXT: Flags [ (0x0) +// CHECK-NEXT: ] +// CHECK-NEXT: Address: 0x0 +// CHECK-NEXT: Offset: 0x20070 +// CHECK-NEXT: Size: 48 +// CHECK-NEXT: Link: 10 +// CHECK-NEXT: Info: 2 +// CHECK-NEXT: AddressAlignment: 8 +// CHECK-NEXT: EntrySize: 24 +// CHECK-NEXT: SectionData ( +// CHECK-NEXT: 0000: 00000000 00000000 00000000 00000000 |................| +// CHECK-NEXT: 0010: 00000000 00000000 01000000 00020500 |................| +// CHECK-NEXT: 0020: 00000200 00000000 00000000 00000000 |................| +// CHECK-NEXT: ) +// CHECK-NEXT: } +// CHECK-NEXT: Section { +// CHECK-NEXT: Index: 9 +// CHECK-NEXT: Name: .shstrtab (60) +// CHECK-NEXT: Type: SHT_STRTAB (0x3) +// CHECK-NEXT: Flags [ (0x0) +// CHECK-NEXT: ] +// CHECK-NEXT: Address: 0x0 +// CHECK-NEXT: Offset: 0x200A0 +// CHECK-NEXT: Size: 78 +// CHECK-NEXT: Link: 0 +// CHECK-NEXT: Info: 0 +// CHECK-NEXT: AddressAlignment: 1 +// CHECK-NEXT: EntrySize: 0 +// CHECK-NEXT: SectionData ( +// CHECK-NEXT: 0000: 002E6479 6E73796D 002E6861 7368002E |..dynsym..hash..| +// CHECK-NEXT: 0010: 64796E73 7472002E 74657874 002E6479 |dynstr..text..dy| +// CHECK-NEXT: 0020: 6E616D69 63002E67 6F74002E 636F6D6D |namic..got..comm| +// CHECK-NEXT: 0030: 656E7400 2E73796D 74616200 2E736873 |ent..symtab..shs| +// CHECK-NEXT: 0040: 74727461 62002E73 74727461 6200 |trtab..strtab.| +// CHECK-NEXT: ) +// CHECK-NEXT: } +// CHECK-NEXT: Section { +// CHECK-NEXT: Index: 10 +// CHECK-NEXT: Name: .strtab (70) +// CHECK-NEXT: Type: SHT_STRTAB (0x3) +// CHECK-NEXT: Flags [ (0x0) +// CHECK-NEXT: ] +// CHECK-NEXT: Address: 0x0 +// CHECK-NEXT: Offset: 0x200EE +// CHECK-NEXT: Size: 10 +// CHECK-NEXT: Link: 0 +// CHECK-NEXT: Info: 0 +// CHECK-NEXT: AddressAlignment: 1 +// CHECK-NEXT: EntrySize: 0 +// CHECK-NEXT: SectionData ( +// CHECK-NEXT: 0000: 005F4459 4E414D49 4300 |._DYNAMIC.| +// CHECK-NEXT: ) +// CHECK-NEXT: } +// CHECK-NEXT: ] +// CHECK-NEXT: ProgramHeaders [ +// CHECK-NEXT: ProgramHeader { +// CHECK-NEXT: Type: PT_PHDR (0x6) +// CHECK-NEXT: Offset: 0x40 +// CHECK-NEXT: VirtualAddress: 0x40 +// CHECK-NEXT: PhysicalAddress: 0x40 +// CHECK-NEXT: FileSize: 392 +// CHECK-NEXT: MemSize: 392 +// CHECK-NEXT: Flags [ (0x4) +// CHECK-NEXT: PF_R (0x4) +// CHECK-NEXT: ] +// CHECK-NEXT: Alignment: 8 +// CHECK-NEXT: } +// CHECK-NEXT: ProgramHeader { +// CHECK-NEXT: Type: PT_LOAD (0x1) +// CHECK-NEXT: Offset: 0x0 +// CHECK-NEXT: VirtualAddress: 0x0 +// CHECK-NEXT: PhysicalAddress: 0x0 +// CHECK-NEXT: FileSize: 497 +// CHECK-NEXT: MemSize: 497 +// CHECK-NEXT: Flags [ (0x4) +// CHECK-NEXT: PF_R (0x4) +// CHECK-NEXT: ] +// CHECK-NEXT: Alignment: 65536 +// CHECK-NEXT: } +// CHECK-NEXT: ProgramHeader { +// CHECK-NEXT: Type: PT_LOAD (0x1) +// CHECK-NEXT: Offset: 0x10000 +// CHECK-NEXT: VirtualAddress: 0x10000 +// CHECK-NEXT: PhysicalAddress: 0x10000 +// CHECK-NEXT: FileSize: 12 +// CHECK-NEXT: MemSize: 12 +// CHECK-NEXT: Flags [ (0x5) +// CHECK-NEXT: PF_R (0x4) +// CHECK-NEXT: PF_X (0x1) +// CHECK-NEXT: ] +// CHECK-NEXT: Alignment: 65536 +// CHECK-NEXT: } +// CHECK-NEXT: ProgramHeader { +// CHECK-NEXT: Type: PT_LOAD (0x1) +// CHECK-NEXT: Offset: 0x20000 +// CHECK-NEXT: VirtualAddress: 0x20000 +// CHECK-NEXT: PhysicalAddress: 0x20000 +// CHECK-NEXT: FileSize: 104 +// CHECK-NEXT: MemSize: 104 +// CHECK-NEXT: Flags [ (0x6) +// CHECK-NEXT: PF_R (0x4) +// CHECK-NEXT: PF_W (0x2) +// CHECK-NEXT: ] +// CHECK-NEXT: Alignment: 65536 +// CHECK-NEXT: } +// CHECK-NEXT: ProgramHeader { +// CHECK-NEXT: Type: PT_DYNAMIC (0x2) +// CHECK-NEXT: Offset: 0x20000 +// CHECK-NEXT: VirtualAddress: 0x20000 +// CHECK-NEXT: PhysicalAddress: 0x20000 +// CHECK-NEXT: FileSize: 96 +// CHECK-NEXT: MemSize: 96 +// CHECK-NEXT: Flags [ (0x6) +// CHECK-NEXT: PF_R (0x4) +// CHECK-NEXT: PF_W (0x2) +// CHECK-NEXT: ] +// CHECK-NEXT: Alignment: 8 +// CHECK-NEXT: } +// CHECK-NEXT: ProgramHeader { +// CHECK-NEXT: Type: PT_GNU_RELRO (0x6474E552) +// CHECK-NEXT: Offset: 0x20000 +// CHECK-NEXT: VirtualAddress: 0x20000 +// CHECK-NEXT: PhysicalAddress: 0x20000 +// CHECK-NEXT: FileSize: 104 +// CHECK-NEXT: MemSize: 4096 +// CHECK-NEXT: Flags [ (0x4) +// CHECK-NEXT: PF_R (0x4) +// CHECK-NEXT: ] +// CHECK-NEXT: Alignment: 1 +// CHECK-NEXT: } +// CHECK-NEXT: ProgramHeader { +// CHECK-NEXT: Type: PT_GNU_STACK (0x6474E551) +// CHECK-NEXT: Offset: 0x0 +// CHECK-NEXT: VirtualAddress: 0x0 +// CHECK-NEXT: PhysicalAddress: 0x0 +// CHECK-NEXT: FileSize: 0 +// CHECK-NEXT: MemSize: 0 +// CHECK-NEXT: Flags [ (0x6) +// CHECK-NEXT: PF_R (0x4) +// CHECK-NEXT: PF_W (0x2) +// CHECK-NEXT: ] +// CHECK-NEXT: Alignment: 0 +// CHECK-NEXT: } +// CHECK-NEXT: ] Index: lld/test/ELF/basic64be.s =================================================================== --- lld/test/ELF/basic64be.s +++ lld/test/ELF/basic64be.s @@ -39,7 +39,8 @@ # CHECK-NEXT: Entry: 0x10020040 # CHECK-NEXT: ProgramHeaderOffset: 0x40 # CHECK-NEXT: SectionHeaderOffset: 0x30080 -# CHECK-NEXT: Flags [ (0x0) +# CHECK-NEXT: Flags [ (0x1) +# CHECK-NEXT: 0x1 # CHECK-NEXT: ] # CHECK-NEXT: HeaderSize: 64 # CHECK-NEXT: ProgramHeaderEntrySize: 56 Index: lld/test/ELF/emulation.s =================================================================== --- lld/test/ELF/emulation.s +++ lld/test/ELF/emulation.s @@ -208,7 +208,8 @@ # PPC64-NEXT: Entry: # PPC64-NEXT: ProgramHeaderOffset: 0x40 # PPC64-NEXT: SectionHeaderOffset: -# PPC64-NEXT: Flags [ (0x0) +# PPC64-NEXT: Flags [ (0x1) +# PPC64-NEXT: 0x1 # PPC64-NEXT: ] # PPC64-NEXT: HeaderSize: 64 # PPC64-NEXT: ProgramHeaderEntrySize: 56 @@ -239,7 +240,8 @@ # PPC64LE-NEXT: Entry: # PPC64LE-NEXT: ProgramHeaderOffset: 0x40 # PPC64LE-NEXT: SectionHeaderOffset: -# PPC64LE-NEXT: Flags [ (0x0) +# PPC64LE-NEXT: Flags [ (0x2) +# PPC64LE-NEXT: 0x2 # PPC64LE-NEXT: ] # PPC64LE-NEXT: HeaderSize: 64 # PPC64LE-NEXT: ProgramHeaderEntrySize: 56