So my diff that switched libunwind to use dl_unwind_find_exidx() was
incomplete.  I forgot that I had put its prototype in <dlfcn.h> and
missed that file when generating the diff.  However, <dlfcn.h> isn't
really the right place to put the prototype.  We have
dl_iterate_phdr() in <link_elf.h>, and dl_unwind_find_exidx() is
closely realted to that function.  In addition to that FreeBSD has it
there as well.  Well actually, they have <sys/link_elf.h>..  So that's
why I include <link.h> to get the prototype, which include
<link_elf.h> on OpenBSD and NetBSD and <sys/link_elf.h> on FreeBSD.

ok?


Index: include/link_elf.h
===================================================================
RCS file: /cvs/src/include/link_elf.h,v
retrieving revision 1.6
diff -u -p -r1.6 link_elf.h
--- include/link_elf.h  6 Feb 2006 16:51:50 -0000       1.6
+++ include/link_elf.h  20 Sep 2016 17:59:37 -0000
@@ -36,6 +36,7 @@ struct dl_phdr_info {
 __BEGIN_DECLS
 int    dl_iterate_phdr (int (*)(struct dl_phdr_info *, size_t, void *),
           void *);
+void   *dl_unwind_find_exidx(const void *, int *);
 __END_DECLS
 
 #endif /* !_LINK_ELF_H */
Index: lib/libunwind/src/AddressSpace.hpp
===================================================================
RCS file: /cvs/src/lib/libunwind/src/AddressSpace.hpp,v
retrieving revision 1.4
diff -u -p -r1.4 AddressSpace.hpp
--- lib/libunwind/src/AddressSpace.hpp  18 Sep 2016 11:18:28 -0000      1.4
+++ lib/libunwind/src/AddressSpace.hpp  20 Sep 2016 17:59:37 -0000
@@ -37,6 +37,7 @@ namespace libunwind {
 #if _LIBUNWIND_ARM_EHABI
 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
 
+#include <link.h>
 typedef void *_Unwind_Ptr;
 
 #elif defined(__linux__)

Reply via email to