diff --git a/build/files.c b/build/files.c index bf06c17..2178587 100644 --- a/build/files.c +++ b/build/files.c @@ -1826,7 +1826,11 @@ static int generateBuildIDs(FileList fl, ARGV_t *files) kernel modules (ET_REL files with .modinfo section) should have build-ids. */ GElf_Ehdr ehdr; +#if HAVE_DWELF_ELF_BEGIN + Elf *elf = dwelf_elf_begin(fd); +#else Elf *elf = elf_begin (fd, ELF_C_READ, NULL); +#endif if (elf != NULL && elf_kind(elf) == ELF_K_ELF && gelf_getehdr(elf, &ehdr) != NULL && (ehdr.e_type == ET_EXEC || ehdr.e_type == ET_DYN diff --git a/configure.ac b/configure.ac index 09af7c4..e42949c 100644 --- a/configure.ac +++ b/configure.ac @@ -501,6 +501,10 @@ AS_IF([test "$WITH_LIBELF" = yes],[ # If possible we also want the strtab functions from elfutils 0.167. # But we can fall back on the (unsupported) ebl alternatives if not. AC_CHECK_LIB(dw, dwelf_strtab_init, [HAVE_LIBDW_STRTAB=yes]) + # whether libdw supports compressed ELF objects + AC_CHECK_LIB(dw, dwelf_elf_begin, [ + AC_DEFINE(HAVE_DWELF_ELF_BEGIN, 1, [Have dwelf_elf_begin?]) + ]) ]) ]) ])