From 2574e2995842b9495c8f776f3ec5cc7ddf740e1b Mon Sep 17 00:00:00 2001 From: shinyquagsire23 Date: Sat, 23 Jul 2016 18:01:54 -0700 Subject: [PATCH] Fix corner case with findSymbol in elf2rpl --- tools/elf2rpl/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/elf2rpl/main.cpp b/tools/elf2rpl/main.cpp index 5f699d5..54bf116 100644 --- a/tools/elf2rpl/main.cpp +++ b/tools/elf2rpl/main.cpp @@ -89,6 +89,12 @@ struct InputSection static ElfFile::Symbol * findSymbol(ElfFile &file, uint32_t address) { + for (auto &symbol : file.symbols) { + if (symbol->address == address && symbol->type != elf::STT_NOTYPE) { + return symbol.get(); + } + } + for (auto &symbol : file.symbols) { if (symbol->address == address) { return symbol.get();