Index: ELF/EhFrame.cpp =================================================================== --- ELF/EhFrame.cpp +++ ELF/EhFrame.cpp @@ -21,6 +21,7 @@ #include "InputSection.h" #include "Relocations.h" #include "Strings.h" +#include "Writer.h" #include "llvm/Object/ELF.h" #include "llvm/Support/Dwarf.h" @@ -44,7 +45,8 @@ private: template void failOn(const P *Loc, const Twine &Msg) { - fatal(IS->getLocation((const uint8_t *)Loc - IS->Data.data()) + ": " + Msg); + errorAtOffset(*IS, ": " + Msg, (const uint8_t *)Loc - IS->Data.data()); + fatal("fatal error encountered"); } uint8_t readByte(); Index: ELF/Error.h =================================================================== --- ELF/Error.h +++ ELF/Error.h @@ -38,6 +38,8 @@ void log(const Twine &Msg); void warn(const Twine &Msg); +void hint(const Twine &Msg); + void error(const Twine &Msg); void error(std::error_code EC, const Twine &Prefix); Index: ELF/Error.cpp =================================================================== --- ELF/Error.cpp +++ ELF/Error.cpp @@ -81,6 +81,12 @@ error(Prefix + ": " + EC.message()); } +void elf::hint(const Twine &Msg) { + std::lock_guard Lock(Mu); + print("note: ", raw_ostream::RED); + *ErrorOS << Msg << "\n"; +} + void elf::exitLld(int Val) { // Dealloc/destroy ManagedStatic variables before calling // _exit(). In a non-LTO build, this is a nop. In an LTO Index: ELF/InputFiles.h =================================================================== --- ELF/InputFiles.h +++ ELF/InputFiles.h @@ -162,7 +162,7 @@ // Returns source line information for a given offset. // If no information is available, returns "". - std::string getLineInfo(InputSectionBase *S, uintX_t Offset); + std::string getLineInfo(const InputSectionBase *S, uintX_t Offset); // MIPS GP0 value defined by this file. This value represents the gp value // used to create the relocatable object and required to support Index: ELF/InputFiles.cpp =================================================================== --- ELF/InputFiles.cpp +++ ELF/InputFiles.cpp @@ -74,7 +74,7 @@ // Returns source line information for a given offset // using DWARF debug info. template -std::string elf::ObjectFile::getLineInfo(InputSectionBase *S, +std::string elf::ObjectFile::getLineInfo(const InputSectionBase *S, uintX_t Offset) { if (!DwarfLine) initializeDwarfLine(); Index: ELF/InputSection.h =================================================================== --- ELF/InputSection.h +++ ELF/InputSection.h @@ -141,8 +141,9 @@ void uncompress(); - // Returns a source location string. Used to construct an error message. - std::string getLocation(uintX_t Offset); + // Returns a extended information about source location. Used to construct an + // error message. + std::string getLocationExt(uintX_t Offset) const; void relocate(uint8_t *Buf, uint8_t *BufEnd); @@ -319,6 +320,10 @@ template std::string toString(const InputSectionBase *); +template +void errorAtOffset(const InputSectionBase &, const llvm::Twine &, + typename ELFT::uint); + } // namespace elf } // namespace lld Index: ELF/InputSection.cpp =================================================================== --- ELF/InputSection.cpp +++ ELF/InputSection.cpp @@ -39,6 +39,13 @@ } template +void elf::errorAtOffset(const InputSectionBase &IS, + const llvm::Twine &Msg, typename ELFT::uint Off) { + error(toString(IS.getFile()) + Msg); + hint("location is " + IS.getLocationExt(Off)); +} + +template static ArrayRef getSectionContents(elf::ObjectFile *File, const typename ELFT::Shdr *Hdr) { if (!File || Hdr->sh_type == SHT_NOBITS) @@ -212,29 +219,33 @@ return nullptr; } -// Returns a source location string. Used to construct an error message. +// Find a function symbol that encloses a given location, if there's no symbol, +// returns the offset in the section. template -std::string InputSectionBase::getLocation(typename ELFT::uint Offset) { +static std::string getExtendedName(const InputSectionBase *IS, + typename ELFT::uint Offset) { + for (SymbolBody *B : IS->getFile()->getSymbols()) + if (auto *D = dyn_cast>(B)) + if (D->Section == IS && D->Type == STT_FUNC) + if (D->Value <= Offset && Offset < D->Value + D->Size) + return "function " + toString(*D); + return (IS->Name + "+0x" + utohexstr(Offset)).str(); +} + +template +std::string +InputSectionBase::getLocationExt(typename ELFT::uint Offset) const { // First check if we can get desired values from debugging information. std::string LineInfo = File->getLineInfo(this, Offset); if (!LineInfo.empty()) return LineInfo; // File->SourceFile contains STT_FILE symbol that contains a - // source file name. If it's missing, we use an object file name. - std::string SrcFile = File->SourceFile; - if (SrcFile.empty()) - SrcFile = toString(File); - - // Find a function symbol that encloses a given location. - for (SymbolBody *B : File->getSymbols()) - if (auto *D = dyn_cast>(B)) - if (D->Section == this && D->Type == STT_FUNC) - if (D->Value <= Offset && Offset < D->Value + D->Size) - return SrcFile + ":(function " + toString(*D) + ")"; - - // If there's no symbol, print out the offset in the section. - return (SrcFile + ":(" + Name + "+0x" + utohexstr(Offset) + ")").str(); + // source file name. If we have it, we use it in the output. + std::string FuncName = getExtendedName(this, Offset); + if (File->SourceFile.empty()) + return FuncName; + return (File->SourceFile + "(" + FuncName + ")").str(); } template @@ -499,7 +510,7 @@ SymbolBody &Sym = this->File->getRelocTargetSym(Rel); if (Target->getRelExpr(Type, Sym) != R_ABS) { - error(this->getLocation(Offset) + ": has non-ABS reloc"); + errorAtOffset(*this, ": has non-ABS reloc", Offset); return; } @@ -851,3 +862,12 @@ template std::string elf::toString(const InputSectionBase *); template std::string elf::toString(const InputSectionBase *); template std::string elf::toString(const InputSectionBase *); + +template void elf::errorAtOffset(const InputSectionBase &, + const llvm::Twine &, ELF32LE::uint); +template void elf::errorAtOffset(const InputSectionBase &, + const llvm::Twine &, ELF32BE::uint); +template void elf::errorAtOffset(const InputSectionBase &, + const llvm::Twine &, ELF64LE::uint); +template void elf::errorAtOffset(const InputSectionBase &, + const llvm::Twine &, ELF64BE::uint); Index: ELF/Relocations.cpp =================================================================== --- ELF/Relocations.cpp +++ ELF/Relocations.cpp @@ -356,9 +356,10 @@ return true; if (&Body == ElfSym::MipsGpDisp) return true; - error(S.getLocation(RelOff) + ": relocation " + toString(Type) + - " cannot refer to absolute symbol '" + toString(Body) + - "' defined in " + toString(Body.File)); + errorAtOffset(S, ": relocation " + toString(Type) + + " cannot refer to absolute symbol '" + toString(Body) + + "' defined in " + toString(Body.File), + RelOff); return true; } @@ -456,16 +457,18 @@ // only memory. We can hack around it if we are producing an executable and // the refered symbol can be preemepted to refer to the executable. if (Config->Shared || (Config->Pic && !isRelExpr(Expr))) { - error(S.getLocation(RelOff) + ": can't create dynamic relocation " + - toString(Type) + " against " + - (Body.getName().empty() ? "local symbol in readonly segment" - : "symbol '" + toString(Body) + "'") + - " defined in " + toString(Body.File)); + errorAtOffset( + S, ": can't create dynamic relocation " + toString(Type) + " against " + + (Body.getName().empty() ? "local symbol in readonly segment" + : "symbol '" + toString(Body) + "'") + + " defined in " + toString(Body.File), + RelOff); return Expr; } if (Body.getVisibility() != STV_DEFAULT) { - error(S.getLocation(RelOff) + ": cannot preempt symbol '" + toString(Body) + - "' defined in " + toString(Body.File)); + errorAtOffset(S, ": cannot preempt symbol '" + toString(Body) + + "' defined in " + toString(Body.File), + RelOff); return Expr; } if (Body.isObject()) { @@ -545,12 +548,13 @@ return; std::string Msg = - S.getLocation(Offset) + ": undefined symbol '" + toString(Sym) + "'"; + toString(S.getFile()) + ": undefined symbol '" + toString(Sym) + "'"; if (Config->UnresolvedSymbols == UnresolvedPolicy::Warn) warn(Msg); else error(Msg); + hint("location is " + S.getLocationExt(Offset)); } template @@ -688,8 +692,11 @@ // We don't know anything about the finaly symbol. Just ask the dynamic // linker to handle the relocation for us. if (!Target->isPicRel(Type)) - error(C.getLocation(Offset) + ": relocation " + toString(Type) + - " cannot be used against shared object; recompile with -fPIC."); + errorAtOffset( + C, + ": relocation " + toString(Type) + + " cannot be used against shared object; recompile with -fPIC.", + Offset); AddDyn({Target->getDynRel(Type), &C, Offset, false, &Body, Addend}); // MIPS ABI turns using of GOT and dynamic relocations inside out. Index: ELF/SymbolTable.cpp =================================================================== --- ELF/SymbolTable.cpp +++ ELF/SymbolTable.cpp @@ -368,11 +368,14 @@ return; } - std::string OldLoc = D->Section->getLocation(D->Value); - std::string NewLoc = ErrSec->getLocation(ErrOffset); - + std::string OldLoc = toString(D->Section->getFile()); + std::string NewLoc = toString(ErrSec->getFile()); print(NewLoc + ": duplicate symbol '" + toString(*Existing) + "'"); print(OldLoc + ": previous definition was here"); + + std::string OldLocHint = D->Section->getLocationExt(D->Value); + std::string NewLocHint = ErrSec->getLocationExt(ErrOffset); + hint("definitions found in " + OldLocHint + " and " + NewLocHint); } template Index: ELF/Target.cpp =================================================================== --- ELF/Target.cpp +++ ELF/Target.cpp @@ -55,32 +55,39 @@ return getELFRelocationTypeName(Config->EMachine, Type); } +static void errorAtLocation(const uint8_t *Loc, const llvm::Twine &E) { + std::pair Msg = getErrorLocation(Loc); + error(Msg.first + ": " + E); + hint("location is " + Msg.second); +} + +static void fatalAtLocation(const uint8_t *Loc, const llvm::Twine &E) { + errorAtLocation(Loc, E); + fatal("fatal error encountered"); +} + template static void checkInt(uint8_t *Loc, int64_t V, uint32_t Type) { if (!isInt(V)) - error(getErrorLocation(Loc) + "relocation " + toString(Type) + - " out of range"); + errorAtLocation(Loc, "relocation " + toString(Type) + " out of range"); } template static void checkUInt(uint8_t *Loc, uint64_t V, uint32_t Type) { if (!isUInt(V)) - error(getErrorLocation(Loc) + "relocation " + toString(Type) + - " out of range"); + errorAtLocation(Loc, "relocation " + toString(Type) + " out of range"); } template static void checkIntUInt(uint8_t *Loc, uint64_t V, uint32_t Type) { if (!isInt(V) && !isUInt(V)) - error(getErrorLocation(Loc) + "relocation " + toString(Type) + - " out of range"); + errorAtLocation(Loc, "relocation " + toString(Type) + " out of range"); } template static void checkAlignment(uint8_t *Loc, uint64_t V, uint32_t Type) { if ((V & (N - 1)) != 0) - error(getErrorLocation(Loc) + "improper alignment for relocation " + - toString(Type)); + errorAtLocation(Loc, "improper alignment for relocation " + toString(Type)); } namespace { @@ -770,8 +777,9 @@ memcpy(Inst, "\x48\xc7", 2); *RegSlot = 0xc0 | Reg; } else { - fatal(getErrorLocation(Loc - 3) + - "R_X86_64_GOTTPOFF must be used in MOVQ or ADDQ instructions only"); + fatalAtLocation( + Loc - 3, + "R_X86_64_GOTTPOFF must be used in MOVQ or ADDQ instructions only"); } // The original code used a PC relative relocation. @@ -841,7 +849,7 @@ write64le(Loc, Val); break; default: - fatal(getErrorLocation(Loc) + "unrecognized reloc " + Twine(Type)); + fatalAtLocation(Loc, "unrecognized reloc " + Twine(Type)); } } @@ -1010,7 +1018,7 @@ or32be(Loc, Val & 0x3FFFFFC); break; default: - fatal(getErrorLocation(Loc) + "unrecognized reloc " + Twine(Type)); + fatalAtLocation(Loc, "unrecognized reloc " + Twine(Type)); } } @@ -1188,7 +1196,7 @@ break; } default: - fatal(getErrorLocation(Loc) + "unrecognized reloc " + Twine(Type)); + fatalAtLocation(Loc, "unrecognized reloc " + Twine(Type)); } } @@ -1439,7 +1447,7 @@ or32AArch64Imm(Loc, Val); break; default: - fatal(getErrorLocation(Loc) + "unrecognized reloc " + Twine(Type)); + fatalAtLocation(Loc, "unrecognized reloc " + Twine(Type)); } } @@ -1549,7 +1557,7 @@ write32le(Loc, Val >> 32); break; default: - fatal(getErrorLocation(Loc) + "unrecognized reloc " + Twine(Type)); + fatalAtLocation(Loc, "unrecognized reloc " + Twine(Type)); } } @@ -1859,7 +1867,7 @@ (Val & 0x00ff)); // imm8 break; default: - fatal(getErrorLocation(Loc) + "unrecognized reloc " + Twine(Type)); + fatalAtLocation(Loc, "unrecognized reloc " + Twine(Type)); } } @@ -2221,8 +2229,7 @@ return std::make_pair(Type2, Val); if (Type2 == R_MIPS_SUB && (Type3 == R_MIPS_HI16 || Type3 == R_MIPS_LO16)) return std::make_pair(Type3, -Val); - error(getErrorLocation(Loc) + "unsupported relocations combination " + - Twine(Type)); + errorAtLocation(Loc, "unsupported relocations combination " + Twine(Type)); return std::make_pair(Type & 0xff, Val); } @@ -2307,7 +2314,7 @@ applyMipsPcReloc(Loc, Type, Val); break; default: - fatal(getErrorLocation(Loc) + "unrecognized reloc " + Twine(Type)); + fatalAtLocation(Loc, "unrecognized reloc " + Twine(Type)); } } Index: ELF/Writer.h =================================================================== --- ELF/Writer.h +++ ELF/Writer.h @@ -48,7 +48,8 @@ llvm::StringRef FileName); bool isMipsN32Abi(const InputFile *F); -std::string getErrorLocation(uint8_t *Loc); + +std::pair getErrorLocation(const uint8_t *Loc); } } Index: ELF/Writer.cpp =================================================================== --- ELF/Writer.cpp +++ ELF/Writer.cpp @@ -1639,7 +1639,8 @@ In::BuildId->writeBuildId({Start, End}); } -template static std::string getErrorLoc(uint8_t *Loc) { +template +static std::pair getErrorLoc(const uint8_t *Loc) { for (InputSectionData *D : Symtab::X->Sections) { auto *IS = dyn_cast_or_null>(D); if (!IS || !IS->OutSec) @@ -1647,12 +1648,12 @@ uint8_t *ISLoc = cast>(IS->OutSec)->Loc + IS->OutSecOff; if (ISLoc <= Loc && ISLoc + IS->getSize() > Loc) - return IS->getLocation(Loc - ISLoc) + ": "; + return {toString(IS->getFile()), IS->getLocationExt(Loc - ISLoc)}; } - return ""; + return {}; } -std::string elf::getErrorLocation(uint8_t *Loc) { +std::pair elf::getErrorLocation(const uint8_t *Loc) { switch (Config->EKind) { case ELF32LEKind: return getErrorLoc(Loc); Index: test/ELF/Inputs/conflict-debug2.s =================================================================== --- test/ELF/Inputs/conflict-debug2.s +++ test/ELF/Inputs/conflict-debug2.s @@ -0,0 +1,4 @@ +.file "conflict-debug.s" +.globl zed +zed: + nop Index: test/ELF/aarch64-fpic-abs16.s =================================================================== --- test/ELF/aarch64-fpic-abs16.s +++ test/ELF/aarch64-fpic-abs16.s @@ -1,7 +1,6 @@ // REQUIRES: aarch64 // RUN: llvm-mc -filetype=obj -triple=aarch64-none-freebsd %s -o %t.o // RUN: not ld.lld -shared %t.o -o %t.so 2>&1 | FileCheck %s -// CHECK: {{.*}}:(.data+0x0): relocation R_AARCH64_ABS16 cannot be used against shared object; recompile with -fPIC. - +// CHECK: {{.*}}: relocation R_AARCH64_ABS16 cannot be used against shared object; recompile with -fPIC. .data .hword foo Index: test/ELF/aarch64-fpic-add_abs_lo12_nc.s =================================================================== --- test/ELF/aarch64-fpic-add_abs_lo12_nc.s +++ test/ELF/aarch64-fpic-add_abs_lo12_nc.s @@ -1,8 +1,7 @@ // REQUIRES: aarch64 // RUN: llvm-mc -filetype=obj -triple=aarch64-none-freebsd %s -o %t.o // RUN: not ld.lld -shared %t.o -o %t.so 2>&1 | FileCheck %s -// CHECK: {{.*}}.o:(.text+0x0): can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol 'dat' defined in {{.*}}.o - +// CHECK: {{.*}}.o: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol 'dat' defined in {{.*}}.o add x0, x0, :lo12:dat .data .globl dat Index: test/ELF/aarch64-fpic-adr_prel_lo21.s =================================================================== --- test/ELF/aarch64-fpic-adr_prel_lo21.s +++ test/ELF/aarch64-fpic-adr_prel_lo21.s @@ -1,8 +1,7 @@ // REQUIRES: aarch64 // RUN: llvm-mc -filetype=obj -triple=aarch64-none-freebsd %s -o %t.o // RUN: not ld.lld -shared %t.o -o %t.so 2>&1 | FileCheck %s -// CHECK: {{.*}}.o:(.text+0x0): can't create dynamic relocation R_AARCH64_ADR_PREL_LO21 against symbol 'dat' defined in {{.*}}.o - +// CHECK: {{.*}}.o: can't create dynamic relocation R_AARCH64_ADR_PREL_LO21 against symbol 'dat' defined in {{.*}}.o adr x0, dat .data .globl dat Index: test/ELF/aarch64-fpic-adr_prel_pg_hi21.s =================================================================== --- test/ELF/aarch64-fpic-adr_prel_pg_hi21.s +++ test/ELF/aarch64-fpic-adr_prel_pg_hi21.s @@ -1,8 +1,7 @@ // REQUIRES: aarch64 // RUN: llvm-mc -filetype=obj -triple=aarch64-none-freebsd %s -o %t.o // RUN: not ld.lld -shared %t.o -o %t.so 2>&1 | FileCheck %s -// CHECK: {{.*}}.o:(.text+0x0): can't create dynamic relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol 'dat' defined in {{.*}}.o - +// CHECK: {{.*}}.o: can't create dynamic relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol 'dat' defined in {{.*}}.o adrp x0, dat .data .globl dat Index: test/ELF/aarch64-fpic-ldst32_abs_lo12_nc.s =================================================================== --- test/ELF/aarch64-fpic-ldst32_abs_lo12_nc.s +++ test/ELF/aarch64-fpic-ldst32_abs_lo12_nc.s @@ -1,8 +1,7 @@ // REQUIRES: aarch64 // RUN: llvm-mc -filetype=obj -triple=aarch64-none-freebsd %s -o %t.o // RUN: not ld.lld -shared %t.o -o %t.so 2>&1 | FileCheck %s -// CHECK: {{.*}}.o:(.text+0x0): can't create dynamic relocation R_AARCH64_LDST32_ABS_LO12_NC against symbol 'dat' defined in {{.*}}.o - +// CHECK: {{.*}}.o: can't create dynamic relocation R_AARCH64_LDST32_ABS_LO12_NC against symbol 'dat' defined in {{.*}}.o ldr s4, [x0, :lo12:dat] .data .globl dat Index: test/ELF/aarch64-fpic-ldst64_abs_lo12_nc.s =================================================================== --- test/ELF/aarch64-fpic-ldst64_abs_lo12_nc.s +++ test/ELF/aarch64-fpic-ldst64_abs_lo12_nc.s @@ -1,8 +1,7 @@ // REQUIRES: aarch64 // RUN: llvm-mc -filetype=obj -triple=aarch64-none-freebsd %s -o %t.o // RUN: not ld.lld -shared %t.o -o %t.so 2>&1 | FileCheck %s -// CHECK: {{.*}}.o:(.text+0x0): can't create dynamic relocation R_AARCH64_LDST64_ABS_LO12_NC against symbol 'dat' defined in {{.*}}.o - +// CHECK: {{.*}}.o: can't create dynamic relocation R_AARCH64_LDST64_ABS_LO12_NC against symbol 'dat' defined in {{.*}}.o ldr x0, [x0, :lo12:dat] .data .globl dat Index: test/ELF/aarch64-fpic-ldst8_abs_lo12_nc.s =================================================================== --- test/ELF/aarch64-fpic-ldst8_abs_lo12_nc.s +++ test/ELF/aarch64-fpic-ldst8_abs_lo12_nc.s @@ -1,8 +1,7 @@ // REQUIRES: aarch64 // RUN: llvm-mc -filetype=obj -triple=aarch64-none-freebsd %s -o %t.o // RUN: not ld.lld -shared %t.o -o %t.so 2>&1 | FileCheck %s -// CHECK: {{.*}}.o:(.text+0x0): can't create dynamic relocation R_AARCH64_LDST8_ABS_LO12_NC against symbol 'dat' defined in {{.*}}.o - +// CHECK: {{.*}}.o: can't create dynamic relocation R_AARCH64_LDST8_ABS_LO12_NC against symbol 'dat' defined in {{.*}}.o ldrsb x0, [x1, :lo12:dat] .data .globl dat Index: test/ELF/aarch64-fpic-prel16.s =================================================================== --- test/ELF/aarch64-fpic-prel16.s +++ test/ELF/aarch64-fpic-prel16.s @@ -1,7 +1,6 @@ // REQUIRES: aarch64 // RUN: llvm-mc -filetype=obj -triple=aarch64-none-freebsd %s -o %t.o // RUN: not ld.lld -shared %t.o -o %t.so 2>&1 | FileCheck %s -// CHECK: {{.*}}:(.data+0x0): relocation R_AARCH64_PREL16 cannot be used against shared object; recompile with -fPIC. - +// CHECK: {{.*}}.o: relocation R_AARCH64_PREL16 cannot be used against shared object; recompile with -fPIC. .data .hword foo - . Index: test/ELF/aarch64-fpic-prel32.s =================================================================== --- test/ELF/aarch64-fpic-prel32.s +++ test/ELF/aarch64-fpic-prel32.s @@ -1,7 +1,6 @@ // REQUIRES: aarch64 // RUN: llvm-mc -filetype=obj -triple=aarch64-none-freebsd %s -o %t.o // RUN: not ld.lld -shared %t.o -o %t.so 2>&1 | FileCheck %s -// CHECK: {{.*}}:(.data+0x0): relocation R_AARCH64_PREL32 cannot be used against shared object; recompile with -fPIC. - +// CHECK: {{.*}}.o: relocation R_AARCH64_PREL32 cannot be used against shared object; recompile with -fPIC. .data .word foo - . Index: test/ELF/aarch64-fpic-prel64.s =================================================================== --- test/ELF/aarch64-fpic-prel64.s +++ test/ELF/aarch64-fpic-prel64.s @@ -1,7 +1,6 @@ // REQUIRES: aarch64 // RUN: llvm-mc -filetype=obj -triple=aarch64-none-freebsd %s -o %t.o // RUN: not ld.lld -shared %t.o -o %t.so 2>&1 | FileCheck %s -// CHECK: {{.*}}:(.data+0x0): relocation R_AARCH64_PREL64 cannot be used against shared object; recompile with -fPIC. - +// CHECK: {{.*}}: relocation R_AARCH64_PREL64 cannot be used against shared object; recompile with -fPIC. .data .xword foo - . Index: test/ELF/arm-branch-error.s =================================================================== --- test/ELF/arm-branch-error.s +++ test/ELF/arm-branch-error.s @@ -15,5 +15,5 @@ beq too_far3 // CHECK: R_ARM_CALL out of range -// CHECK-NEXT: R_ARM_JUMP24 out of range -// CHECK-NEXT: R_ARM_JUMP24 out of range +// CHECK: R_ARM_JUMP24 out of range +// CHECK: R_ARM_JUMP24 out of range Index: test/ELF/arm-target1.s =================================================================== --- test/ELF/arm-target1.s +++ test/ELF/arm-target1.s @@ -29,4 +29,4 @@ // RELATIVE: SYMBOL TABLE: // RELATIVE: 00001004 .text 00000000 patatino -// ABS: {{.*}}.o:(.text+0x0): can't create dynamic relocation R_ARM_TARGET1 against symbol 'patatino' defined in {{.*}}.o +// ABS: {{.*}}.o: can't create dynamic relocation R_ARM_TARGET1 against symbol 'patatino' defined in {{.*}}.o Index: test/ELF/arm-thumb-branch-error.s =================================================================== --- test/ELF/arm-thumb-branch-error.s +++ test/ELF/arm-thumb-branch-error.s @@ -15,5 +15,5 @@ beq.w too_far3 // CHECK: R_ARM_THM_CALL out of range -// CHECK-NEXT: R_ARM_THM_JUMP24 out of range -// CHECK-NEXT: R_ARM_THM_JUMP19 out of range +// CHECK: R_ARM_THM_JUMP24 out of range +// CHECK: R_ARM_THM_JUMP19 out of range Index: test/ELF/basic.s =================================================================== --- test/ELF/basic.s +++ test/ELF/basic.s @@ -237,8 +237,9 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t # RUN: not ld.lld %t %t -o %t2 2>&1 | FileCheck --check-prefix=DUP %s -# DUP: {{.*}}:(.text+0x0): duplicate symbol '_start' -# DUP: {{.*}}:(.text+0x0): previous definition was here +# DUP: {{.*}}: duplicate symbol '_start' +# DUP: {{.*}}: previous definition was here +# DUP: note: definitions found in .text+0x0 and .text+0x0 # RUN: not ld.lld %t -o %t -m wrong_emul_fbsd 2>&1 | FileCheck --check-prefix=UNKNOWN_EMUL %s # UNKNOWN_EMUL: unknown emulation: wrong_emul_fbsd Index: test/ELF/conflict.s =================================================================== --- test/ELF/conflict.s +++ test/ELF/conflict.s @@ -3,18 +3,22 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1.o # RUN: not ld.lld %t1.o %t1.o -o %t2 2>&1 | FileCheck -check-prefix=DEMANGLE %s -# DEMANGLE: {{.*}}:(.text+0x0): duplicate symbol 'mul(double, double)' -# DEMANGLE-NEXT: {{.*}}:(.text+0x0): previous definition was here -# DEMANGLE-NEXT: {{.*}}:(.text+0x0): duplicate symbol 'foo' -# DEMANGLE-NEXT: {{.*}}:(.text+0x0): previous definition was here +# DEMANGLE: {{.*}}: duplicate symbol 'mul(double, double)' +# DEMANGLE-NEXT: {{.*}}: previous definition was here +# DEMANGLE-NEXT: note: definitions found in .text+0x0 and .text+0x0 +# DEMANGLE-NEXT: {{.*}}: duplicate symbol 'foo' +# DEMANGLE-NEXT: {{.*}}: previous definition was here +# DEMANGLE-NEXT: note: definitions found in .text+0x0 and .text+0x0 # RUN: not ld.lld %t1.o %t1.o -o %t2 --no-demangle 2>&1 | \ # RUN: FileCheck -check-prefix=NO_DEMANGLE %s -# NO_DEMANGLE: {{.*}}:(.text+0x0): duplicate symbol '_Z3muldd' -# NO_DEMANGLE-NEXT: {{.*}}:(.text+0x0): previous definition was here -# NO_DEMANGLE-NEXT: {{.*}}:(.text+0x0): duplicate symbol 'foo' -# NO_DEMANGLE-NEXT: {{.*}}:(.text+0x0): previous definition was here +# NO_DEMANGLE: {{.*}}: duplicate symbol '_Z3muldd' +# NO_DEMANGLE-NEXT: {{.*}}: previous definition was here +# NO_DEMANGLE-NEXT: note: definitions found in .text+0x0 and .text+0x0 +# NO_DEMANGLE-NEXT: {{.*}}: duplicate symbol 'foo' +# NO_DEMANGLE-NEXT: {{.*}}: previous definition was here +# NO_DEMANGLE-NEXT: note: definitions found in .text+0x0 and .text+0x0 # RUN: not ld.lld %t1.o %t1.o -o %t2 --demangle --no-demangle 2>&1 | \ # RUN: FileCheck -check-prefix=NO_DEMANGLE %s @@ -25,14 +29,25 @@ # RUN: llvm-ar rcs %t3.a %t2.o # RUN: not ld.lld %t1.o %t3.a -u baz -o %t2 2>&1 | FileCheck -check-prefix=ARCHIVE %s -# ARCHIVE: {{.*}}3.a({{.*}}2.o):(.text+0x0): duplicate symbol 'foo' -# ARCHIVE-NEXT: {{.*}}1.o:(.text+0x0): previous definition was here +# ARCHIVE: {{.*}}3.a({{.*}}2.o): duplicate symbol 'foo' +# ARCHIVE-NEXT: {{.*}}1.o: previous definition was here +# ARCHIVE-NEXT: note: definitions found in .text+0x0 and .text+0x0 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/conflict-debug.s -o %t-dbg.o # RUN: not ld.lld %t-dbg.o %t-dbg.o -o %t-dbg 2>&1 | FileCheck -check-prefix=DBGINFO %s -# DBGINFO: conflict-debug.s:4: duplicate symbol 'zed' -# DBGINFO-NEXT: conflict-debug.s:4: previous definition was here +# DBGINFO: {{.*}}.o: duplicate symbol 'zed' +# DBGINFO-NEXT: {{.*}}.o: previous definition was here +# DBGINFO-NEXT: note: definitions found in conflict-debug.s:4 and conflict-debug.s:4 + +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/conflict-debug2.s -o %t-dbg2.o +# RUN: echo "call zed" > %t-dbg1.s +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t-dbg1.s -o %t-dbg1.o +# RUN: llvm-ar rcs %t-dbg2.a %t-dbg2.o +# RUN: not ld.lld %t-dbg2.a %t-dbg1.o %t-dbg2.o -o %t2 2>&1 | FileCheck -check-prefix=ARCHIVE2 %s +# ARCHIVE2: {{.*}}-dbg2.o: duplicate symbol 'zed' +# ARCHIVE2-NEXT: {{.*}}-dbg2.a({{.*}}-dbg2.o): previous definition was here +# ARCHIVE2-NEXT: note: definitions found in conflict-debug.s(.text+0x0) and conflict-debug.s(.text+0x0) .globl _Z3muldd, foo _Z3muldd: Index: test/ELF/copy-errors.s =================================================================== --- test/ELF/copy-errors.s +++ test/ELF/copy-errors.s @@ -9,7 +9,8 @@ call bar -// CHECK: {{.*}}.o:(.text+0x1): cannot preempt symbol 'bar' defined in {{.*}}.so +// CHECK: {{.*}}.o: cannot preempt symbol 'bar' defined in {{.*}}.so +// CHECK: note: location is .text+0x1 call zed // CHECK: symbol 'zed' defined in {{.*}}.so is missing type Index: test/ELF/copy-in-shared.s =================================================================== --- test/ELF/copy-in-shared.s +++ test/ELF/copy-in-shared.s @@ -7,4 +7,4 @@ .quad foo -// CHECK: {{.*}}.o:(.text+0x0): can't create dynamic relocation R_X86_64_64 against symbol 'foo' defined in {{.*}}.so +// CHECK: {{.*}}.o: can't create dynamic relocation R_X86_64_64 against symbol 'foo' defined in {{.*}}.so Index: test/ELF/copy-rel-pie-error.s =================================================================== --- test/ELF/copy-rel-pie-error.s +++ test/ELF/copy-rel-pie-error.s @@ -3,8 +3,8 @@ // RUN: ld.lld %t2.o -o %t2.so -shared // RUN: not ld.lld %t.o %t2.so -o %t.exe -pie 2>&1 | FileCheck %s -// CHECK: {{.*}}.o:(.text+0x0): can't create dynamic relocation R_X86_64_64 against symbol 'bar' defined in {{.*}}.so -// CHECK: {{.*}}.o:(.text+0x8): can't create dynamic relocation R_X86_64_64 against symbol 'foo' defined in {{.*}}.so +// CHECK: {{.*}}.o: can't create dynamic relocation R_X86_64_64 against symbol 'bar' defined in {{.*}}.so +// CHECK: {{.*}}.o: can't create dynamic relocation R_X86_64_64 against symbol 'foo' defined in {{.*}}.so .global _start _start: Index: test/ELF/dynamic-reloc-in-ro.s =================================================================== --- test/ELF/dynamic-reloc-in-ro.s +++ test/ELF/dynamic-reloc-in-ro.s @@ -5,4 +5,4 @@ foo: .quad foo -// CHECK: {{.*}}.o:(.text+0x0): can't create dynamic relocation R_X86_64_64 against local symbol in readonly segment defined in {{.*}}.o +// CHECK: {{.*}}.o: can't create dynamic relocation R_X86_64_64 against local symbol in readonly segment defined in {{.*}}.o Index: test/ELF/eh-frame-dyn-rel.s =================================================================== --- test/ELF/eh-frame-dyn-rel.s +++ test/ELF/eh-frame-dyn-rel.s @@ -7,4 +7,4 @@ .cfi_personality 0x8c, foo .cfi_endproc -// CHECK: {{.*}}.o:(.eh_frame+0x12): can't create dynamic relocation R_X86_64_64 against symbol 'foo' defined in {{.*}}.o +// CHECK: {{.*}}.o: can't create dynamic relocation R_X86_64_64 against symbol 'foo' defined in {{.*}}.o Index: test/ELF/invalid-cie-length.s =================================================================== --- test/ELF/invalid-cie-length.s +++ test/ELF/invalid-cie-length.s @@ -6,4 +6,4 @@ .section .eh_frame .byte 0 -// CHECK: {{.*}}:(.eh_frame+0x0): CIE/FDE too small +// CHECK: {{.*}}: CIE/FDE too small Index: test/ELF/invalid-cie-length2.s =================================================================== --- test/ELF/invalid-cie-length2.s +++ test/ELF/invalid-cie-length2.s @@ -6,4 +6,4 @@ .section .eh_frame .long 42 -// CHECK: {{.*}}:(.eh_frame+0x0): CIE/FDE ends past the end of the section +// CHECK: {{.*}}: CIE/FDE ends past the end of the section Index: test/ELF/invalid-cie-length3.s =================================================================== --- test/ELF/invalid-cie-length3.s +++ test/ELF/invalid-cie-length3.s @@ -6,4 +6,4 @@ .section .eh_frame .long 0xFFFFFFFC -// CHECK: {{.*}}:(.eh_frame+0x0): CIE/FDE ends past the end of the section +// CHECK: {{.*}}: CIE/FDE ends past the end of the section Index: test/ELF/invalid-cie-length4.s =================================================================== --- test/ELF/invalid-cie-length4.s +++ test/ELF/invalid-cie-length4.s @@ -7,4 +7,4 @@ .long 0xFFFFFFFF .byte 0 -// CHECK: {{.*}}:(.eh_frame+0x0): CIE/FDE too large +// CHECK: {{.*}}: CIE/FDE too large Index: test/ELF/libsearch.s =================================================================== --- test/ELF/libsearch.s +++ test/ELF/libsearch.s @@ -22,7 +22,7 @@ // Should not link because of undefined symbol _bar // RUN: not ld.lld -o %t3 %t.o %tbar.o 2>&1 \ // RUN: | FileCheck --check-prefix=UNDEFINED %s -// UNDEFINED: error: {{.*}}:(.bar+0x0): undefined symbol '_bar' +// UNDEFINED: error: {{.*}}: undefined symbol '_bar' // Should fail if cannot find specified library (without -L switch) // RUN: not ld.lld -o %t3 %t.o -lls 2>&1 \ Index: test/ELF/linkerscript/edata-etext.s =================================================================== --- test/ELF/linkerscript/edata-etext.s +++ test/ELF/linkerscript/edata-etext.s @@ -2,9 +2,9 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o # RUN: echo "SECTIONS { }" > %t.script # RUN: not ld.lld %t.o -script %t.script -o %t 2>&1 | FileCheck %s -# CHECK: error: {{.*}}:(.text+0x0): undefined symbol '_edata' -# CHECK: error: {{.*}}:(.text+0x8): undefined symbol '_etext' -# CHECK: error: {{.*}}:(.text+0x10): undefined symbol '_end' +# CHECK: error: {{.*}}: undefined symbol '_edata' +# CHECK: error: {{.*}}: undefined symbol '_etext' +# CHECK: error: {{.*}}: undefined symbol '_end' .global _start,_end,_etext,_edata .text Index: test/ELF/linkerscript/ehdr_start.s =================================================================== --- test/ELF/linkerscript/ehdr_start.s +++ test/ELF/linkerscript/ehdr_start.s @@ -3,7 +3,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o # RUN: echo "SECTIONS { }" > %t.script # RUN: not ld.lld %t.o -script %t.script -o %t 2>&1 | FileCheck %s -# CHECK: error: {{.*}}:(.text+0x0): undefined symbol '__ehdr_start' +# CHECK: error: {{.*}}: undefined symbol '__ehdr_start' .text .global _start, __ehdr_start Index: test/ELF/lto/combined-lto-object-name.ll =================================================================== --- test/ELF/lto/combined-lto-object-name.ll +++ test/ELF/lto/combined-lto-object-name.ll @@ -11,4 +11,5 @@ ret void } -; CHECK: error: ld-temp.o:(function _start): undefined symbol 'foo' +; CHECK: error: lto.tmp: undefined symbol 'foo' +; CHECK: note: location is ld-temp.o(function _start) Index: test/ELF/mips-align-err.s =================================================================== --- test/ELF/mips-align-err.s +++ test/ELF/mips-align-err.s @@ -4,7 +4,7 @@ # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \ # RUN: -mcpu=mips32r6 %S/Inputs/mips-align-err.s -o %t2.o # RUN: not ld.lld %t.o %t2.o -o %t.exe 2>&1 | FileCheck %s -# CHECK: {{.*}}:(.text+0x1): improper alignment for relocation R_MIPS_PC16 +# CHECK: {{.*}}: improper alignment for relocation R_MIPS_PC16 .globl __start __start: Index: test/ELF/non-abs-reloc.s =================================================================== --- test/ELF/non-abs-reloc.s +++ test/ELF/non-abs-reloc.s @@ -1,7 +1,7 @@ // REQUIRES: x86 // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o // RUN: not ld.lld %t.o -o %t.so -shared 2>&1 | FileCheck %s -// CHECK: {{.*}}:(.dummy+0x0): has non-ABS reloc +// CHECK: {{.*}}: has non-ABS reloc .globl _start _start: Index: test/ELF/relocation-relative-absolute.s =================================================================== --- test/ELF/relocation-relative-absolute.s +++ test/ELF/relocation-relative-absolute.s @@ -7,6 +7,6 @@ .globl _start _start: -# CHECK: {{.*}}input1.o:(.text+0x1): relocation R_X86_64_PLT32 cannot refer to absolute symbol 'answer' defined in {{.*}}input2.o +# CHECK: {{.*}}input1.o: relocation R_X86_64_PLT32 cannot refer to absolute symbol 'answer' defined in {{.*}}input2.o call answer@PLT Index: test/ELF/sysroot.s =================================================================== --- test/ELF/sysroot.s +++ test/ELF/sysroot.s @@ -9,7 +9,7 @@ // Should not link because of undefined symbol _bar // RUN: not ld.lld -o %t/r %t/m.o 2>&1 \ // RUN: | FileCheck --check-prefix=UNDEFINED %s -// UNDEFINED: error: {{.*}}:(.text+0x1): undefined symbol '_bar' +// UNDEFINED: error: {{.*}}: undefined symbol '_bar' // We need to be sure that there is no suitable library in the /lib directory // RUN: not ld.lld -o %t/r %t/m.o -L/lib -l:libls.a 2>&1 \ Index: test/ELF/tls-static.s =================================================================== --- test/ELF/tls-static.s +++ test/ELF/tls-static.s @@ -10,4 +10,4 @@ _start: call __tls_get_addr -// CHECK: error: {{.*}}:(.text+0x1): undefined symbol '__tls_get_addr' +// CHECK: error: {{.*}}: undefined symbol '__tls_get_addr' Index: test/ELF/undef-shared.s =================================================================== --- test/ELF/undef-shared.s +++ test/ELF/undef-shared.s @@ -1,15 +1,18 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o # RUN: not ld.lld %t.o -o %t.so -shared 2>&1 | FileCheck %s -# CHECK: error: {{.*}}:(.data+0x0): undefined symbol 'hidden' +# CHECK: error: {{.*}}: undefined symbol 'hidden' +# CHECK: note: location is .data+0x0 .global hidden .hidden hidden -# CHECK: error: {{.*}}:(.data+0x8): undefined symbol 'internal' +# CHECK: error: {{.*}}: undefined symbol 'internal' +# CHECK: note: location is .data+0x8 .global internal .internal internal -# CHECK: error: {{.*}}:(.data+0x10): undefined symbol 'protected' +# CHECK: error: {{.*}}: undefined symbol 'protected' +# CHECK: note: location is .data+0x10 .global protected .protected protected Index: test/ELF/undef.s =================================================================== --- test/ELF/undef.s +++ test/ELF/undef.s @@ -5,17 +5,25 @@ # RUN: llvm-ar rc %t2.a %t2.o # RUN: not ld.lld %t.o %t2.a %t3.o -o %t.exe 2>&1 | FileCheck %s # RUN: not ld.lld -pie %t.o %t2.a %t3.o -o %t.exe 2>&1 | FileCheck %s -# CHECK: error: undef.s:(.text+0x1): undefined symbol 'foo' -# CHECK: error: undef.s:(.text+0x6): undefined symbol 'bar' -# CHECK: error: undef.s:(.text+0x10): undefined symbol 'foo(int)' -# CHECK: error: {{.*}}2.a({{.*}}.o):(.text+0x0): undefined symbol 'zed2' -# CHECK: error: dir/undef-debug.s:3: undefined symbol 'zed3' -# CHECK: error: dir/undef-debug.s:7: undefined symbol 'zed4' -# CHECK: error: dir/undef-debug.s:11: undefined symbol 'zed5' +# CHECK: error: {{.*}}.o: undefined symbol 'foo' +# CHECK: note: location is undef.s(.text+0x1) +# CHECK: error: {{.*}}.o: undefined symbol 'bar' +# CHECK: note: location is undef.s(.text+0x6) +# CHECK: error: {{.*}}.o: undefined symbol 'foo(int)' +# CHECK: note: location is undef.s(.text+0x10) +# CHECK: error: {{.*}}2.a({{.*}}.o): undefined symbol 'zed2' +# CHECK: note: location is .text+0x0 +# CHECK: error: {{.*}}.o: undefined symbol 'zed3' +# CHECK: note: location is dir/undef-debug.s:3 +# CHECK: error: {{.*}}.o: undefined symbol 'zed4' +# CHECK: note: location is dir/undef-debug.s:7 +# CHECK: error: {{.*}}.o: undefined symbol 'zed5' +# CHECK: note: location is dir/undef-debug.s:11 # RUN: not ld.lld %t.o %t2.a -o %t.exe -no-demangle 2>&1 | \ # RUN: FileCheck -check-prefix=NO-DEMANGLE %s -# NO-DEMANGLE: error: undef.s:(.text+0x10): undefined symbol '_Z3fooi' +# NO-DEMANGLE: error: {{.*}}.o: undefined symbol '_Z3fooi' +# NO-DEMANGLE: note: location is undef.s(.text+0x10) .file "undef.s" Index: test/ELF/unresolved-symbols.s =================================================================== --- test/ELF/unresolved-symbols.s +++ test/ELF/unresolved-symbols.s @@ -6,7 +6,8 @@ ## Check that %t2.o contains undefined symbol undef. # RUN: not ld.lld %t1.o %t2.o -o %t 2>&1 | \ # RUN: FileCheck -check-prefix=UNDCHECK %s -# UNDCHECK: error: {{.*}}2.o:(.text+0x1): undefined symbol 'undef' +# UNDCHECK: error: {{.*}}2.o: undefined symbol 'undef' +# UNDCHECK: note: location is .text+0x1 ## Error out if unknown option value was set. # RUN: not ld.lld %t1.o %t2.o -o %t --unresolved-symbols=xxx 2>&1 | \ @@ -19,7 +20,7 @@ # RUN: llvm-readobj %t1_1 > /dev/null 2>&1 # RUN: not ld.lld %t2.o -o %t1_2 --unresolved-symbols=ignore-all --no-undefined 2>&1 | \ # RUN: FileCheck -check-prefix=ERRUND %s -# ERRUND: error: {{.*}}:(.text+0x1): undefined symbol 'undef' +# ERRUND: error: {{.*}}: undefined symbol 'undef' ## Also ignore all should not produce error for symbols from DSOs. # RUN: ld.lld %t1.o %t.so -o %t1_3 --unresolved-symbols=ignore-all # RUN: llvm-readobj %t1_3 > /dev/null 2>&1 Index: test/ELF/verneed-local.s =================================================================== --- test/ELF/verneed-local.s +++ test/ELF/verneed-local.s @@ -2,7 +2,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o # RUN: not ld.lld %t.o %S/Inputs/verneed1.so -o %t 2>&1 | FileCheck %s -# CHECK: error: {{.*}}:(.text+0x1): undefined symbol 'f3' +# CHECK: error: {{.*}}: undefined symbol 'f3' .globl _start _start: call f3 Index: test/ELF/x86-64-dyn-rel-error.s =================================================================== --- test/ELF/x86-64-dyn-rel-error.s +++ test/ELF/x86-64-dyn-rel-error.s @@ -9,4 +9,4 @@ .data .long bar -// CHECK: {{.*}}:(.data+0x0): relocation R_X86_64_32 cannot be used against shared object; recompile with -fPIC. +// CHECK: {{.*}}: relocation R_X86_64_32 cannot be used against shared object; recompile with -fPIC. Index: test/ELF/x86-64-dyn-rel-error2.s =================================================================== --- test/ELF/x86-64-dyn-rel-error2.s +++ test/ELF/x86-64-dyn-rel-error2.s @@ -9,4 +9,4 @@ .data .long bar - . -// CHECK: {{.*}}:(.data+0x0): relocation R_X86_64_PC32 cannot be used against shared object; recompile with -fPIC. +// CHECK: {{.*}}: relocation R_X86_64_PC32 cannot be used against shared object; recompile with -fPIC. Index: test/ELF/x86-64-reloc-32-fpic.s =================================================================== --- test/ELF/x86-64-reloc-32-fpic.s +++ test/ELF/x86-64-reloc-32-fpic.s @@ -1,7 +1,6 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o # RUN: not ld.lld -shared %t.o -o %t.so 2>&1 | FileCheck %s -# CHECK: {{.*}}:(.data+0x0): relocation R_X86_64_32 cannot be used against shared object; recompile with -fPIC. - +# CHECK: {{.*}}: relocation R_X86_64_32 cannot be used against shared object; recompile with -fPIC. .data .long _shared Index: test/ELF/x86-64-reloc-error.s =================================================================== --- test/ELF/x86-64-reloc-error.s +++ test/ELF/x86-64-reloc-error.s @@ -6,5 +6,5 @@ movl $big, %edx movq $foo - 0x1000000000000, %rdx -# CHECK: {{.*}}:(.text+0x1): relocation R_X86_64_32 out of range -# CHECK: {{.*}}:(.text+0x8): relocation R_X86_64_32S out of range +# CHECK: {{.*}}: relocation R_X86_64_32 out of range +# CHECK: {{.*}}: relocation R_X86_64_32S out of range Index: test/ELF/x86-64-reloc-pc32-fpic.s =================================================================== --- test/ELF/x86-64-reloc-pc32-fpic.s +++ test/ELF/x86-64-reloc-pc32-fpic.s @@ -1,7 +1,7 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o # RUN: not ld.lld -shared %t.o -o %t.so 2>&1 | FileCheck %s -# CHECK: {{.*}}:(.data+0x1): relocation R_X86_64_PC32 cannot be used against shared object; recompile with -fPIC. +# CHECK: {{.*}}: relocation R_X86_64_PC32 cannot be used against shared object; recompile with -fPIC. .data call _shared Index: test/ELF/x86-64-reloc-range.s =================================================================== --- test/ELF/x86-64-reloc-range.s +++ test/ELF/x86-64-reloc-range.s @@ -1,7 +1,7 @@ // RUN: llvm-mc %s -o %t.o -triple x86_64-pc-linux -filetype=obj // RUN: not ld.lld %t.o -o %t.so -shared 2>&1 | FileCheck %s -// CHECK: {{.*}}:(.text+0x3): relocation R_X86_64_PC32 out of range +// CHECK: {{.*}}: relocation R_X86_64_PC32 out of range // CHECK-NOT: relocation lea foo(%rip), %rax Index: test/ELF/zdefs.s =================================================================== --- test/ELF/zdefs.s +++ test/ELF/zdefs.s @@ -2,6 +2,6 @@ # RUN: ld.lld -shared %t.o -o %t1.so # RUN: not ld.lld -z defs -shared %t.o -o %t1.so 2>&1 | FileCheck -check-prefix=ERR %s -# ERR: error: {{.*}}:(.text+0x1): undefined symbol 'foo' +# ERR: error: {{.*}}: undefined symbol 'foo' callq foo@PLT