Skip to content
Browse files

on Solaris, use the system libelf.

  • Loading branch information...
1 parent 49ab3e0 commit 2ba434759480381e6bb6cc91b5a1461b221fb945 Wez Furlong committed Mar 24, 2012
Showing with 15 additions and 3 deletions.
  1. +9 −2 configure.ac
  2. +6 −1 libdwarf/dwarf_init.c
View
11 configure.ac
@@ -26,7 +26,15 @@ AC_CHECK_LIB(z, uncompress)
AC_CHECK_LIB(elf, gelf_getshdr, [],[
build_gelf=true
])
- build_gelf=true
+case $host in
+ *solaris*)
+ build_gelf=false
+ AC_CHECK_HEADERS([gelf.h])
+ ;;
+ *)
+ build_gelf=true
+ ;;
+esac
AM_CONDITIONAL([BUILD_ELF], [test "$build_gelf" = true])
AC_CHECK_LIB(dwarf, dwarf_elf_init, [], [
@@ -36,7 +44,6 @@ AM_CONDITIONAL([BUILD_DWARF], [test "$build_dwarf" = true])
AC_CHECK_LIB(pthread, pthread_create)
-#gelf.h \
AC_CHECK_HEADERS([ \
ctype.h \
dwarf.h \
View
7 libdwarf/dwarf_init.c
@@ -610,7 +610,12 @@ dwarf_elf_read(Dwarf_Debug dbg, Dwarf_Error *error)
}
/* Get the section index to the string table. */
- if (elf_getshdrstrndx(dbg->dbg_elf, &dbg->dbg_stnum) == -1) {
+#ifdef sun
+ i = elf_getshstrndx(dbg->dbg_elf, &dbg->dbg_stnum) == 0;
+#else
+ i = elf_getshdrstrndx(dbg->dbg_elf, &dbg->dbg_stnum) == -1;
+#endif
+ if (i) {
DWARF_SET_ELF_ERROR(error, elf_errno());
return DWARF_E_ELF;
}

0 comments on commit 2ba4347

Please sign in to comment.
Something went wrong with that request. Please try again.