Index: lld/trunk/ELF/SyntheticSections.h =================================================================== --- lld/trunk/ELF/SyntheticSections.h +++ lld/trunk/ELF/SyntheticSections.h @@ -149,6 +149,7 @@ template InputSection *createCommonSection(); template InputSection *createInterpSection(); +template MergeInputSection *createCommentSection(); // Linker generated sections which can be used as inputs. template struct In { Index: lld/trunk/ELF/SyntheticSections.cpp =================================================================== --- lld/trunk/ELF/SyntheticSections.cpp +++ lld/trunk/ELF/SyntheticSections.cpp @@ -25,12 +25,14 @@ #include "Target.h" #include "Writer.h" +#include "lld/Config/Version.h" #include "lld/Core/Parallel.h" #include "llvm/Support/Endian.h" #include "llvm/Support/MD5.h" #include "llvm/Support/RandomNumberGenerator.h" #include "llvm/Support/SHA1.h" #include "llvm/Support/xxhash.h" +#include using namespace llvm; using namespace llvm::ELF; @@ -78,6 +80,36 @@ return Ret; } +// Returns an LLD version string. +static ArrayRef getVersion() { + // Check LLD_VERSION first for ease of testing. + // You can get consitent output by using the environment variable. + // This is only for testing. + StringRef S = getenv("LLD_VERSION"); + if (S.empty()) + S = Saver.save(Twine("Linker: ") + getLLDVersion()); + + // +1 to include the terminating '\0'. + return {(const uint8_t *)S.data(), S.size() + 1}; +}; + +// Creates a .comment section containing LLD version info. +// With this feature, you can identify LLD-generated binaries easily +// by "objdump -s -j .comment ". +// The returned object is a mergeable string section. +template MergeInputSection *elf::createCommentSection() { + typename ELFT::Shdr Hdr = {}; + Hdr.sh_flags = SHF_MERGE | SHF_STRINGS; + Hdr.sh_type = SHT_PROGBITS; + Hdr.sh_entsize = 1; + Hdr.sh_addralign = 1; + + auto *Ret = make>(/*file=*/nullptr, &Hdr, ".comment"); + Ret->Data = getVersion(); + Ret->splitIntoPieces(); + return Ret; +} + // Iterate over sections of the specified type. For each section call // provided function. After that "kill" the section by turning off // "Live" flag, so that they won't be included in the final output. @@ -352,6 +384,11 @@ template InputSection *elf::createInterpSection(); template InputSection *elf::createInterpSection(); +template MergeInputSection *elf::createCommentSection(); +template MergeInputSection *elf::createCommentSection(); +template MergeInputSection *elf::createCommentSection(); +template MergeInputSection *elf::createCommentSection(); + template class elf::MipsAbiFlagsSection; template class elf::MipsAbiFlagsSection; template class elf::MipsAbiFlagsSection; Index: lld/trunk/ELF/Writer.cpp =================================================================== --- lld/trunk/ELF/Writer.cpp +++ lld/trunk/ELF/Writer.cpp @@ -268,6 +268,8 @@ Out::VerDef = make>(); // Initialize linker generated sections + Symtab::X->Sections.push_back(createCommentSection()); + if (Config->BuildId == BuildIdKind::Fast) In::BuildId = make>(); else if (Config->BuildId == BuildIdKind::Md5) Index: lld/trunk/test/ELF/aarch64-gnu-ifunc.s =================================================================== --- lld/trunk/test/ELF/aarch64-gnu-ifunc.s +++ lld/trunk/test/ELF/aarch64-gnu-ifunc.s @@ -15,7 +15,7 @@ // CHECK-NEXT: Address: [[RELA:.*]] // CHECK-NEXT: Offset: 0x158 // CHECK-NEXT: Size: 48 -// CHECK-NEXT: Link: 5 +// CHECK-NEXT: Link: 6 // CHECK-NEXT: Info: 0 // CHECK-NEXT: AddressAlignment: 8 // CHECK-NEXT: EntrySize: 24 Index: lld/trunk/test/ELF/basic-aarch64.s =================================================================== --- lld/trunk/test/ELF/basic-aarch64.s +++ lld/trunk/test/ELF/basic-aarch64.s @@ -26,15 +26,15 @@ # CHECK-NEXT: Version: 1 # CHECK-NEXT: Entry: [[ENTRY:0x[0-9A-F]+]] # CHECK-NEXT: ProgramHeaderOffset: 0x40 -# CHECK-NEXT: SectionHeaderOffset: 0x10088 +# CHECK-NEXT: SectionHeaderOffset: 0x10098 # CHECK-NEXT: Flags [ (0x0) # CHECK-NEXT: ] # CHECK-NEXT: HeaderSize: 64 # CHECK-NEXT: ProgramHeaderEntrySize: 56 # CHECK-NEXT: ProgramHeaderCount: 4 # CHECK-NEXT: SectionHeaderEntrySize: 64 -# CHECK-NEXT: SectionHeaderCount: 5 -# CHECK-NEXT: StringTableSectionIndex: 3 +# CHECK-NEXT: SectionHeaderCount: 6 +# CHECK-NEXT: StringTableSectionIndex: 4 # CHECK-NEXT: } # CHECK-NEXT: Sections [ # CHECK-NEXT: Section { @@ -69,40 +69,56 @@ # CHECK-NEXT: } # CHECK-NEXT: Section { # CHECK-NEXT: Index: 2 +# CHECK-NEXT: Name: .comment +# 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: 0x1000C +# CHECK-NEXT: Size: 8 +# CHECK-NEXT: Link: 0 +# CHECK-NEXT: Info: 0 +# CHECK-NEXT: AddressAlignment: 1 +# CHECK-NEXT: EntrySize: 1 +# CHECK-NEXT: } +# CHECK-NEXT: Section { +# CHECK-NEXT: Index: 3 # CHECK-NEXT: Name: .symtab # CHECK-NEXT: Type: SHT_SYMTAB (0x2) # CHECK-NEXT: Flags [ (0x0) # CHECK-NEXT: ] # CHECK-NEXT: Address: 0x0 -# CHECK-NEXT: Offset: 0x10010 +# CHECK-NEXT: Offset: 0x10018 # CHECK-NEXT: Size: 72 -# CHECK-NEXT: Link: 4 +# CHECK-NEXT: Link: 5 # CHECK-NEXT: Info: 2 # CHECK-NEXT: AddressAlignment: 8 # CHECK-NEXT: EntrySize: 24 # CHECK-NEXT: } # CHECK-NEXT: Section { -# CHECK-NEXT: Index: 3 +# CHECK-NEXT: Index: 4 # CHECK-NEXT: Name: .shstrtab # CHECK-NEXT: Type: SHT_STRTAB (0x3) # CHECK-NEXT: Flags [ (0x0) # CHECK-NEXT: ] # CHECK-NEXT: Address: 0x0 -# CHECK-NEXT: Offset: 0x10058 -# CHECK-NEXT: Size: 33 +# CHECK-NEXT: Offset: 0x10060 +# CHECK-NEXT: Size: 42 # CHECK-NEXT: Link: 0 # CHECK-NEXT: Info: 0 # CHECK-NEXT: AddressAlignment: 1 # CHECK-NEXT: EntrySize: 0 # CHECK-NEXT: } # CHECK-NEXT: Section { -# CHECK-NEXT: Index: 4 +# CHECK-NEXT: Index: 5 # CHECK-NEXT: Name: .strtab # CHECK-NEXT: Type: SHT_STRTAB (0x3) # CHECK-NEXT: Flags [ (0x0) # CHECK-NEXT: ] # CHECK-NEXT: Address: 0x0 -# CHECK-NEXT: Offset: 0x10079 +# CHECK-NEXT: Offset: 0x1008A # CHECK-NEXT: Size: 13 # CHECK-NEXT: Link: 0 # CHECK-NEXT: Info: 0 Index: lld/trunk/test/ELF/basic-mips.s =================================================================== --- lld/trunk/test/ELF/basic-mips.s +++ lld/trunk/test/ELF/basic-mips.s @@ -27,7 +27,7 @@ # CHECK-NEXT: Version: 1 # CHECK-NEXT: Entry: 0x20000 # CHECK-NEXT: ProgramHeaderOffset: 0x34 -# CHECK-NEXT: SectionHeaderOffset: 0x30088 +# CHECK-NEXT: SectionHeaderOffset: 0x30098 # CHECK-NEXT: Flags [ # CHECK-NEXT: EF_MIPS_ABI_O32 # CHECK-NEXT: EF_MIPS_ARCH_32 @@ -37,8 +37,8 @@ # CHECK-NEXT: ProgramHeaderEntrySize: 32 # CHECK-NEXT: ProgramHeaderCount: 6 # CHECK-NEXT: SectionHeaderEntrySize: 40 -# CHECK-NEXT: SectionHeaderCount: 10 -# CHECK-NEXT: StringTableSectionIndex: 8 +# CHECK-NEXT: SectionHeaderCount: 11 +# CHECK-NEXT: StringTableSectionIndex: 9 # CHECK-NEXT: } # CHECK-NEXT: Sections [ # CHECK-NEXT: Section { @@ -152,40 +152,56 @@ # CHECK-NEXT: } # CHECK-NEXT: Section { # CHECK-NEXT: Index: 7 +# CHECK-NEXT: Name: .comment +# 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: 0x30000 +# CHECK-NEXT: Size: 8 +# CHECK-NEXT: Link: 0 +# CHECK-NEXT: Info: 0 +# CHECK-NEXT: AddressAlignment: 1 +# CHECK-NEXT: EntrySize: 1 +# CHECK-NEXT: } +# CHECK-NEXT: Section { +# CHECK-NEXT: Index: 8 # CHECK-NEXT: Name: .symtab # CHECK-NEXT: Type: SHT_SYMTAB (0x2) # CHECK-NEXT: Flags [ (0x0) # CHECK-NEXT: ] # CHECK-NEXT: Address: 0x0 -# CHECK-NEXT: Offset: 0x30000 +# CHECK-NEXT: Offset: 0x30008 # CHECK-NEXT: Size: 48 -# CHECK-NEXT: Link: 9 +# CHECK-NEXT: Link: 10 # CHECK-NEXT: Info: 1 # CHECK-NEXT: AddressAlignment: 4 # CHECK-NEXT: EntrySize: 16 # CHECK-NEXT: } # CHECK-NEXT: Section { -# CHECK-NEXT: Index: 8 +# CHECK-NEXT: Index: 9 # CHECK-NEXT: Name: .shstrtab # CHECK-NEXT: Type: SHT_STRTAB (0x3) # CHECK-NEXT: Flags [ (0x0) # CHECK-NEXT: ] # CHECK-NEXT: Address: 0x0 -# CHECK-NEXT: Offset: 0x30030 -# CHECK-NEXT: Size: 73 +# CHECK-NEXT: Offset: 0x30038 +# CHECK-NEXT: Size: 82 # CHECK-NEXT: Link: 0 # CHECK-NEXT: Info: 0 # CHECK-NEXT: AddressAlignment: 1 # CHECK-NEXT: EntrySize: 0 # CHECK-NEXT: } # CHECK-NEXT: Section { -# CHECK-NEXT: Index: 9 +# CHECK-NEXT: Index: 10 # CHECK-NEXT: Name: .strtab # CHECK-NEXT: Type: SHT_STRTAB (0x3) # CHECK-NEXT: Flags [ (0x0) # CHECK-NEXT: ] # CHECK-NEXT: Address: 0x0 -# CHECK-NEXT: Offset: 0x30079 +# CHECK-NEXT: Offset: 0x3008A # CHECK-NEXT: Size: 13 # CHECK-NEXT: Link: 0 # CHECK-NEXT: Info: 0 Index: lld/trunk/test/ELF/basic-ppc.s =================================================================== --- lld/trunk/test/ELF/basic-ppc.s +++ lld/trunk/test/ELF/basic-ppc.s @@ -28,15 +28,15 @@ // CHECK-NEXT: Version: 1 // CHECK-NEXT: Entry: 0x0 // CHECK-NEXT: ProgramHeaderOffset: 0x34 -// CHECK-NEXT: SectionHeaderOffset: 0x209C +// CHECK-NEXT: SectionHeaderOffset: 0x20AC // CHECK-NEXT: Flags [ (0x0) // CHECK-NEXT: ] // CHECK-NEXT: HeaderSize: 52 // CHECK-NEXT: ProgramHeaderEntrySize: 32 // CHECK-NEXT: ProgramHeaderCount: 7 // CHECK-NEXT: SectionHeaderEntrySize: 40 -// CHECK-NEXT: SectionHeaderCount: 9 -// CHECK-NEXT: StringTableSectionIndex: 7 +// CHECK-NEXT: SectionHeaderCount: 10 +// CHECK-NEXT: StringTableSectionIndex: 8 // CHECK-NEXT: } // CHECK-NEXT: Sections [ // CHECK-NEXT: Section { @@ -151,14 +151,33 @@ // CHECK-NEXT: } // CHECK-NEXT: Section { // CHECK-NEXT: Index: 6 +// CHECK-NEXT: Name: .comment +// 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: 0x2030 +// 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: 7 // CHECK-NEXT: Name: .symtab // CHECK-NEXT: Type: SHT_SYMTAB (0x2) // CHECK-NEXT: Flags [ (0x0) // CHECK-NEXT: ] // CHECK-NEXT: Address: 0x0 -// CHECK-NEXT: Offset: 0x2030 +// CHECK-NEXT: Offset: 0x2038 // CHECK-NEXT: Size: 32 -// CHECK-NEXT: Link: 8 +// CHECK-NEXT: Link: 9 // CHECK-NEXT: Info: 1 // CHECK-NEXT: AddressAlignment: 4 // CHECK-NEXT: EntrySize: 16 @@ -168,14 +187,14 @@ // CHECK-NEXT: ) // CHECK-NEXT: } // CHECK-NEXT: Section { -// CHECK-NEXT: Index: 7 +// CHECK-NEXT: Index: 8 // CHECK-NEXT: Name: .shstrtab // CHECK-NEXT: Type: SHT_STRTAB (0x3) // CHECK-NEXT: Flags [ (0x0) // CHECK-NEXT: ] // CHECK-NEXT: Address: 0x0 -// CHECK-NEXT: Offset: 0x2050 -// CHECK-NEXT: Size: 64 +// CHECK-NEXT: Offset: 0x2058 +// CHECK-NEXT: Size: 73 // CHECK-NEXT: Link: 0 // CHECK-NEXT: Info: 0 // CHECK-NEXT: AddressAlignment: 1 @@ -183,18 +202,19 @@ // 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 63002E73 796D7461 62002E73 |namic..symtab..s| -// CHECK-NEXT: 0030: 68737472 74616200 2E737472 74616200 |hstrtab..strtab.| +// CHECK-NEXT: 0020: 6E616D69 63002E63 6F6D6D65 6E74002E |namic..comment..| +// CHECK-NEXT: 0030: 73796D74 6162002E 73687374 72746162 |symtab..shstrtab| +// CHECK-NEXT: 0040: 002E7374 72746162 00 |..strtab.| // CHECK-NEXT: ) // CHECK-NEXT: } // CHECK-NEXT: Section { -// CHECK-NEXT: Index: 8 +// CHECK-NEXT: Index: 9 // CHECK-NEXT: Name: .strtab // CHECK-NEXT: Type: SHT_STRTAB (0x3) // CHECK-NEXT: Flags [ (0x0) // CHECK-NEXT: ] // CHECK-NEXT: Address: 0x0 -// CHECK-NEXT: Offset: 0x2090 +// CHECK-NEXT: Offset: 0x20A1 // CHECK-NEXT: Size: 1 // CHECK-NEXT: Link: 0 // CHECK-NEXT: Info: 0 Index: lld/trunk/test/ELF/basic.s =================================================================== --- lld/trunk/test/ELF/basic.s +++ lld/trunk/test/ELF/basic.s @@ -27,15 +27,15 @@ # CHECK-NEXT: Version: 1 # CHECK-NEXT: Entry: [[ENTRY:0x[0-9A-F]+]] # CHECK-NEXT: ProgramHeaderOffset: 0x40 -# CHECK-NEXT: SectionHeaderOffset: 0x1070 +# CHECK-NEXT: SectionHeaderOffset: 0x1080 # CHECK-NEXT: Flags [ (0x0) # CHECK-NEXT: ] # CHECK-NEXT: HeaderSize: 64 # CHECK-NEXT: ProgramHeaderEntrySize: 56 # CHECK-NEXT: ProgramHeaderCount: 4 # CHECK-NEXT: SectionHeaderEntrySize: 64 -# CHECK-NEXT: SectionHeaderCount: 5 -# CHECK-NEXT: StringTableSectionIndex: 3 +# CHECK-NEXT: SectionHeaderCount: 6 +# CHECK-NEXT: StringTableSectionIndex: 4 # CHECK-NEXT: } # CHECK-NEXT: Sections [ # CHECK-NEXT: Section { @@ -70,40 +70,56 @@ # CHECK-NEXT: } # CHECK-NEXT: Section { # CHECK-NEXT: Index: 2 +# CHECK-NEXT: Name: .comment +# 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: 0x1010 +# CHECK-NEXT: Size: 8 +# CHECK-NEXT: Link: 0 +# CHECK-NEXT: Info: 0 +# CHECK-NEXT: AddressAlignment: 1 +# CHECK-NEXT: EntrySize: 1 +# CHECK-NEXT: } +# CHECK-NEXT: Section { +# CHECK-NEXT: Index: 3 # CHECK-NEXT: Name: .symtab # CHECK-NEXT: Type: SHT_SYMTAB (0x2) # CHECK-NEXT: Flags [ (0x0) # CHECK-NEXT: ] # CHECK-NEXT: Address: 0x0 -# CHECK-NEXT: Offset: 0x1010 +# CHECK-NEXT: Offset: 0x1018 # CHECK-NEXT: Size: 48 -# CHECK-NEXT: Link: 4 +# CHECK-NEXT: Link: 5 # CHECK-NEXT: Info: 1 # CHECK-NEXT: AddressAlignment: 8 # CHECK-NEXT: EntrySize: 24 # CHECK-NEXT: } # CHECK-NEXT: Section { -# CHECK-NEXT: Index: 3 +# CHECK-NEXT: Index: 4 # CHECK-NEXT: Name: .shstrtab # CHECK-NEXT: Type: SHT_STRTAB (0x3) # CHECK-NEXT: Flags [ (0x0) # CHECK-NEXT: ] # CHECK-NEXT: Address: 0x0 -# CHECK-NEXT: Offset: 0x1040 -# CHECK-NEXT: Size: 33 +# CHECK-NEXT: Offset: 0x1048 +# CHECK-NEXT: Size: 42 # CHECK-NEXT: Link: 0 # CHECK-NEXT: Info: 0 # CHECK-NEXT: AddressAlignment: 1 # CHECK-NEXT: EntrySize: 0 # CHECK-NEXT: } # CHECK-NEXT: Section { -# CHECK-NEXT: Index: 4 +# CHECK-NEXT: Index: 5 # CHECK-NEXT: Name: .strtab # CHECK-NEXT: Type: SHT_STRTAB (0x3) # CHECK-NEXT: Flags [ (0x0) # CHECK-NEXT: ] # CHECK-NEXT: Address: 0x0 -# CHECK-NEXT: Offset: 0x1061 +# CHECK-NEXT: Offset: 0x1072 # CHECK-NEXT: Size: 8 # CHECK-NEXT: Link: 0 # CHECK-NEXT: Info: 0 Index: lld/trunk/test/ELF/basic32.s =================================================================== --- lld/trunk/test/ELF/basic32.s +++ lld/trunk/test/ELF/basic32.s @@ -25,15 +25,15 @@ # CHECK-NEXT: Version: 1 # CHECK-NEXT: Entry: 0x11000 # CHECK-NEXT: ProgramHeaderOffset: 0x34 -# CHECK-NEXT: SectionHeaderOffset: 0x1058 +# CHECK-NEXT: SectionHeaderOffset: 0x1068 # CHECK-NEXT: Flags [ (0x0) # CHECK-NEXT: ] # CHECK-NEXT: HeaderSize: 52 # CHECK-NEXT: ProgramHeaderEntrySize: 32 # CHECK-NEXT: ProgramHeaderCount: 4 # CHECK-NEXT: SectionHeaderEntrySize: 40 -# CHECK-NEXT: SectionHeaderCount: 5 -# CHECK-NEXT: StringTableSectionIndex: 3 +# CHECK-NEXT: SectionHeaderCount: 6 +# CHECK-NEXT: StringTableSectionIndex: 4 # CHECK-NEXT: } # CHECK-NEXT: Sections [ # CHECK-NEXT: Section { @@ -68,40 +68,56 @@ # CHECK-NEXT: } # CHECK-NEXT: Section { # CHECK-NEXT: Index: 2 +# CHECK-NEXT: Name: .comment +# 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: 0x100C +# CHECK-NEXT: Size: 8 +# CHECK-NEXT: Link: 0 +# CHECK-NEXT: Info: 0 +# CHECK-NEXT: AddressAlignment: 1 +# CHECK-NEXT: EntrySize: 1 +# CHECK-NEXT: } +# CHECK-NEXT: Section { +# CHECK-NEXT: Index: 3 # CHECK-NEXT: Name: .symtab # CHECK-NEXT: Type: SHT_SYMTAB # CHECK-NEXT: Flags [ # CHECK-NEXT: ] # CHECK-NEXT: Address: 0x0 -# CHECK-NEXT: Offset: 0x100C +# CHECK-NEXT: Offset: 0x1014 # CHECK-NEXT: Size: 32 -# CHECK-NEXT: Link: 4 +# CHECK-NEXT: Link: 5 # CHECK-NEXT: Info: 1 # CHECK-NEXT: AddressAlignment: 4 # CHECK-NEXT: EntrySize: 16 # CHECK-NEXT: } # CHECK-NEXT: Section { -# CHECK-NEXT: Index: 3 +# CHECK-NEXT: Index: 4 # CHECK-NEXT: Name: .shstrtab # CHECK-NEXT: Type: SHT_STRTAB (0x3) # CHECK-NEXT: Flags [ (0x0) # CHECK-NEXT: ] # CHECK-NEXT: Address: 0x0 -# CHECK-NEXT: Offset: 0x102C -# CHECK-NEXT: Size: 33 +# CHECK-NEXT: Offset: 0x1034 +# CHECK-NEXT: Size: 42 # CHECK-NEXT: Link: 0 # CHECK-NEXT: Info: 0 # CHECK-NEXT: AddressAlignment: 1 # CHECK-NEXT: EntrySize: 0 # CHECK-NEXT: } # CHECK-NEXT: Section { -# CHECK-NEXT: Index: 4 +# CHECK-NEXT: Index: 5 # CHECK-NEXT: Name: .strtab # CHECK-NEXT: Type: SHT_STRTAB (0x3) # CHECK-NEXT: Flags [ (0x0) # CHECK-NEXT: ] # CHECK-NEXT: Address: 0x0 -# CHECK-NEXT: Offset: 0x104D +# CHECK-NEXT: Offset: 0x105E # CHECK-NEXT: Size: 8 # CHECK-NEXT: Link: 0 # CHECK-NEXT: Info: 0 Index: lld/trunk/test/ELF/basic64be.s =================================================================== --- lld/trunk/test/ELF/basic64be.s +++ lld/trunk/test/ELF/basic64be.s @@ -38,15 +38,15 @@ # CHECK-NEXT: Version: 1 # CHECK-NEXT: Entry: 0x10020040 # CHECK-NEXT: ProgramHeaderOffset: 0x40 -# CHECK-NEXT: SectionHeaderOffset: 0x200C8 +# CHECK-NEXT: SectionHeaderOffset: 0x200D8 # CHECK-NEXT: Flags [ (0x0) # CHECK-NEXT: ] # CHECK-NEXT: HeaderSize: 64 # CHECK-NEXT: ProgramHeaderEntrySize: 56 # CHECK-NEXT: ProgramHeaderCount: 6 # CHECK-NEXT: SectionHeaderEntrySize: 64 -# CHECK-NEXT: SectionHeaderCount: 9 -# CHECK-NEXT: StringTableSectionIndex: 7 +# CHECK-NEXT: SectionHeaderCount: 10 +# CHECK-NEXT: StringTableSectionIndex: 8 # CHECK-NEXT: } # CHECK-NEXT: Sections [ # CHECK-NEXT: Section { @@ -163,14 +163,33 @@ # CHECK-NEXT: } # CHECK-NEXT: Section { # CHECK-NEXT: Index: 6 +# CHECK-NEXT: Name: .comment +# 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: 0x20058 +# 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: 7 # CHECK-NEXT: Name: .symtab # CHECK-NEXT: Type: SHT_SYMTAB (0x2) # CHECK-NEXT: Flags [ (0x0) # CHECK-NEXT: ] # CHECK-NEXT: Address: 0x0 -# CHECK-NEXT: Offset: 0x20058 +# CHECK-NEXT: Offset: 0x20060 # CHECK-NEXT: Size: 48 -# CHECK-NEXT: Link: 8 +# CHECK-NEXT: Link: 9 # CHECK-NEXT: Info: 1 # CHECK-NEXT: AddressAlignment: 8 # CHECK-NEXT: EntrySize: 24 @@ -178,14 +197,14 @@ # CHECK: ) # CHECK-NEXT: } # CHECK-NEXT: Section { -# CHECK-NEXT: Index: 7 +# CHECK-NEXT: Index: 8 # CHECK-NEXT: Name: .shstrtab # CHECK-NEXT: Type: SHT_STRTAB # CHECK-NEXT: Flags [ # CHECK-NEXT: ] # CHECK-NEXT: Address: 0x0 -# CHECK-NEXT: Offset: 0x20088 -# CHECK-NEXT: Size: 54 +# CHECK-NEXT: Offset: 0x20090 +# CHECK-NEXT: Size: 63 # CHECK-NEXT: Link: 0 # CHECK-NEXT: Info: 0 # CHECK-NEXT: AddressAlignment: 1 @@ -194,13 +213,13 @@ # CHECK: ) # CHECK-NEXT: } # CHECK-NEXT: Section { -# CHECK-NEXT: Index: 8 +# CHECK-NEXT: Index: 9 # CHECK-NEXT: Name: .strtab # CHECK-NEXT: Type: SHT_STRTAB # CHECK-NEXT: Flags [ (0x0) # CHECK-NEXT: ] # CHECK-NEXT: Address: 0x0 -# CHECK-NEXT: Offset: 0x200BE +# CHECK-NEXT: Offset: 0x200CF # CHECK-NEXT: Size: 8 # CHECK-NEXT: Link: 0 # CHECK-NEXT: Info: 0 Index: lld/trunk/test/ELF/build-id.s =================================================================== --- lld/trunk/test/ELF/build-id.s +++ lld/trunk/test/ELF/build-id.s @@ -34,19 +34,15 @@ # DEFAULT: Contents of section .note.test: # DEFAULT: Contents of section .note.gnu.build-id: # DEFAULT-NEXT: 04000000 08000000 03000000 474e5500 ............GNU. -# DEFAULT-NEXT: ab +# DEFAULT-NEXT: 6a # MD5: Contents of section .note.gnu.build-id: # MD5-NEXT: 04000000 10000000 03000000 474e5500 ............GNU. -# MD5-NEXT: 29 +# MD5-NEXT: 37 # SHA1: Contents of section .note.gnu.build-id: # SHA1-NEXT: 04000000 14000000 03000000 474e5500 ............GNU. -# SHA1-NEXT: b1 - -# TREE: Contents of section .note.gnu.build-id: -# TREE-NEXT: 04000000 14000000 03000000 474e5500 ............GNU. -# TREE-NEXT: 18 +# SHA1-NEXT: 79 # UUID: Contents of section .note.gnu.build-id: # UUID-NEXT: 04000000 10000000 03000000 474e5500 ............GNU. Index: lld/trunk/test/ELF/comment-gc.s =================================================================== --- lld/trunk/test/ELF/comment-gc.s +++ lld/trunk/test/ELF/comment-gc.s @@ -5,7 +5,8 @@ # RUN: llvm-objdump -s %t1 | FileCheck %s # CHECK: Contents of section .comment: -# CHECK-NEXT: 0000 00666f6f 00626172 00 .foo.bar. +# CHECK-NEXT: 0000 00666f6f 00626172 004c4c44 20312e30 .foo.bar.LLD 1.0 +# CHECK-NEXT: 0010 00 . .ident "foo" Index: lld/trunk/test/ELF/gnu-ifunc-i386.s =================================================================== --- lld/trunk/test/ELF/gnu-ifunc-i386.s +++ lld/trunk/test/ELF/gnu-ifunc-i386.s @@ -15,7 +15,7 @@ // CHECK-NEXT: Address: [[RELA:.*]] // CHECK-NEXT: Offset: 0xD4 // CHECK-NEXT: Size: 16 -// CHECK-NEXT: Link: 5 +// CHECK-NEXT: Link: 6 // CHECK-NEXT: Info: 0 // CHECK-NEXT: AddressAlignment: 4 // CHECK-NEXT: EntrySize: 8 Index: lld/trunk/test/ELF/gnu-ifunc.s =================================================================== --- lld/trunk/test/ELF/gnu-ifunc.s +++ lld/trunk/test/ELF/gnu-ifunc.s @@ -15,7 +15,7 @@ // CHECK-NEXT: Address: [[RELA:.*]] // CHECK-NEXT: Offset: 0x158 // CHECK-NEXT: Size: 48 -// CHECK-NEXT: Link: 5 +// CHECK-NEXT: Link: 6 // CHECK-NEXT: Info: 0 // CHECK-NEXT: AddressAlignment: 8 // CHECK-NEXT: EntrySize: 24 Index: lld/trunk/test/ELF/linkerscript/sections-keep.s =================================================================== --- lld/trunk/test/ELF/linkerscript/sections-keep.s +++ lld/trunk/test/ELF/linkerscript/sections-keep.s @@ -46,9 +46,10 @@ # MIXED1-NEXT: 1 .keep 00000004 # MIXED1-NEXT: 2 .text 00000007 00000000000000ec TEXT DATA # MIXED1-NEXT: 3 .temp 00000004 00000000000000f3 DATA -# MIXED1-NEXT: 4 .symtab 00000060 0000000000000000 -# MIXED1-NEXT: 5 .shstrtab 0000002d 0000000000000000 -# MIXED1-NEXT: 6 .strtab 00000012 0000000000000000 +# MIXED1-NEXT: 4 .comment 00000008 0000000000000000 +# MIXED1-NEXT: 5 .symtab 00000060 0000000000000000 +# MIXED1-NEXT: 6 .shstrtab 00000036 0000000000000000 +# MIXED1-NEXT: 7 .strtab 00000012 0000000000000000 ## The same, but now section without KEEP is at first place. ## gold and bfd linkers disagree here. gold collects .keep while @@ -66,9 +67,10 @@ # MIXED2-NEXT: 1 .nokeep 00000004 00000000000000e8 DATA # MIXED2-NEXT: 2 .text 00000007 00000000000000ec TEXT DATA # MIXED2-NEXT: 3 .temp 00000004 00000000000000f3 DATA -# MIXED2-NEXT: 4 .symtab 00000060 0000000000000000 -# MIXED2-NEXT: 5 .shstrtab 0000002f 0000000000000000 -# MIXED2-NEXT: 6 .strtab 00000012 0000000000000000 +# MIXED2-NEXT: 4 .comment 00000008 0000000000000000 +# MIXED2-NEXT: 5 .symtab 00000060 0000000000000000 +# MIXED2-NEXT: 6 .shstrtab 00000038 0000000000000000 +# MIXED2-NEXT: 7 .strtab 00000012 0000000000000000 # Check file pattern for kept sections. # RUN: echo "SECTIONS { \ Index: lld/trunk/test/ELF/linkerscript/sections-sort.s =================================================================== --- lld/trunk/test/ELF/linkerscript/sections-sort.s +++ lld/trunk/test/ELF/linkerscript/sections-sort.s @@ -24,6 +24,7 @@ # CHECK-NEXT: 4 .hash # CHECK-NEXT: 5 .dynstr # CHECK-NEXT: 6 .dynamic -# CHECK-NEXT: 7 .symtab -# CHECK-NEXT: 8 .shstrtab -# CHECK-NEXT: 9 .strtab +# CHECK-NEXT: 7 .comment +# CHECK-NEXT: 8 .symtab +# CHECK-NEXT: 9 .shstrtab +# CHECK-NEXT: 10 .strtab Index: lld/trunk/test/ELF/linkerscript/sections.s =================================================================== --- lld/trunk/test/ELF/linkerscript/sections.s +++ lld/trunk/test/ELF/linkerscript/sections.s @@ -21,9 +21,10 @@ # SEC-DEFAULT: 3 other 00000003 {{[0-9a-f]*}} DATA # SEC-DEFAULT: 4 .bss 00000002 {{[0-9a-f]*}} BSS # SEC-DEFAULT: 5 .shstrtab 00000002 {{[0-9a-f]*}} -# SEC-DEFAULT: 6 .symtab 00000030 {{[0-9a-f]*}} -# SEC-DEFAULT: 7 .shstrtab 00000032 {{[0-9a-f]*}} -# SEC-DEFAULT: 8 .strtab 00000008 {{[0-9a-f]*}} +# SEC-DEFAULT: 6 .comment 00000008 {{[0-9a-f]*}} +# SEC-DEFAULT: 7 .symtab 00000030 {{[0-9a-f]*}} +# SEC-DEFAULT: 8 .shstrtab 0000003b {{[0-9a-f]*}} +# SEC-DEFAULT: 9 .strtab 00000008 {{[0-9a-f]*}} # Sections are put in order specified in linker script, other than alloc # sections going first. @@ -43,7 +44,7 @@ # SEC-ORDER: 1 .bss 00000002 {{[0-9a-f]*}} BSS # SEC-ORDER: 2 other 00000003 {{[0-9a-f]*}} DATA # SEC-ORDER: 3 .shstrtab 00000002 {{[0-9a-f]*}} -# SEC-ORDER: 4 .shstrtab 00000032 {{[0-9a-f]*}} +# SEC-ORDER: 4 .shstrtab 0000003b {{[0-9a-f]*}} # SEC-ORDER: 5 .symtab 00000030 {{[0-9a-f]*}} # SEC-ORDER: 6 .strtab 00000008 {{[0-9a-f]*}} # SEC-ORDER: 7 .data 00000020 {{[0-9a-f]*}} DATA @@ -63,9 +64,10 @@ # SEC-SWAP-NAMES: 3 other 00000003 {{[0-9a-f]*}} DATA # SEC-SWAP-NAMES: 4 .bss 00000002 {{[0-9a-f]*}} BSS # SEC-SWAP-NAMES: 5 .shstrtab 00000002 {{[0-9a-f]*}} -# SEC-SWAP-NAMES: 6 .symtab 00000030 {{[0-9a-f]*}} -# SEC-SWAP-NAMES: 7 .shstrtab 00000032 {{[0-9a-f]*}} -# SEC-SWAP-NAMES: 8 .strtab 00000008 {{[0-9a-f]*}} +# SEC-SWAP-NAMES: 6 .comment 00000008 {{[0-9a-f]*}} +# SEC-SWAP-NAMES: 7 .symtab 00000030 {{[0-9a-f]*}} +# SEC-SWAP-NAMES: 8 .shstrtab 0000003b {{[0-9a-f]*}} +# SEC-SWAP-NAMES: 9 .strtab 00000008 {{[0-9a-f]*}} # .shstrtab from the input object file is discarded. # RUN: echo "SECTIONS { \ @@ -79,9 +81,10 @@ # SEC-DISCARD: 2 .data 00000020 {{[0-9a-f]*}} DATA # SEC-DISCARD: 3 other 00000003 {{[0-9a-f]*}} DATA # SEC-DISCARD: 4 .bss 00000002 {{[0-9a-f]*}} BSS -# SEC-DISCARD: 5 .symtab 00000030 {{[0-9a-f]*}} -# SEC-DISCARD: 6 .shstrtab 00000032 {{[0-9a-f]*}} -# SEC-DISCARD: 7 .strtab 00000008 {{[0-9a-f]*}} +# SEC-DISCARD: 5 .comment 00000008 {{[0-9a-f]*}} +# SEC-DISCARD: 6 .symtab 00000030 {{[0-9a-f]*}} +# SEC-DISCARD: 7 .shstrtab 0000003b {{[0-9a-f]*}} +# SEC-DISCARD: 8 .strtab 00000008 {{[0-9a-f]*}} # Multiple SECTIONS command specifying additional input section descriptions # for the same output section description - input sections are merged into @@ -100,9 +103,10 @@ # SEC-MULTI: 2 .data 00000023 {{[0-9a-f]*}} DATA # SEC-MULTI: 3 .bss 00000002 {{[0-9a-f]*}} BSS # SEC-MULTI: 4 .shstrtab 00000002 {{[0-9a-f]*}} -# SEC-MULTI: 5 .symtab 00000030 {{[0-9a-f]*}} -# SEC-MULTI: 6 .shstrtab 0000002c {{[0-9a-f]*}} -# SEC-MULTI: 7 .strtab 00000008 {{[0-9a-f]*}} +# SEC-MULTI: 5 .comment 00000008 {{[0-9a-f]*}} +# SEC-MULTI: 6 .symtab 00000030 {{[0-9a-f]*}} +# SEC-MULTI: 7 .shstrtab 00000035 {{[0-9a-f]*}} +# SEC-MULTI: 8 .strtab 00000008 {{[0-9a-f]*}} .globl _start _start: Index: lld/trunk/test/ELF/linkerscript/wildcards.s =================================================================== --- lld/trunk/test/ELF/linkerscript/wildcards.s +++ lld/trunk/test/ELF/linkerscript/wildcards.s @@ -14,9 +14,10 @@ # SEC-DEFAULT-NEXT: 2 .abcd 00000004 # SEC-DEFAULT-NEXT: 3 .ad 00000004 # SEC-DEFAULT-NEXT: 4 .ag 00000004 -# SEC-DEFAULT-NEXT: 5 .symtab 00000030 -# SEC-DEFAULT-NEXT: 6 .shstrtab 0000002f -# SEC-DEFAULT-NEXT: 7 .strtab 00000008 +# SEC-DEFAULT-NEXT: 5 .comment 00000008 {{[0-9a-f]*}} +# SEC-DEFAULT-NEXT: 6 .symtab 00000030 +# SEC-DEFAULT-NEXT: 7 .shstrtab 00000038 +# SEC-DEFAULT-NEXT: 8 .strtab 00000008 ## Now replace the symbol with '?' and check that results are the same. # RUN: echo "SECTIONS { \ @@ -37,9 +38,10 @@ # SEC-ALL-NEXT: 1 .text 0000000c # SEC-ALL-NEXT: 2 .ad 00000004 # SEC-ALL-NEXT: 3 .ag 00000004 -# SEC-ALL-NEXT: 4 .symtab 00000030 -# SEC-ALL-NEXT: 5 .shstrtab 00000029 -# SEC-ALL-NEXT: 6 .strtab 00000008 +# SEC-ALL-NEXT: 4 .comment 00000008 +# SEC-ALL-NEXT: 5 .symtab 00000030 +# SEC-ALL-NEXT: 6 .shstrtab 00000032 +# SEC-ALL-NEXT: 7 .strtab 00000008 ## All sections started with .a are merged. # RUN: echo "SECTIONS { \ @@ -51,9 +53,10 @@ # SEC-NO-NEXT: Idx Name Size # SEC-NO-NEXT: 0 00000000 # SEC-NO-NEXT: 1 .text 00000014 -# SEC-NO-NEXT: 2 .symtab 00000030 -# SEC-NO-NEXT: 3 .shstrtab 00000021 -# SEC-NO-NEXT: 4 .strtab 00000008 +# SEC-NO-NEXT: 2 .comment 00000008 +# SEC-NO-NEXT: 3 .symtab 00000030 +# SEC-NO-NEXT: 4 .shstrtab 0000002a +# SEC-NO-NEXT: 5 .strtab 00000008 .text .section .abc,"ax",@progbits Index: lld/trunk/test/ELF/pie.s =================================================================== --- lld/trunk/test/ELF/pie.s +++ lld/trunk/test/ELF/pie.s @@ -29,15 +29,15 @@ # CHECK-NEXT: Version: 1 # CHECK-NEXT: Entry: 0x1000 # CHECK-NEXT: ProgramHeaderOffset: 0x40 -# CHECK-NEXT: SectionHeaderOffset: 0x1110 +# CHECK-NEXT: SectionHeaderOffset: 0x1120 # CHECK-NEXT: Flags [ # CHECK-NEXT: ] # CHECK-NEXT: HeaderSize: 64 # CHECK-NEXT: ProgramHeaderEntrySize: 56 # CHECK-NEXT: ProgramHeaderCount: 7 # CHECK-NEXT: SectionHeaderEntrySize: 64 -# CHECK-NEXT: SectionHeaderCount: 9 -# CHECK-NEXT: StringTableSectionIndex: 7 +# CHECK-NEXT: SectionHeaderCount: 10 +# CHECK-NEXT: StringTableSectionIndex: 8 # CHECK-NEXT: } # CHECK: ProgramHeaders [ Index: lld/trunk/test/ELF/relocatable-bss.s =================================================================== --- lld/trunk/test/ELF/relocatable-bss.s +++ lld/trunk/test/ELF/relocatable-bss.s @@ -20,7 +20,7 @@ # CHECK-NEXT: Version: # CHECK-NEXT: Entry: # CHECK-NEXT: ProgramHeaderOffset: -# CHECK-NEXT: SectionHeaderOffset: 0xA8 +# CHECK-NEXT: SectionHeaderOffset: 0xB8 # CHECK-NEXT: Flags [ # CHECK-NEXT: ] # CHECK-NEXT: HeaderSize: Index: lld/trunk/test/ELF/relocatable.s =================================================================== --- lld/trunk/test/ELF/relocatable.s +++ lld/trunk/test/ELF/relocatable.s @@ -30,15 +30,15 @@ # CHECK-NEXT: Version: 1 # CHECK-NEXT: Entry: 0x0 # CHECK-NEXT: ProgramHeaderOffset: 0x0 -# CHECK-NEXT: SectionHeaderOffset: 0x2C0 +# CHECK-NEXT: SectionHeaderOffset: 0x2D0 # CHECK-NEXT: Flags [ # CHECK-NEXT: ] # CHECK-NEXT: HeaderSize: 64 # CHECK-NEXT: ProgramHeaderEntrySize: 0 # CHECK-NEXT: ProgramHeaderCount: 0 # CHECK-NEXT: SectionHeaderEntrySize: 64 -# CHECK-NEXT: SectionHeaderCount: 7 -# CHECK-NEXT: StringTableSectionIndex: 5 +# CHECK-NEXT: SectionHeaderCount: 8 +# CHECK-NEXT: StringTableSectionIndex: 6 # CHECK-NEXT: } # CHECK: Relocations [ @@ -81,15 +81,15 @@ # CHECKEXE-NEXT: Version: 1 # CHECKEXE-NEXT: Entry: 0x11000 # CHECKEXE-NEXT: ProgramHeaderOffset: 0x40 -# CHECKEXE-NEXT: SectionHeaderOffset: 0x11E8 +# CHECKEXE-NEXT: SectionHeaderOffset: 0x11F8 # CHECKEXE-NEXT: Flags [ # CHECKEXE-NEXT: ] # CHECKEXE-NEXT: HeaderSize: 64 # CHECKEXE-NEXT: ProgramHeaderEntrySize: 56 # CHECKEXE-NEXT: ProgramHeaderCount: 5 # CHECKEXE-NEXT: SectionHeaderEntrySize: 64 -# CHECKEXE-NEXT: SectionHeaderCount: 6 -# CHECKEXE-NEXT: StringTableSectionIndex: 4 +# CHECKEXE-NEXT: SectionHeaderCount: 7 +# CHECKEXE-NEXT: StringTableSectionIndex: 5 # CHECKEXE-NEXT: } .text Index: lld/trunk/test/ELF/section-name.s =================================================================== --- lld/trunk/test/ELF/section-name.s +++ lld/trunk/test/ELF/section-name.s @@ -53,6 +53,7 @@ // CHECK: 9 .foo 00000001 // CHECK: 10 .bss 00000001 // CHECK: 11 .bss 00000001 -// CHECK: 12 .symtab 00000060 -// CHECK: 13 .shstrtab 0000006c -// CHECK: 14 .strtab 0000001d +// CHECK: 12 .comment 00000008 +// CHECK: 13 .symtab 00000060 +// CHECK: 14 .shstrtab 00000075 +// CHECK: 15 .strtab 0000001d Index: lld/trunk/test/ELF/shared.s =================================================================== --- lld/trunk/test/ELF/shared.s +++ lld/trunk/test/ELF/shared.s @@ -14,7 +14,7 @@ // SO-NEXT: Flags [ // SO-NEXT: ] // SO-NEXT: Address: -// SO-NEXT: Offset: 0x1030 +// SO-NEXT: Offset: 0x1038 // SO-NEXT: Size: // SO-NEXT: Link: // SO-NEXT: Info: Index: lld/trunk/test/ELF/string-table.s =================================================================== --- lld/trunk/test/ELF/string-table.s +++ lld/trunk/test/ELF/string-table.s @@ -59,8 +59,9 @@ // CHECK-NEXT: EntrySize: 0 // CHECK-NEXT: SectionData ( // CHECK-NEXT: 0000: 00626172 002E7465 78740066 6F6F6261 |.bar..text.fooba| -// CHECK-NEXT: 0010: 72002E73 796D7461 62002E73 68737472 |r..symtab..shstr| -// CHECK-NEXT: 0020: 74616200 2E737472 74616200 |tab..strtab.| +// CHECK-NEXT: 0010: 72002E63 6F6D6D65 6E74002E 73796D74 |r..comment..symt| +// CHECK-NEXT: 0020: 6162002E 73687374 72746162 002E7374 |ab..shstrtab..st| +// CHECK-NEXT: 0030: 72746162 00 |rtab.| // CHECK-NEXT: ) // CHECK-NEXT:} // CHECK: Name: .strtab Index: lld/trunk/test/lit.cfg =================================================================== --- lld/trunk/test/lit.cfg +++ lld/trunk/test/lit.cfg @@ -246,6 +246,9 @@ config.available_features.add('amdgpu') llvm_config_cmd.wait() +# Set a fake constant version so that we get consitent output. +config.environment['LLD_VERSION'] = 'LLD 1.0' + # Check if Windows resource file compiler exists. cvtres = lit.util.which('cvtres', config.environment['PATH']) rc = lit.util.which('rc', config.environment['PATH'])