diff --git a/ChangeLog b/ChangeLog
index 93c302eb..31f52a0f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-07-18  Joerg Wunsch <j.gnu@uriah.heep.sax.de>
+
+	* configure.ac: check for libelf.h also in libelf/
+	* fileio.c: include <libelf/libelf.h> if configure found this
+	to be the case
+
 2012-06-13  Rene Liebscher <R.Liebscher@gmx.de>
 
 	* configure.ac: Check for presence of <pthread.h>
diff --git a/configure.ac b/configure.ac
index 98574826..7d7c96ab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -84,7 +84,7 @@ if test x$have_libelf = xyes; then
                ;;
    esac
    AC_DEFINE([HAVE_LIBELF])
-   AC_CHECK_HEADERS([libelf.h])
+   AC_CHECK_HEADERS([libelf.h libelf/libelf.h])
 fi
 AC_SUBST(LIBELF, $LIBELF)
 
diff --git a/fileio.c b/fileio.c
index 1680128d..2efb87f2 100644
--- a/fileio.c
+++ b/fileio.c
@@ -30,7 +30,11 @@
 #include <stdint.h>
 
 #ifdef HAVE_LIBELF
+#ifdef HAVE_LIBELF_H
 #include <libelf.h>
+#elif defined(HAVE_LIBELF_LIBELF_H)
+#include <libelf/libelf.h>
+#endif
 #define EM_AVR32 0x18ad         /* inofficial */
 #endif