From 41054a4c56f67ab7d05959a8892eb37b6be368a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Moln=C3=A1r?= Date: Thu, 6 Mar 2014 22:26:41 +0100 Subject: [PATCH] handle duplicates in ImportLinker --- src/pefile.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pefile.cpp b/src/pefile.cpp index 0864f4c9..89d0ea02 100644 --- a/src/pefile.cpp +++ b/src/pefile.cpp @@ -680,6 +680,8 @@ class PeFile::ImportLinker : public ElfLinkerAMD64 "R_X86_64_32", sdll, 0); } tstr thunk(name_for_proc(dll, proc, thunk_id, tsep)); + if (findSection(thunk, false) != NULL) + return; // we already have this dll/proc addSection(thunk, zeros, thunk_size, 0); addSymbol(thunk, thunk, 0); if (tsep == thunk_separator_first)