Permalink
Browse files

Tweak to external symbol detection in ELF relocator

  • Loading branch information...
Kingcom committed Apr 3, 2018
1 parent 74651da commit 5996abc675047fd568424fe3dd2cd1e9f9f162ae
Showing with 8 additions and 1 deletion.
  1. +8 −1 Core/ELF/ElfRelocator.cpp
@@ -351,8 +351,15 @@ bool ElfRelocator::relocateFile(ElfRelocatorFile& file, int64_t& relocationAddre
relocator->setSymbolAddress(relData,sym.st_value,sym.st_info & 0xF);

// externs?
if (relData.targetSymbolType == STT_NOTYPE && sym.st_shndx == 0)
if (sym.st_shndx == 0)
{
if (sym.st_name == 0)
{
Logger::queueError(Logger::Error, L"Symbol without a name");
error = true;
continue;
}

std::wstring symName = toWLowercase(elf->getStrTableString(sym.st_name));

Label* label = Global.symbolTable.getLabel(symName,-1,-1);

0 comments on commit 5996abc

Please sign in to comment.