2015-07-25 05:03:07 +08:00
|
|
|
//===- Symbols.cpp --------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Linker
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "Symbols.h"
|
2015-07-29 06:58:25 +08:00
|
|
|
#include "InputFiles.h"
|
2016-02-02 05:00:35 +08:00
|
|
|
#include "InputSection.h"
|
|
|
|
#include "OutputSections.h"
|
2016-11-06 07:05:47 +08:00
|
|
|
#include "SyntheticSections.h"
|
2016-02-02 05:00:35 +08:00
|
|
|
#include "Target.h"
|
2016-12-20 01:01:01 +08:00
|
|
|
#include "Writer.h"
|
[lld] unified COFF and ELF error handling on new Common/ErrorHandler
Summary:
The COFF linker and the ELF linker have long had similar but separate
Error.h and Error.cpp files to implement error handling. This change
introduces new error handling code in Common/ErrorHandler.h, changes the
COFF and ELF linkers to use it, and removes the old, separate
implementations.
Reviewers: ruiu
Reviewed By: ruiu
Subscribers: smeenai, jyknight, emaste, sdardis, nemanjai, nhaehnle, mgorny, javed.absar, kbarton, fedor.sergeev, llvm-commits
Differential Revision: https://reviews.llvm.org/D39259
llvm-svn: 316624
2017-10-26 06:28:38 +08:00
|
|
|
#include "lld/Common/ErrorHandler.h"
|
2017-11-28 10:15:26 +08:00
|
|
|
#include "lld/Common/Strings.h"
|
2015-09-05 06:28:10 +08:00
|
|
|
#include "llvm/ADT/STLExtras.h"
|
2016-10-12 16:19:30 +08:00
|
|
|
#include "llvm/Support/Path.h"
|
2016-11-23 12:57:25 +08:00
|
|
|
#include <cstring>
|
2015-09-05 06:28:10 +08:00
|
|
|
|
|
|
|
using namespace llvm;
|
2015-07-25 05:03:07 +08:00
|
|
|
using namespace llvm::object;
|
2015-09-02 07:12:52 +08:00
|
|
|
using namespace llvm::ELF;
|
2015-07-25 05:03:07 +08:00
|
|
|
|
|
|
|
using namespace lld;
|
2016-02-28 08:25:54 +08:00
|
|
|
using namespace lld::elf;
|
2015-07-25 05:03:07 +08:00
|
|
|
|
2017-11-06 12:35:31 +08:00
|
|
|
Defined *ElfSym::Bss;
|
|
|
|
Defined *ElfSym::Etext1;
|
|
|
|
Defined *ElfSym::Etext2;
|
|
|
|
Defined *ElfSym::Edata1;
|
|
|
|
Defined *ElfSym::Edata2;
|
|
|
|
Defined *ElfSym::End1;
|
|
|
|
Defined *ElfSym::End2;
|
|
|
|
Defined *ElfSym::GlobalOffsetTable;
|
|
|
|
Defined *ElfSym::MipsGp;
|
|
|
|
Defined *ElfSym::MipsGpDisp;
|
|
|
|
Defined *ElfSym::MipsLocalGp;
|
2018-04-20 00:54:30 +08:00
|
|
|
Defined *ElfSym::RelaIpltEnd;
|
2018-08-10 01:59:56 +08:00
|
|
|
Defined *ElfSym::RISCVGlobalPointer;
|
2017-03-01 03:29:55 +08:00
|
|
|
|
2017-11-04 08:31:04 +08:00
|
|
|
static uint64_t getSymVA(const Symbol &Sym, int64_t &Addend) {
|
|
|
|
switch (Sym.kind()) {
|
2017-11-06 12:35:31 +08:00
|
|
|
case Symbol::DefinedKind: {
|
|
|
|
auto &D = cast<Defined>(Sym);
|
2017-03-09 06:36:28 +08:00
|
|
|
SectionBase *IS = D.Section;
|
2016-02-02 05:00:35 +08:00
|
|
|
|
2016-04-04 22:04:16 +08:00
|
|
|
// According to the ELF spec reference to a local symbol from outside
|
|
|
|
// the group are not allowed. Unfortunately .eh_frame breaks that rule
|
|
|
|
// and must be treated specially. For now we just replace the symbol with
|
|
|
|
// 0.
|
2017-02-24 00:49:07 +08:00
|
|
|
if (IS == &InputSection::Discarded)
|
2016-04-04 22:04:16 +08:00
|
|
|
return 0;
|
|
|
|
|
2016-02-02 05:00:35 +08:00
|
|
|
// This is an absolute symbol.
|
2016-12-15 08:57:53 +08:00
|
|
|
if (!IS)
|
2016-04-04 22:04:16 +08:00
|
|
|
return D.Value;
|
2016-02-02 05:00:35 +08:00
|
|
|
|
2018-04-20 01:26:50 +08:00
|
|
|
IS = IS->Repl;
|
|
|
|
|
2017-03-08 23:21:32 +08:00
|
|
|
uint64_t Offset = D.Value;
|
2017-02-28 16:32:56 +08:00
|
|
|
|
|
|
|
// An object in an SHF_MERGE section might be referenced via a
|
|
|
|
// section symbol (as a hack for reducing the number of local
|
|
|
|
// symbols).
|
2017-03-01 12:44:04 +08:00
|
|
|
// Depending on the addend, the reference via a section symbol
|
|
|
|
// refers to a different object in the merge section.
|
|
|
|
// Since the objects in the merge section are not necessarily
|
|
|
|
// contiguous in the output, the addend can thus affect the final
|
|
|
|
// VA in a non-linear way.
|
|
|
|
// To make this work, we incorporate the addend into the section
|
|
|
|
// offset (and zero out the addend for later processing) so that
|
|
|
|
// we find the right object in the section.
|
2016-04-04 22:04:16 +08:00
|
|
|
if (D.isSection()) {
|
2016-03-11 22:21:37 +08:00
|
|
|
Offset += Addend;
|
|
|
|
Addend = 0;
|
|
|
|
}
|
2017-02-28 16:32:56 +08:00
|
|
|
|
2017-02-28 17:01:58 +08:00
|
|
|
// In the typical case, this is actually very simple and boils
|
|
|
|
// down to adding together 3 numbers:
|
|
|
|
// 1. The address of the output section.
|
|
|
|
// 2. The offset of the input section within the output section.
|
|
|
|
// 3. The offset within the input section (this addition happens
|
|
|
|
// inside InputSection::getOffset).
|
|
|
|
//
|
|
|
|
// If you understand the data structures involved with this next
|
|
|
|
// line (and how they get built), then you have a pretty good
|
|
|
|
// understanding of the linker.
|
2018-03-24 08:35:11 +08:00
|
|
|
uint64_t VA = IS->getVA(Offset);
|
2017-02-28 17:01:58 +08:00
|
|
|
|
2016-10-04 16:52:51 +08:00
|
|
|
if (D.isTls() && !Config->Relocatable) {
|
[ELF] Set Out::TlsPhdr earlier for encoding packed reloc tables
Summary:
For --pack-dyn-relocs=android, finalizeSections calls
LinkerScript::assignAddresses and
AndroidPackedRelocationSection::updateAllocSize in a loop,
where assignAddresses lays out the ELF image, then updateAllocSize
determines the size of the Android packed relocation table by encoding it.
Encoding the table requires knowing the values of relocation addends.
To get the addend of a TLS relocation, updateAllocSize can call getSymVA
on a TLS symbol before setPhdrs has initialized Out::TlsPhdr, producing an
error:
<file> has an STT_TLS symbol but doesn't have an SHF_TLS section
Fix the problem by initializing Out::TlsPhdr immediately after the program
headers are created. The segment's p_vaddr field isn't initialized until
setPhdrs, so use FirstSec->Addr, which is what setPhdrs would use.
FirstSec will typically refer to the .tdata or .tbss output section, whose
(tentative) address was computed by assignAddresses.
Android currently avoids this problem because it uses emutls and doesn't
support ELF TLS. This problem doesn't apply to --pack-dyn-relocs=relr
because SHR_RELR only handles relative relocations without explicit addends
or info.
Fixes https://bugs.llvm.org/show_bug.cgi?id=37841.
Reviewers: ruiu, pcc, chh, javed.absar, espindola
Subscribers: emaste, arichardson, llvm-commits, srhines
Differential Revision: https://reviews.llvm.org/D51671
llvm-svn: 342432
2018-09-18 08:24:48 +08:00
|
|
|
// Use the address of the TLS segment's first section rather than the
|
|
|
|
// segment's address, because segment addresses aren't initialized until
|
|
|
|
// after sections are finalized. (e.g. Measuring the size of .rela.dyn
|
|
|
|
// for Android relocation packing requires knowing TLS symbol addresses
|
|
|
|
// during section finalization.)
|
|
|
|
if (!Out::TlsPhdr || !Out::TlsPhdr->FirstSec)
|
2017-11-30 06:47:35 +08:00
|
|
|
fatal(toString(D.File) +
|
2017-07-14 08:22:46 +08:00
|
|
|
" has an STT_TLS symbol but doesn't have an SHF_TLS section");
|
[ELF] Set Out::TlsPhdr earlier for encoding packed reloc tables
Summary:
For --pack-dyn-relocs=android, finalizeSections calls
LinkerScript::assignAddresses and
AndroidPackedRelocationSection::updateAllocSize in a loop,
where assignAddresses lays out the ELF image, then updateAllocSize
determines the size of the Android packed relocation table by encoding it.
Encoding the table requires knowing the values of relocation addends.
To get the addend of a TLS relocation, updateAllocSize can call getSymVA
on a TLS symbol before setPhdrs has initialized Out::TlsPhdr, producing an
error:
<file> has an STT_TLS symbol but doesn't have an SHF_TLS section
Fix the problem by initializing Out::TlsPhdr immediately after the program
headers are created. The segment's p_vaddr field isn't initialized until
setPhdrs, so use FirstSec->Addr, which is what setPhdrs would use.
FirstSec will typically refer to the .tdata or .tbss output section, whose
(tentative) address was computed by assignAddresses.
Android currently avoids this problem because it uses emutls and doesn't
support ELF TLS. This problem doesn't apply to --pack-dyn-relocs=relr
because SHR_RELR only handles relative relocations without explicit addends
or info.
Fixes https://bugs.llvm.org/show_bug.cgi?id=37841.
Reviewers: ruiu, pcc, chh, javed.absar, espindola
Subscribers: emaste, arichardson, llvm-commits, srhines
Differential Revision: https://reviews.llvm.org/D51671
llvm-svn: 342432
2018-09-18 08:24:48 +08:00
|
|
|
return VA - Out::TlsPhdr->FirstSec->Addr;
|
2016-10-04 16:52:51 +08:00
|
|
|
}
|
2016-03-11 22:21:37 +08:00
|
|
|
return VA;
|
2016-02-02 05:00:35 +08:00
|
|
|
}
|
2018-04-27 01:58:58 +08:00
|
|
|
case Symbol::SharedKind:
|
2017-11-04 05:21:47 +08:00
|
|
|
case Symbol::UndefinedKind:
|
2016-02-02 05:00:35 +08:00
|
|
|
return 0;
|
2017-11-04 05:21:47 +08:00
|
|
|
case Symbol::LazyArchiveKind:
|
|
|
|
case Symbol::LazyObjectKind:
|
2018-09-12 07:00:36 +08:00
|
|
|
assert(Sym.IsUsedInRegularObj && "lazy symbol reached writer");
|
|
|
|
return 0;
|
2016-02-02 05:00:35 +08:00
|
|
|
}
|
2016-03-12 16:31:34 +08:00
|
|
|
llvm_unreachable("invalid symbol kind");
|
2016-02-02 05:00:35 +08:00
|
|
|
}
|
|
|
|
|
2017-11-04 05:21:47 +08:00
|
|
|
uint64_t Symbol::getVA(int64_t Addend) const {
|
2017-03-17 19:56:54 +08:00
|
|
|
uint64_t OutVA = getSymVA(*this, Addend);
|
2016-03-18 07:36:19 +08:00
|
|
|
return OutVA + Addend;
|
2016-03-11 20:19:05 +08:00
|
|
|
}
|
|
|
|
|
2018-09-26 03:26:58 +08:00
|
|
|
uint64_t Symbol::getGotVA() const { return In.Got->getVA() + getGotOffset(); }
|
2016-04-07 23:20:56 +08:00
|
|
|
|
2017-11-04 05:21:47 +08:00
|
|
|
uint64_t Symbol::getGotOffset() const {
|
2016-07-14 02:55:14 +08:00
|
|
|
return GotIndex * Target->GotEntrySize;
|
2016-02-02 05:00:35 +08:00
|
|
|
}
|
|
|
|
|
2017-11-04 05:21:47 +08:00
|
|
|
uint64_t Symbol::getGotPltVA() const {
|
2016-12-08 20:58:55 +08:00
|
|
|
if (this->IsInIgot)
|
2018-09-26 03:26:58 +08:00
|
|
|
return In.IgotPlt->getVA() + getGotPltOffset();
|
|
|
|
return In.GotPlt->getVA() + getGotPltOffset();
|
2016-04-07 23:20:56 +08:00
|
|
|
}
|
|
|
|
|
2017-11-04 05:21:47 +08:00
|
|
|
uint64_t Symbol::getGotPltOffset() const {
|
2018-04-27 00:09:30 +08:00
|
|
|
if (IsInIgot)
|
|
|
|
return PltIndex * Target->GotPltEntrySize;
|
|
|
|
return (PltIndex + Target->GotPltHeaderEntriesNum) * Target->GotPltEntrySize;
|
2016-02-02 05:00:35 +08:00
|
|
|
}
|
|
|
|
|
2017-11-04 05:21:47 +08:00
|
|
|
uint64_t Symbol::getPltVA() const {
|
2016-12-08 20:58:55 +08:00
|
|
|
if (this->IsInIplt)
|
2018-09-26 03:26:58 +08:00
|
|
|
return In.Iplt->getVA() + PltIndex * Target->PltEntrySize;
|
|
|
|
return In.Plt->getVA() + Target->getPltEntryOffset(PltIndex);
|
2016-02-02 05:00:35 +08:00
|
|
|
}
|
|
|
|
|
2018-04-27 01:58:58 +08:00
|
|
|
uint64_t Symbol::getPltOffset() const {
|
|
|
|
assert(!this->IsInIplt);
|
|
|
|
return Target->getPltEntryOffset(PltIndex);
|
|
|
|
}
|
|
|
|
|
2017-11-04 05:21:47 +08:00
|
|
|
uint64_t Symbol::getSize() const {
|
2017-11-06 12:35:31 +08:00
|
|
|
if (const auto *DR = dyn_cast<Defined>(this))
|
2016-04-04 22:04:16 +08:00
|
|
|
return DR->Size;
|
2018-07-17 19:35:28 +08:00
|
|
|
return cast<SharedSymbol>(this)->Size;
|
2016-02-03 08:12:24 +08:00
|
|
|
}
|
|
|
|
|
2017-11-04 05:21:47 +08:00
|
|
|
OutputSection *Symbol::getOutputSection() const {
|
2017-11-06 12:35:31 +08:00
|
|
|
if (auto *S = dyn_cast<Defined>(this)) {
|
2017-12-14 06:59:23 +08:00
|
|
|
if (auto *Sec = S->Section)
|
2018-04-20 01:26:50 +08:00
|
|
|
return Sec->Repl->getOutputSection();
|
2017-02-28 12:02:42 +08:00
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2016-11-23 13:48:40 +08:00
|
|
|
// If a symbol name contains '@', the characters after that is
|
|
|
|
// a symbol version name. This function parses that.
|
2017-11-04 05:21:47 +08:00
|
|
|
void Symbol::parseSymbolVersion() {
|
2016-11-23 13:48:40 +08:00
|
|
|
StringRef S = getName();
|
|
|
|
size_t Pos = S.find('@');
|
|
|
|
if (Pos == 0 || Pos == StringRef::npos)
|
|
|
|
return;
|
|
|
|
StringRef Verstr = S.substr(Pos + 1);
|
|
|
|
if (Verstr.empty())
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Truncate the symbol name so that it doesn't include the version string.
|
2018-04-26 05:44:37 +08:00
|
|
|
NameSize = Pos;
|
2016-11-23 13:48:40 +08:00
|
|
|
|
2017-01-18 00:08:06 +08:00
|
|
|
// If this is not in this DSO, it is not a definition.
|
2017-11-06 12:39:07 +08:00
|
|
|
if (!isDefined())
|
2017-01-07 06:30:35 +08:00
|
|
|
return;
|
|
|
|
|
2016-11-23 13:48:40 +08:00
|
|
|
// '@@' in a symbol name means the default version.
|
|
|
|
// It is usually the most recent one.
|
|
|
|
bool IsDefault = (Verstr[0] == '@');
|
|
|
|
if (IsDefault)
|
|
|
|
Verstr = Verstr.substr(1);
|
|
|
|
|
|
|
|
for (VersionDefinition &Ver : Config->VersionDefinitions) {
|
|
|
|
if (Ver.Name != Verstr)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (IsDefault)
|
2017-11-01 00:07:41 +08:00
|
|
|
VersionId = Ver.Id;
|
2016-11-23 13:48:40 +08:00
|
|
|
else
|
2017-11-01 00:07:41 +08:00
|
|
|
VersionId = Ver.Id | VERSYM_HIDDEN;
|
2016-11-23 13:48:40 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// It is an error if the specified version is not defined.
|
2017-07-04 21:19:13 +08:00
|
|
|
// Usually version script is not provided when linking executable,
|
|
|
|
// but we may still want to override a versioned symbol from DSO,
|
2018-05-14 18:13:56 +08:00
|
|
|
// so we do not report error in this case. We also do not error
|
|
|
|
// if the symbol has a local version as it won't be in the dynamic
|
|
|
|
// symbol table.
|
|
|
|
if (Config->Shared && VersionId != VER_NDX_LOCAL)
|
2017-11-30 06:47:35 +08:00
|
|
|
error(toString(File) + ": symbol " + S + " has undefined version " +
|
2017-07-04 21:19:13 +08:00
|
|
|
Verstr);
|
2016-11-23 13:48:40 +08:00
|
|
|
}
|
|
|
|
|
2018-04-03 10:06:57 +08:00
|
|
|
InputFile *LazyArchive::fetch() { return cast<ArchiveFile>(File)->fetch(Sym); }
|
2016-04-08 03:24:51 +08:00
|
|
|
|
2018-08-09 07:48:12 +08:00
|
|
|
MemoryBufferRef LazyArchive::getMemberBuffer() {
|
|
|
|
Archive::Child C = CHECK(
|
|
|
|
Sym.getMember(), "could not get the member for symbol " + Sym.getName());
|
|
|
|
|
|
|
|
return CHECK(C.getMemoryBufferRef(),
|
|
|
|
"could not get the buffer for the member defining symbol " +
|
|
|
|
Sym.getName());
|
|
|
|
}
|
|
|
|
|
2017-11-04 05:21:47 +08:00
|
|
|
uint8_t Symbol::computeBinding() const {
|
2017-01-11 01:08:13 +08:00
|
|
|
if (Config->Relocatable)
|
|
|
|
return Binding;
|
2016-04-23 02:42:48 +08:00
|
|
|
if (Visibility != STV_DEFAULT && Visibility != STV_PROTECTED)
|
2017-01-11 01:08:13 +08:00
|
|
|
return STB_LOCAL;
|
2018-10-03 17:33:00 +08:00
|
|
|
if (VersionId == VER_NDX_LOCAL && isDefined() && !IsPreemptible)
|
2017-01-11 01:08:13 +08:00
|
|
|
return STB_LOCAL;
|
2018-02-03 05:44:06 +08:00
|
|
|
if (!Config->GnuUnique && Binding == STB_GNU_UNIQUE)
|
2017-01-11 01:08:13 +08:00
|
|
|
return STB_GLOBAL;
|
|
|
|
return Binding;
|
|
|
|
}
|
|
|
|
|
2017-11-04 05:21:47 +08:00
|
|
|
bool Symbol::includeInDynsym() const {
|
2017-09-16 02:05:02 +08:00
|
|
|
if (!Config->HasDynSymTab)
|
|
|
|
return false;
|
2017-01-11 01:08:13 +08:00
|
|
|
if (computeBinding() == STB_LOCAL)
|
2016-04-22 05:44:25 +08:00
|
|
|
return false;
|
2017-11-06 12:39:07 +08:00
|
|
|
if (!isDefined())
|
2017-09-14 04:43:04 +08:00
|
|
|
return true;
|
2017-09-14 04:47:53 +08:00
|
|
|
return ExportDynamic;
|
2016-04-22 04:35:25 +08:00
|
|
|
}
|
2016-07-18 01:50:09 +08:00
|
|
|
|
|
|
|
// Print out a log message for --trace-symbol.
|
2017-11-04 05:21:47 +08:00
|
|
|
void elf::printTraceSymbol(Symbol *Sym) {
|
2017-02-22 07:22:56 +08:00
|
|
|
std::string S;
|
2017-11-01 00:07:41 +08:00
|
|
|
if (Sym->isUndefined())
|
2017-02-22 07:22:56 +08:00
|
|
|
S = ": reference to ";
|
2017-11-01 00:07:41 +08:00
|
|
|
else if (Sym->isLazy())
|
2017-10-28 02:30:11 +08:00
|
|
|
S = ": lazy definition of ";
|
2017-11-01 00:07:41 +08:00
|
|
|
else if (Sym->isShared())
|
2017-10-28 02:30:11 +08:00
|
|
|
S = ": shared definition of ";
|
2017-11-06 12:35:31 +08:00
|
|
|
else if (dyn_cast_or_null<BssSection>(cast<Defined>(Sym)->Section))
|
2017-11-06 12:33:58 +08:00
|
|
|
S = ": common definition of ";
|
2016-07-18 01:50:09 +08:00
|
|
|
else
|
2017-02-22 07:22:56 +08:00
|
|
|
S = ": definition of ";
|
|
|
|
|
2017-11-01 00:07:41 +08:00
|
|
|
message(toString(Sym->File) + S + Sym->getName());
|
2016-07-18 01:50:09 +08:00
|
|
|
}
|
|
|
|
|
2018-04-18 07:30:05 +08:00
|
|
|
void elf::warnUnorderableSymbol(const Symbol *Sym) {
|
|
|
|
if (!Config->WarnSymbolOrdering)
|
|
|
|
return;
|
2018-04-26 09:38:29 +08:00
|
|
|
|
2018-04-18 07:30:05 +08:00
|
|
|
const InputFile *File = Sym->File;
|
|
|
|
auto *D = dyn_cast<Defined>(Sym);
|
2018-04-26 09:38:29 +08:00
|
|
|
|
|
|
|
auto Warn = [&](StringRef S) { warn(toString(File) + S + Sym->getName()); };
|
|
|
|
|
2018-04-18 07:30:05 +08:00
|
|
|
if (Sym->isUndefined())
|
2018-04-26 09:38:29 +08:00
|
|
|
Warn(": unable to order undefined symbol: ");
|
2018-04-18 07:30:05 +08:00
|
|
|
else if (Sym->isShared())
|
2018-04-26 09:38:29 +08:00
|
|
|
Warn(": unable to order shared symbol: ");
|
2018-04-18 07:30:05 +08:00
|
|
|
else if (D && !D->Section)
|
2018-04-26 09:38:29 +08:00
|
|
|
Warn(": unable to order absolute symbol: ");
|
2018-04-18 07:30:05 +08:00
|
|
|
else if (D && isa<OutputSection>(D->Section))
|
2018-04-26 09:38:29 +08:00
|
|
|
Warn(": unable to order synthetic symbol: ");
|
2018-04-18 07:30:05 +08:00
|
|
|
else if (D && !D->Section->Repl->Live)
|
2018-04-26 09:38:29 +08:00
|
|
|
Warn(": unable to order discarded symbol: ");
|
2018-04-18 07:30:05 +08:00
|
|
|
}
|
|
|
|
|
2016-11-25 04:24:18 +08:00
|
|
|
// Returns a symbol for an error message.
|
2017-11-04 05:21:47 +08:00
|
|
|
std::string lld::toString(const Symbol &B) {
|
2016-11-25 04:24:18 +08:00
|
|
|
if (Config->Demangle)
|
2017-11-28 10:15:26 +08:00
|
|
|
if (Optional<std::string> S = demangleItanium(B.getName()))
|
2016-12-08 07:17:05 +08:00
|
|
|
return *S;
|
2016-11-25 04:24:18 +08:00
|
|
|
return B.getName();
|
|
|
|
}
|