Commits

Wez Furlong  committed f9dde10

on Solaris, use the system libelf.

  • Participants
  • Parent commits d548205

Comments (0)

Files changed (2)

File configure.ac

 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, [], [
 
 AC_CHECK_LIB(pthread, pthread_create)
 
-#gelf.h \
 AC_CHECK_HEADERS([ \
 ctype.h \
 dwarf.h \

File libdwarf/dwarf_init.c

 	}
 
 	/* 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;
 	}