From eee7c92a62872ca06bb864674ea73ddab09f362e Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Mon, 6 Oct 2014 05:06:06 +0200
Subject: dbghelp: Always check for debug symbols in BINDIR.

---
 dlls/dbghelp/Makefile.in  | 2 +-
 dlls/dbghelp/elf_module.c | 8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/dlls/dbghelp/Makefile.in b/dlls/dbghelp/Makefile.in
index 86846cb..6b72980 100644
--- a/dlls/dbghelp/Makefile.in
+++ b/dlls/dbghelp/Makefile.in
@@ -1,6 +1,6 @@
 MODULE    = dbghelp.dll
 IMPORTLIB = dbghelp
-EXTRADEFS = -D_IMAGEHLP_SOURCE_
+EXTRADEFS = -D_IMAGEHLP_SOURCE_ -DBINDIR="\"${bindir}\""
 IMPORTS   = psapi
 DELAYIMPORTS = version
 EXTRALIBS = $(Z_LIBS) $(CORESERVICES_LIBS) $(COREFOUNDATION_LIBS)
diff --git a/dlls/dbghelp/elf_module.c b/dlls/dbghelp/elf_module.c
index b176143..8e22265 100644
--- a/dlls/dbghelp/elf_module.c
+++ b/dlls/dbghelp/elf_module.c
@@ -1486,9 +1486,11 @@ static BOOL elf_search_and_load_file(struct process* pcs, const WCHAR* filename,
     if (!ret && !strchrW(filename, '/'))
     {
         ret = elf_load_file_from_path(pcs, filename, load_offset, dyn_addr,
-                                      getenv("PATH"), elf_info) ||
-            elf_load_file_from_path(pcs, filename, load_offset, dyn_addr,
-                                    getenv("LD_LIBRARY_PATH"), elf_info);
+                                      getenv("PATH"), elf_info);
+        if (!ret) ret = elf_load_file_from_path(pcs, filename, load_offset, dyn_addr,
+                                                getenv("LD_LIBRARY_PATH"), elf_info);
+        if (!ret) ret = elf_load_file_from_path(pcs, filename, load_offset, dyn_addr,
+                                                BINDIR, elf_info);
         if (!ret) ret = elf_load_file_from_dll_path(pcs, filename,
                                                     load_offset, dyn_addr, elf_info);
     }
-- 
2.6.2

