[libunwind] [libunwind] Fix EH frame handling on illumos. (PR #176988)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 21 10:17:44 PST 2026


================
@@ -424,7 +424,13 @@ static bool checkAddrInSegment(const Elf_Phdr *phdr, size_t image_base,
 static bool checkForUnwindInfoSegment(const Elf_Phdr *phdr, size_t image_base,
                                       dl_iterate_cb_data *cbdata) {
 #if defined(_LIBUNWIND_SUPPORT_DWARF_INDEX)
+#if defined(PT_SUNW_EH_FRAME) && defined(PT_SUNW_UNWIND)
+  // illumos/Solaris use PT_SUNW_EH_FRAME and PT_SUNW_UNWIND instead of PT_GNU_EH_FRAME.
+  // FreeBSD defines PT_SUNW_UNWIND but not PT_SUNW_EH_FRAME, so check for both.
----------------
MaskRay wrote:

I believe major BSD, including FreeBSD, all use `PT_GNU_EH_FRAME`. The comment should be removed.

I think you just need to check one constant. PT_SUNW_EH_FRAME
(PT_SUNW_UNWIND, if defined, has the same value)

https://github.com/llvm/llvm-project/pull/176988


More information about the cfe-commits mailing list