From 267829774358b5aebd3e726ae318813bd48129bb Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Thu, 13 Jul 2017 19:26:06 +0000 Subject: Vendor import of lld trunk r307894: https://llvm.org/svn/llvm-project/lld/trunk@307894 --- ELF/InputSection.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ELF/InputSection.cpp') diff --git a/ELF/InputSection.cpp b/ELF/InputSection.cpp index b1d5e13494605..c6a539b8dfa52 100644 --- a/ELF/InputSection.cpp +++ b/ELF/InputSection.cpp @@ -276,7 +276,9 @@ template std::string InputSectionBase::getSrcMsg(uint64_t Offset) { template std::string InputSectionBase::getObjMsg(uint64_t Off) { // Synthetic sections don't have input files. elf::ObjectFile *File = getFile(); - std::string Filename = File ? File->getName() : "(internal)"; + if (!File) + return ("(internal):(" + Name + "+0x" + utohexstr(Off) + ")").str(); + std::string Filename = File->getName(); std::string Archive; if (!File->ArchiveName.empty()) @@ -466,7 +468,7 @@ static uint64_t getAArch64UndefinedRelativeWeakVA(uint64_t Type, uint64_t A, static uint64_t getARMStaticBase(const SymbolBody &Body) { OutputSection *OS = Body.getOutputSection(); if (!OS || !OS->FirstInPtLoad) - fatal("SBREL relocation to " + Body.getName() + " without static base\n"); + fatal("SBREL relocation to " + Body.getName() + " without static base"); return OS->FirstInPtLoad->Addr; } -- cgit v1.3