Inline traceUndefined function.

llvm-svn: 275531
This commit is contained in:
Rui Ueyama 2016-07-15 04:57:46 +00:00
parent eba9b63cbc
commit 3d9b26b4ad
2 changed files with 5 additions and 11 deletions

View File

@ -319,14 +319,6 @@ elf::ObjectFile<ELFT>::createInputSection(const Elf_Shdr &Sec) {
return new (IAlloc.Allocate()) InputSection<ELFT>(this, &Sec);
}
// Print the module names which reference the notified
// symbols provided through -y or --trace-symbol option.
template <class ELFT>
void elf::ObjectFile<ELFT>::traceUndefined(StringRef Name) {
if (!Config->TraceSymbol.empty() && Config->TraceSymbol.count(Name))
outs() << getFilename(this) << ": reference to " << Name << "\n";
}
template <class ELFT> void elf::ObjectFile<ELFT>::initializeSymbols() {
this->initStringTable();
Elf_Sym_Range Syms = this->getElfSymbols(false);
@ -365,7 +357,11 @@ SymbolBody *elf::ObjectFile<ELFT>::createSymbolBody(const Elf_Sym *Sym) {
switch (Sym->st_shndx) {
case SHN_UNDEF:
traceUndefined(Name);
// Handle --trace-symbol option. Prints out a log message
// if the current symbol is being watched. Useful for debugging.
if (!Config->TraceSymbol.empty() && Config->TraceSymbol.count(Name))
outs() << getFilename(this) << ": reference to " << Name << "\n";
return elf::Symtab<ELFT>::X
->addUndefined(Name, Binding, Sym->st_other, Sym->getType(),
/*CanOmitFromDynSym*/ false, this)

View File

@ -143,8 +143,6 @@ public:
const Elf_Shdr *getSymbolTable() const { return this->Symtab; };
void traceUndefined(StringRef Name);
// Get MIPS GP0 value defined by this file. This value represents the gp value
// used to create the relocatable object and required to support
// R_MIPS_GPREL16 / R_MIPS_GPREL32 relocations.