public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-6210] libgcc: Use _dl_find_object in _Unwind_Find_FDE
@ 2022-01-04 14:48 Florian Weimer
  0 siblings, 0 replies; only message in thread
From: Florian Weimer @ 2022-01-04 14:48 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:790854ea7670f11c14d431c102a49181d2915965

commit r12-6210-g790854ea7670f11c14d431c102a49181d2915965
Author: Florian Weimer <fweimer@redhat.com>
Date:   Tue Jan 4 15:47:30 2022 +0100

    libgcc: Use _dl_find_object in _Unwind_Find_FDE
    
    libgcc/ChangeLog:
    
            * unwind-dw2-fde-dip.c (_Unwind_Find_FDE): Call _dl_find_object
            if available.

Diff:
---
 libgcc/unwind-dw2-fde-dip.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/libgcc/unwind-dw2-fde-dip.c b/libgcc/unwind-dw2-fde-dip.c
index b8da2a51e9e..7de847cb120 100644
--- a/libgcc/unwind-dw2-fde-dip.c
+++ b/libgcc/unwind-dw2-fde-dip.c
@@ -504,6 +504,24 @@ _Unwind_Find_FDE (void *pc, struct dwarf_eh_bases *bases)
   if (ret != NULL)
     return ret;
 
+  /* Use DLFO_STRUCT_HAS_EH_DBASE as a proxy for the existence of a glibc-style
+     _dl_find_object function.  */
+#ifdef DLFO_STRUCT_HAS_EH_DBASE
+  {
+    struct dl_find_object dlfo;
+    if (_dl_find_object (pc, &dlfo) == 0)
+      return find_fde_tail ((_Unwind_Ptr) pc, dlfo.dlfo_eh_frame,
+# if DLFO_STRUCT_HAS_EH_DBASE
+			    (_Unwind_Ptr) dlfo.dlfo_eh_dbase,
+# else
+			    NULL,
+# endif
+			    bases);
+    else
+      return NULL;
+    }
+#endif /* DLFO_STRUCT_HAS_EH_DBASE */
+
   data.pc = (_Unwind_Ptr) pc;
 #if NEED_DBASE_MEMBER
   data.dbase = NULL;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-04 14:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-04 14:48 [gcc r12-6210] libgcc: Use _dl_find_object in _Unwind_Find_FDE Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).