https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109712

--- Comment #23 from Florian Weimer <fw at gcc dot gnu.org> ---
(In reply to Thomas Neumann from comment #21)
> It must be something more complex. value is small here (more precisely: 1888
> in the crashes later), which is not a valid pointer address. We probably
> have to add this to some base pointer? But it is not obvious to me to which
> one.

read_encoded_value_with_base has this:

          result += ((encoding & 0x70) == DW_EH_PE_pcrel
                     ? (_Unwind_Internal_Ptr) u : base);

u is the original read pointer as far as I can see. So it looks like it should
look like this:

diff --git a/libgcc/unwind-dw2-fde-dip.c b/libgcc/unwind-dw2-fde-dip.c
index 6223f5f18a2..5a6352227cc 100644
--- a/libgcc/unwind-dw2-fde-dip.c
+++ b/libgcc/unwind-dw2-fde-dip.c
@@ -403,8 +403,8 @@ find_fde_tail (_Unwind_Ptr pc,
         BFD ld generates.  */
       signed value __attribute__ ((mode (SI)));
       memcpy (&value, p, sizeof (value));
+      eh_frame = p + value
       p += sizeof (value);
-      dbase = value;           /* No adjustment because pcrel has base 0.  */
     }
   else
     p = read_encoded_value_with_base (hdr->eh_frame_ptr_enc,

Reply via email to