From: Jonathan Wakely <jwakely@redhat.com>
To: Kyrill Tkachov <kyrylo.tkachov@foss.arm.com>
Cc: Christophe Lyon <christophe.lyon@st.com>,
"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
libstdc++@gcc.gnu.org, ian@airs.com
Subject: Re: [ARM/FDPIC v5 06/21] [ARM] FDPIC: Add support for c++ exceptions
Date: Fri, 30 Aug 2019 14:44:00 -0000 [thread overview]
Message-ID: <20190830143234.GN9487@redhat.com> (raw)
In-Reply-To: <597c97c0-16a5-f886-3d1a-8e2f0b089259@foss.arm.com>
On 30/08/19 10:02 +0100, Kyrill Tkachov wrote:
>As Richard mentioned in an earlier post the generic libgcc and
>libstdc++ changes will need approval from the relevant maintainers.
>
>CC'ing the libstdc++ list and the libgcc maintainer.
The libstdc++ change is OK for trunk.
>On 5/15/19 1:39 PM, Christophe Lyon wrote:
>>The main difference with existing support is that function addresses
>>are function descriptor addresses instead. This means that all code
>>dealing with function pointers now has to cope with function
>>descriptors instead.
>>
>>For the same reason, Linux kernel helpers can no longer be called by
>>dereferencing their address, so we implement wrappers that directly
>>call the kernel helpers.
>>
>>When restoring a function address, we also have to restore the FDPIC
>>register value (r9).
>>
>>2019-XX-XX Christophe Lyon <christophe.lyon@st.com>
>>       Mickaël Guêné <mickael.guene@st.com>
>>
>>Â Â Â Â Â Â Â gcc/
>>Â Â Â Â Â Â Â * ginclude/unwind-arm-common.h (unwinder_cache): Add reserved5
>>Â Â Â Â Â Â Â field.
>>Â Â Â Â Â Â Â (FDPIC_REGNUM): New define.
>>
>>Â Â Â Â Â Â Â libgcc/
>>Â Â Â Â Â Â Â * config/arm/linux-atomic.c (__kernel_cmpxchg): Add FDPIC support.
>>Â Â Â Â Â Â Â (__kernel_dmb): Likewise.
>>Â Â Â Â Â Â Â (__fdpic_cmpxchg): New function.
>>Â Â Â Â Â Â Â (__fdpic_dmb): New function.
>>Â Â Â Â Â Â Â * config/arm/unwind-arm.h (FDPIC_REGNUM): New define.
>>Â Â Â Â Â Â Â (gnu_Unwind_Find_got): New function.
>>Â Â Â Â Â Â Â (_Unwind_decode_typeinfo_ptr): Add FDPIC support.
>>Â Â Â Â Â Â Â * unwind-arm-common.inc (UCB_PR_GOT): New.
>>Â Â Â Â Â Â Â (funcdesc_t): New struct.
>>Â Â Â Â Â Â Â (get_eit_entry): Add FDPIC support.
>>Â Â Â Â Â Â Â (unwind_phase2): Likewise.
>>Â Â Â Â Â Â Â (unwind_phase2_forced): Likewise.
>>Â Â Â Â Â Â Â (__gnu_Unwind_RaiseException): Likewise.
>>Â Â Â Â Â Â Â (__gnu_Unwind_Resume): Likewise.
>>Â Â Â Â Â Â Â (__gnu_Unwind_Backtrace): Likewise.
>>Â Â Â Â Â Â Â * unwind-pe.h (read_encoded_value_with_base): Likewise.
>>
>>Â Â Â Â Â Â Â libstdc++/
>>Â Â Â Â Â Â Â * libsupc++/eh_personality.cc (get_ttype_entry): Add FDPIC
>>Â Â Â Â Â Â Â support.
>>
>>Change-Id: I64b81cfaf390a05f2fd121f44ba1912cb4b47cae
>>
>>diff --git a/gcc/ginclude/unwind-arm-common.h
>>b/gcc/ginclude/unwind-arm-common.h
>>index 6df783e..d4eb03e 100644
>>--- a/gcc/ginclude/unwind-arm-common.h
>>+++ b/gcc/ginclude/unwind-arm-common.h
>>@@ -91,7 +91,7 @@ extern "C" {
>>Â Â Â Â Â Â Â Â Â Â _uw reserved2;Â /* Personality routine address */
>>Â Â Â Â Â Â Â Â Â Â _uw reserved3;Â /* Saved callsite address */
>>Â Â Â Â Â Â Â Â Â Â _uw reserved4;Â /* Forced unwind stop arg */
>>-Â Â Â Â Â Â Â Â _uw reserved5;
>>+Â Â Â Â Â Â Â Â _uw reserved5;Â /* Personality routine GOT value in FDPIC
>>mode. */
>>Â Â Â Â Â Â Â Â }
>>Â Â Â Â Â Â unwinder_cache;
>>Â Â Â Â Â Â /* Propagation barrier cache (valid after phase 1): */
>>diff --git a/libgcc/config/arm/linux-atomic.c
>>b/libgcc/config/arm/linux-atomic.c
>>index 06a6d46..565f829 100644
>>--- a/libgcc/config/arm/linux-atomic.c
>>+++ b/libgcc/config/arm/linux-atomic.c
>>@@ -25,11 +25,62 @@ see the files COPYING3 and COPYING.RUNTIME
>>respectively. If not, see
>>
>> /* Kernel helper for compare-and-exchange. */
>>Â typedef int (__kernel_cmpxchg_t) (int oldval, int newval, int *ptr);
>>-#define __kernel_cmpxchg (*(__kernel_cmpxchg_t *) 0xffff0fc0)
>>+
>>+#define STR(X) #X
>>+#define XSTR(X) STR(X)
>>+
>>+#define KERNEL_CMPXCHG 0xffff0fc0
>>+
>>+#if __FDPIC__
>>+/* Non-FDPIC ABIs call __kernel_cmpxchg directly by dereferencing its
>>+Â Â address, but under FDPIC we would generate a broken call
>>+Â Â sequence. That's why we have to implement __kernel_cmpxchg and
>>+  __kernel_dmb here: this way, the FDPIC call sequence works. */
>>+#define __kernel_cmpxchg __fdpic_cmpxchg
>>+#else
>>+#define __kernel_cmpxchg (*(__kernel_cmpxchg_t *) KERNEL_CMPXCHG)
>>+#endif
>>
>> /* Kernel helper for memory barrier. */
>>Â typedef void (__kernel_dmb_t) (void);
>>-#define __kernel_dmb (*(__kernel_dmb_t *) 0xffff0fa0)
>>+
>>+#define KERNEL_DMB 0xffff0fa0
>>+
>>+#if __FDPIC__
>>+#define __kernel_dmb __fdpic_dmb
>>+#else
>>+#define __kernel_dmb (*(__kernel_dmb_t *) KERNEL_DMB)
>>+#endif
>>+
>>+#if __FDPIC__
>>+static int __fdpic_cmpxchg (int oldval, int newval, int *ptr)
>>+{
>>+Â int result;
>>+
>>+Â asm volatile (
>>+              "ldr   ip, 1f\n\t"
>>+              "bx    ip\n\t"
>>+Â Â Â Â Â Â Â Â Â Â Â Â Â Â "1:\n\t"
>>+Â Â Â Â Â Â Â Â Â Â Â Â Â Â ".word " XSTR(KERNEL_CMPXCHG) "\n\t"
>>+Â Â Â Â Â Â Â Â Â Â Â Â Â Â : "=r" (result)
>>+Â Â Â Â Â Â Â Â Â Â Â Â Â Â : "r" (oldval) , "r" (newval), "r" (ptr)
>>+Â Â Â Â Â Â Â Â Â Â Â Â Â Â : "r3", "memory");
>>+Â /* The result is actually returned by the kernel helper, we need
>>+    this to avoid a warning. */
>>+Â return result;
>>+}
>>+
>>+static void __fdpic_dmb (void)
>>+{
>>+Â asm volatile (
>>+              "ldr   ip, 1f\n\t"
>>+              "bx    ip\n\t"
>>+Â Â Â Â Â Â Â Â Â Â Â Â Â Â "1:\n\t"
>>+Â Â Â Â Â Â Â Â Â Â Â Â Â Â ".word " XSTR(KERNEL_DMB) "\n\t"
>>+Â Â Â Â Â Â Â Â Â Â Â Â Â Â );
>>+}
>>+
>>+#endif
>>
>>Â /* Note: we implement byte, short and int versions of atomic
>>operations using
>>Â Â Â the above kernel helpers; see linux-atomic-64bit.c for "long
>>long" (64-bit)
>>diff --git a/libgcc/config/arm/unwind-arm.h
>>b/libgcc/config/arm/unwind-arm.h
>>index 43c5379..2bf320a 100644
>>--- a/libgcc/config/arm/unwind-arm.h
>>+++ b/libgcc/config/arm/unwind-arm.h
>>@@ -33,9 +33,33 @@
>> /* Use IP as a scratch register within the personality routine. */
>>Â #define UNWIND_POINTER_REG 12
>>
>>+#define FDPIC_REGNUM 9
>>+
>>+#define STR(x) #x
>>+#define XSTR(x) STR(x)
>>+
>>Â #ifdef __cplusplus
>>Â extern "C" {
>>Â #endif
>>+_Unwind_Ptr __attribute__((weak)) __gnu_Unwind_Find_got (_Unwind_Ptr);
>>+
>>+static inline _Unwind_Ptr gnu_Unwind_Find_got (_Unwind_Ptr ptr)
>>+{
>>+Â Â Â _Unwind_Ptr res;
>>+
>>+Â Â Â if (__gnu_Unwind_Find_got)
>>+Â Â Â Â Â Â res =Â __gnu_Unwind_Find_got (ptr);
>>+Â Â Â else
>>+Â Â Â Â Â {
>>+Â Â Â Â Â Â asm volatile ("mov %[result], r" XSTR(FDPIC_REGNUM)
>>+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â : [result]"=r" (res)
>>+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â :
>>+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â :);
>>+Â Â Â Â Â }
>>+
>>+Â Â Â return res;
>>+}
>>+
>>  /* Decode an R_ARM_TARGET2 relocation. */
>>Â Â static inline _Unwind_Word
>>Â Â _Unwind_decode_typeinfo_ptr (_Unwind_Word base __attribute__
>>((unused)),
>>@@ -48,7 +72,12 @@ extern "C" {
>>Â Â Â Â Â Â if (!tmp)
>>Â Â Â Â Â Â Â Â return 0;
>>
>>-#if (defined(linux) && !defined(__uClinux__)) || defined(__NetBSD__) \
>>+#if __FDPIC__
>>+Â Â Â Â Â /* For FDPIC, we store the offset of the GOT entry. */
>>+Â Â Â Â Â /* So, first get GOT from dynamic linker and then use
>>indirect access. */
>>+Â Â Â Â Â tmp += gnu_Unwind_Find_got (ptr);
>>+Â Â Â Â Â tmp = *(_Unwind_Word *) tmp;
>>+#elif (defined(linux) && !defined(__uClinux__)) || defined(__NetBSD__) \
>>Â Â Â Â || defined(__FreeBSD__) || defined(__fuchsia__)
>>      /* Pc-relative indirect. */
>>Â #define _GLIBCXX_OVERRIDE_TTYPE_ENCODING (DW_EH_PE_pcrel |
>>DW_EH_PE_indirect)
>>diff --git a/libgcc/unwind-arm-common.inc b/libgcc/unwind-arm-common.inc
>>index fd572fe..0bacc11 100644
>>--- a/libgcc/unwind-arm-common.inc
>>+++ b/libgcc/unwind-arm-common.inc
>>@@ -62,6 +62,7 @@ __gnu_Unwind_Find_exidx (_Unwind_Ptr, int *);
>>Â #define UCB_PR_ADDR(ucbp) ((ucbp)->unwinder_cache.reserved2)
>>Â #define UCB_SAVED_CALLSITE_ADDR(ucbp) ((ucbp)->unwinder_cache.reserved3)
>>Â #define UCB_FORCED_STOP_ARG(ucbp) ((ucbp)->unwinder_cache.reserved4)
>>+#define UCB_PR_GOT(ucbp) ((ucbp)->unwinder_cache.reserved5)
>>
>> /* Unwind descriptors. */
>>
>>@@ -85,6 +86,16 @@ typedef struct __EIT_entry
>>Â Â _uw content;
>>Â } __EIT_entry;
>>
>>+#ifdef __FDPIC__
>>+
>>+/* Only used in FDPIC case. */
>>+struct funcdesc_t
>>+{
>>+Â unsigned int ptr;
>>+Â unsigned int got;
>>+};
>>+#endif
>>+
>> /* Assembly helper functions. */
>>
>> /* Restore core register state. Never returns. */
>>@@ -259,7 +270,21 @@ get_eit_entry (_Unwind_Control_Block *ucbp, _uw
>>return_address)
>>Â Â Â Â {
>>      /* One of the predefined standard routines. */
>>Â Â Â Â Â Â _uw idx = (*(_uw *) ucbp->pr_cache.ehtp >> 24) & 0xf;
>>+#if __FDPIC__
>>+Â Â Â Â Â {
>>+Â Â Â Â Â Â struct funcdesc_t *funcdesc
>>+Â Â Â Â Â Â Â Â = (struct funcdesc_t *) __gnu_unwind_get_pr_addr (idx);
>>+Â Â Â Â Â Â if (funcdesc)
>>+Â Â Â Â Â Â Â Â {
>>+Â Â Â Â Â Â Â Â Â Â UCB_PR_ADDR (ucbp) = funcdesc->ptr;
>>+Â Â Â Â Â Â Â Â Â Â UCB_PR_GOT (ucbp) = funcdesc->got;
>>+Â Â Â Â Â Â Â Â }
>>+Â Â Â Â Â Â else
>>+Â Â Â Â Â Â Â Â UCB_PR_ADDR (ucbp) = 0;
>>+Â Â Â Â Â }
>>+#else
>>Â Â Â Â Â Â UCB_PR_ADDR (ucbp) = __gnu_unwind_get_pr_addr (idx);
>>+#endif
>>Â Â Â Â Â Â if (UCB_PR_ADDR (ucbp) == 0)
>>Â Â Â Â Â Â Â Â {
>>Â Â Â Â Â Â Â Â Â Â /* Failed */
>>@@ -270,6 +295,10 @@ get_eit_entry (_Unwind_Control_Block *ucbp, _uw
>>return_address)
>>Â Â Â Â {
>>Â Â Â Â Â Â /* Execute region offset to PR */
>>Â Â Â Â Â Â UCB_PR_ADDR (ucbp) = selfrel_offset31 (ucbp->pr_cache.ehtp);
>>+#if __FDPIC__
>>+Â Â Â Â Â UCB_PR_GOT (ucbp)
>>+Â Â Â Â Â Â = (unsigned int) gnu_Unwind_Find_got ((_Unwind_Ptr)
>>UCB_PR_ADDR (ucbp));
>>+#endif
>>Â Â Â Â }
>>Â Â return _URC_OK;
>>Â }
>>@@ -291,14 +320,29 @@ unwind_phase2 (_Unwind_Control_Block * ucbp,
>>phase2_vrs * vrs)
>>Â Â Â Â Â Â UCB_SAVED_CALLSITE_ADDR (ucbp) = VRS_PC(vrs);
>>
>>      /* Call the pr to decide what to do. */
>>+#if __FDPIC__
>>+Â Â Â Â Â {
>>+Â Â Â Â Â Â volatile struct funcdesc_t funcdesc;
>>+Â Â Â Â Â Â funcdesc.ptr = UCB_PR_ADDR (ucbp);
>>+Â Â Â Â Â Â funcdesc.got = UCB_PR_GOT (ucbp);
>>+Â Â Â Â Â Â pr_result = ((personality_routine) &funcdesc)
>>+Â Â Â Â Â Â Â Â (_US_UNWIND_FRAME_STARTING, ucbp, (_Unwind_Context *) vrs);
>>+Â Â Â Â Â }
>>+#else
>>Â Â Â Â Â Â pr_result = ((personality_routine) UCB_PR_ADDR (ucbp))
>>Â Â Â Â Â Â Â Â (_US_UNWIND_FRAME_STARTING, ucbp, (_Unwind_Context *) vrs);
>>+#endif
>>Â Â Â Â }
>>Â Â while (pr_result == _URC_CONTINUE_UNWIND);
>>
>>Â Â if (pr_result != _URC_INSTALL_CONTEXT)
>>Â Â Â Â abort();
>>
>>+#if __FDPIC__
>>+ /* r9 could have been lost due to PLT jump. Restore correct value. */
>>+Â vrs->core.r[FDPIC_REGNUM] = gnu_Unwind_Find_got (VRS_PC (vrs));
>>+#endif
>>+
>>Â Â uw_restore_core_regs (vrs, &vrs->core);
>>Â }
>>
>>@@ -346,8 +390,18 @@ unwind_phase2_forced (_Unwind_Control_Block
>>*ucbp, phase2_vrs *entry_vrs,
>>Â Â Â Â Â Â Â Â Â Â next_vrs = saved_vrs;
>>
>>          /* Call the pr to decide what to do. */
>>+#if __FDPIC__
>>+Â Â Â Â Â Â Â Â {
>>+Â Â Â Â Â Â Â Â Â Â volatile struct funcdesc_t funcdesc;
>>+Â Â Â Â Â Â Â Â Â Â funcdesc.ptr = UCB_PR_ADDR (ucbp);
>>+Â Â Â Â Â Â Â Â Â Â funcdesc.got = UCB_PR_GOT (ucbp);
>>+Â Â Â Â Â Â Â Â Â Â pr_result = ((personality_routine) &funcdesc)
>>+Â Â Â Â Â Â Â Â Â Â Â Â (action, ucbp, (void *) &next_vrs);
>>+Â Â Â Â Â Â Â Â }
>>+#else
>>Â Â Â Â Â Â Â Â Â Â pr_result = ((personality_routine) UCB_PR_ADDR (ucbp))
>>Â Â Â Â Â Â Â Â Â Â Â Â (action, ucbp, (void *) &next_vrs);
>>+#endif
>>
>>Â Â Â Â Â Â Â Â Â Â saved_vrs.prev_sp = VRS_SP (&next_vrs);
>>Â Â Â Â Â Â Â Â }
>>@@ -384,6 +438,11 @@ unwind_phase2_forced (_Unwind_Control_Block
>>*ucbp, phase2_vrs *entry_vrs,
>>Â Â Â Â Â Â return _URC_FAILURE;
>>Â Â Â Â }
>>
>>+#if __FDPIC__
>>+ /* r9 could have been lost due to PLT jump. Restore correct value. */
>>+Â saved_vrs.core.r[FDPIC_REGNUM] = gnu_Unwind_Find_got (VRS_PC
>>(&saved_vrs));
>>+#endif
>>+
>>Â Â uw_restore_core_regs (&saved_vrs, &saved_vrs.core);
>>Â }
>>
>>@@ -429,8 +488,18 @@ __gnu_Unwind_RaiseException
>>(_Unwind_Control_Block * ucbp,
>>Â Â Â Â Â Â Â Â return _URC_FAILURE;
>>
>>      /* Call the pr to decide what to do. */
>>+#if __FDPIC__
>>+Â Â Â Â Â {
>>+Â Â Â Â Â Â volatile struct funcdesc_t funcdesc;
>>+Â Â Â Â Â Â funcdesc.ptr = UCB_PR_ADDR (ucbp);
>>+Â Â Â Â Â Â funcdesc.got = UCB_PR_GOT (ucbp);
>>+Â Â Â Â Â Â pr_result = ((personality_routine) &funcdesc)
>>+Â Â Â Â Â Â Â Â (_US_VIRTUAL_UNWIND_FRAME, ucbp, (void *) &saved_vrs);
>>+Â Â Â Â Â }
>>+#else
>>Â Â Â Â Â Â pr_result = ((personality_routine) UCB_PR_ADDR (ucbp))
>>Â Â Â Â Â Â Â Â (_US_VIRTUAL_UNWIND_FRAME, ucbp, (void *) &saved_vrs);
>>+#endif
>>Â Â Â Â }
>>Â Â while (pr_result == _URC_CONTINUE_UNWIND);
>>
>>@@ -488,13 +557,27 @@ __gnu_Unwind_Resume (_Unwind_Control_Block *
>>ucbp, phase2_vrs * entry_vrs)
>>Â Â Â Â }
>>
>>  /* Call the cached PR. */
>>+#if __FDPIC__
>>+Â {
>>+Â Â Â volatile struct funcdesc_t funcdesc;
>>+Â Â Â funcdesc.ptr = UCB_PR_ADDR (ucbp);
>>+Â Â Â funcdesc.got = UCB_PR_GOT (ucbp);
>>+Â Â Â pr_result = ((personality_routine) &funcdesc)
>>+Â Â Â Â Â (_US_UNWIND_FRAME_RESUME, ucbp, (_Unwind_Context *) entry_vrs);
>>+Â }
>>+#else
>>Â Â pr_result = ((personality_routine) UCB_PR_ADDR (ucbp))
>>Â Â Â Â Â Â Â Â (_US_UNWIND_FRAME_RESUME, ucbp, (_Unwind_Context *) entry_vrs);
>>+#endif
>>
>>Â Â switch (pr_result)
>>Â Â Â Â {
>>Â Â Â Â case _URC_INSTALL_CONTEXT:
>>      /* Upload the registers to enter the landing pad. */
>>+#if __FDPIC__
>>+     /* r9 could have been lost due to PLT jump. Restore correct
>>value. */
>>+Â Â Â Â Â entry_vrs->core.r[FDPIC_REGNUM] = gnu_Unwind_Find_got (VRS_PC
>>(entry_vrs));
>>+#endif
>>Â Â Â Â Â Â uw_restore_core_regs (entry_vrs, &entry_vrs->core);
>>
>>Â Â Â Â case _URC_CONTINUE_UNWIND:
>>@@ -586,9 +669,20 @@ __gnu_Unwind_Backtrace(_Unwind_Trace_Fn trace,
>>void * trace_argument,
>>Â Â Â Â Â Â Â Â }
>>
>>      /* Call the pr to decide what to do. */
>>+#if __FDPIC__
>>+Â Â Â Â Â {
>>+Â Â Â Â Â Â volatile struct funcdesc_t funcdesc;
>>+Â Â Â Â Â Â funcdesc.ptr = UCB_PR_ADDR (ucbp);
>>+Â Â Â Â Â Â funcdesc.got = UCB_PR_GOT (ucbp);
>>+Â Â Â Â Â Â code = ((personality_routine) &funcdesc)
>>+Â Â Â Â Â Â Â Â (_US_VIRTUAL_UNWIND_FRAME | _US_FORCE_UNWIND,
>>+Â Â Â Â Â Â Â Â Â ucbp, (void *) &saved_vrs);
>>+Â Â Â Â Â }
>>+#else
>>Â Â Â Â Â Â code = ((personality_routine) UCB_PR_ADDR (ucbp))
>>Â Â Â Â Â Â Â Â (_US_VIRTUAL_UNWIND_FRAME | _US_FORCE_UNWIND,
>>Â Â Â Â Â Â Â Â Â ucbp, (void *) &saved_vrs);
>>+#endif
>>Â Â Â Â }
>>Â Â while (code != _URC_END_OF_STACK
>>Â Â Â Â Â Â Â Â Â && code != _URC_FAILURE);
>>diff --git a/libgcc/unwind-pe.h b/libgcc/unwind-pe.h
>>index 4ed1c66..1c9dae5 100644
>>--- a/libgcc/unwind-pe.h
>>+++ b/libgcc/unwind-pe.h
>>@@ -262,10 +262,27 @@ read_encoded_value_with_base (unsigned char
>>encoding, _Unwind_Ptr base,
>>
>>Â Â Â Â Â Â if (result != 0)
>>Â Â Â Â Â Â Â Â {
>>+#if __FDPIC__
>>+Â Â Â Â Â Â Â Â /* FDPIC relative addresses imply taking the GOT address
>>+           into account. */
>>+Â Â Â Â Â Â Â Â if ((encoding & DW_EH_PE_pcrel) && (encoding &
>>DW_EH_PE_indirect))
>>+Â Â Â Â Â Â Â Â Â Â {
>>+Â Â Â Â Â Â Â Â Â Â Â Â result += gnu_Unwind_Find_got ((_Unwind_Ptr) u);
>>+Â Â Â Â Â Â Â Â Â Â Â Â result = *(_Unwind_Internal_Ptr *) result;
>>+Â Â Â Â Â Â Â Â Â Â }
>>+Â Â Â Â Â Â Â Â else
>>+Â Â Â Â Â Â Â Â Â Â {
>>+Â Â Â Â Â Â Â Â Â Â Â Â result += ((encoding & 0x70) == DW_EH_PE_pcrel
>>+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ? (_Unwind_Internal_Ptr) u : base);
>>+Â Â Â Â Â Â Â Â Â Â Â Â if (encoding & DW_EH_PE_indirect)
>>+Â Â Â Â Â Â Â Â Â Â Â Â Â Â result = *(_Unwind_Internal_Ptr *) result;
>>+Â Â Â Â Â Â Â Â Â Â }
>>+#else
>>Â Â Â Â Â Â Â Â Â Â result += ((encoding & 0x70) == DW_EH_PE_pcrel
>>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ? (_Unwind_Internal_Ptr) u : base);
>>Â Â Â Â Â Â Â Â Â Â if (encoding & DW_EH_PE_indirect)
>>Â Â Â Â Â Â Â Â Â Â Â Â result = *(_Unwind_Internal_Ptr *) result;
>>+#endif
>>Â Â Â Â Â Â Â Â }
>>Â Â Â Â }
>>
>>diff --git a/libstdc++-v3/libsupc++/eh_personality.cc
>>b/libstdc++-v3/libsupc++/eh_personality.cc
>>index 35e4e46..1528ab9 100644
>>--- a/libstdc++-v3/libsupc++/eh_personality.cc
>>+++ b/libstdc++-v3/libsupc++/eh_personality.cc
>>@@ -93,7 +93,15 @@ get_ttype_entry (lsda_header_info *info, _uleb128_t i)
>>Â Â _Unwind_Ptr ptr;
>>
>>Â Â i *= size_of_encoded_value (info->ttype_encoding);
>>-Â read_encoded_value_with_base (info->ttype_encoding, info->ttype_base,
>>+Â read_encoded_value_with_base (
>>+#if __FDPIC__
>>+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â /* Force these flags to nake sure to
>>+                                 take the GOT into account. */
>>+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â (DW_EH_PE_pcrel | DW_EH_PE_indirect),
>>+#else
>>+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â info->ttype_encoding,
>>+#endif
>>+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â info->ttype_base,
>>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â info->TType - i, &ptr);
>>
>>Â Â return reinterpret_cast<const std::type_info *>(ptr);
>>--
>>2.6.3
>>
next prev parent reply other threads:[~2019-08-30 14:32 UTC|newest]
Thread overview: 109+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-15 12:40 [ARM/FDPIC v5 00/21] FDPIC ABI for ARM Christophe Lyon
2019-05-15 12:40 ` [ARM/FDPIC v5 01/21] [ARM] FDPIC: Add -mfdpic option support Christophe Lyon
2019-07-16 10:18 ` Richard Sandiford
2019-08-29 15:08 ` Christophe Lyon
2019-08-30 10:06 ` Richard Sandiford
2019-05-15 12:41 ` [ARM/FDPIC v5 05/21] [ARM] FDPIC: Fix __do_global_dtors_aux and frame_dummy generation Christophe Lyon
2019-07-12 6:49 ` Richard Sandiford
2019-07-12 14:25 ` Christophe Lyon
2019-08-29 15:39 ` Christophe Lyon
2019-08-30 8:41 ` Richard Sandiford
2019-05-15 12:41 ` [ARM/FDPIC v5 02/21] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in configure scripts Christophe Lyon
2019-07-12 7:44 ` Richard Sandiford
2019-07-12 13:25 ` Christophe Lyon
2019-07-12 13:28 ` Richard Sandiford
2019-08-29 15:14 ` Christophe Lyon
2019-08-30 9:30 ` Richard Sandiford
2019-08-30 14:48 ` Christophe Lyon
2019-08-30 15:15 ` Richard Sandiford
2019-09-02 7:51 ` Christophe Lyon
2019-09-02 8:31 ` Richard Sandiford
2019-08-30 14:40 ` Jonathan Wakely
2019-05-15 12:41 ` [ARM/FDPIC v5 03/21] [ARM] FDPIC: Force FDPIC related options unless -mno-fdpic is provided Christophe Lyon
2019-05-15 13:55 ` Szabolcs Nagy
2019-05-15 14:37 ` Rich Felker
2019-05-15 15:12 ` Christophe Lyon
2019-05-15 15:37 ` Rich Felker
2019-05-15 15:59 ` Szabolcs Nagy
2019-05-15 16:07 ` Rich Felker
2019-05-21 15:29 ` Christophe Lyon
2019-05-21 15:48 ` Rich Felker
2019-05-22 8:39 ` Szabolcs Nagy
2019-05-22 8:45 ` Christophe Lyon
2019-05-23 12:45 ` Christophe Lyon
2019-07-16 10:38 ` Richard Sandiford
2019-07-16 20:00 ` Rich Felker
2019-08-01 10:13 ` Christophe Lyon
2019-08-06 14:28 ` Richard Sandiford
2019-08-29 15:14 ` Christophe Lyon
2019-08-30 9:40 ` Richard Sandiford
2019-05-15 12:41 ` [ARM/FDPIC v5 04/21] [ARM] FDPIC: Add support for FDPIC for arm architecture Christophe Lyon
2019-07-16 12:33 ` Richard Sandiford
2019-08-20 17:13 ` Christophe Lyon
2019-08-29 15:39 ` Christophe Lyon
2019-09-02 16:12 ` Richard Sandiford
2019-09-02 20:04 ` Christophe Lyon
2019-09-03 8:40 ` Richard Sandiford
2019-09-04 19:59 ` Christophe Lyon
2019-09-05 8:03 ` Richard Sandiford
2019-05-15 12:42 ` [ARM/FDPIC v5 06/21] [ARM] FDPIC: Add support for c++ exceptions Christophe Lyon
2019-08-30 9:31 ` Kyrill Tkachov
2019-08-30 14:44 ` Jonathan Wakely [this message]
2019-05-15 12:42 ` [ARM/FDPIC v5 07/21] [ARM] FDPIC: Avoid saving/restoring r9 on stack since it is read-only Christophe Lyon
2019-07-16 10:42 ` Kyrill Tkachov
2019-05-15 12:43 ` [ARM/FDPIC v5 09/21] [ARM] FDPIC: Add support for taking address of nested function Christophe Lyon
2019-07-16 11:53 ` Kyrill Tkachov
2019-07-16 13:31 ` Kyrill Tkachov
2019-07-31 14:48 ` Christophe Lyon
2019-08-29 15:40 ` Christophe Lyon
2019-08-30 8:54 ` Kyrill Tkachov
2019-05-15 12:43 ` [ARM/FDPIC v5 10/21] [ARM] FDPIC: Implement TLS support Christophe Lyon
2019-09-04 14:16 ` Kyrill Tkachov
2019-09-04 20:03 ` Christophe Lyon
2019-09-09 8:54 ` Christophe Lyon
2019-05-15 12:43 ` [ARM/FDPIC v5 08/21] [ARM] FDPIC: Enforce local/global binding for function descriptors Christophe Lyon
2019-07-16 10:51 ` Kyrill Tkachov
2019-05-15 12:44 ` [ARM/FDPIC v5 13/21] [ARM] FDPIC: Force LSB bit for PC in Cortex-M architecture Christophe Lyon
2019-08-29 15:37 ` Kyrill Tkachov
2019-09-05 8:30 ` Christophe Lyon
2019-09-05 8:32 ` Christophe Lyon
2019-09-05 20:56 ` Ian Lance Taylor
2019-09-05 9:03 ` Kyrill Tkachov
2019-09-09 8:58 ` Christophe Lyon
2019-05-15 12:44 ` [ARM/FDPIC v5 12/21] [ARM] FDPIC: Restore r9 after we call __aeabi_read_tp Christophe Lyon
2019-08-29 15:40 ` Christophe Lyon
2019-08-29 15:44 ` Kyrill Tkachov
2019-05-15 12:44 ` [ARM/FDPIC v5 11/21] [ARM] FDPIC: Add support to unwind FDPIC signal frame Christophe Lyon
2019-09-04 14:19 ` Kyrill Tkachov
2019-05-15 12:45 ` [ARM/FDPIC v5 15/21] [ARM][testsuite] FDPIC: Adjust scan-assembler patterns Christophe Lyon
2019-07-19 8:54 ` Kyrill Tkachov
2019-05-15 12:45 ` [ARM/FDPIC v5 14/21] [ARM][testsuite] FDPIC: Skip unsupported tests Christophe Lyon
2019-07-19 8:52 ` Kyrill Tkachov
2019-05-15 12:45 ` [ARM/FDPIC v5 16/21] [ARM][testsuite] FDPIC: Skip tests that don't work in PIC mode Christophe Lyon
2019-07-19 8:56 ` Kyrill Tkachov
2019-05-15 12:46 ` [ARM/FDPIC v5 19/21] [ARM][testsuite] FDPIC: Adjust pr43698.c to avoid clash with uclibc Christophe Lyon
2019-07-19 9:00 ` Kyrill Tkachov
2019-05-15 12:46 ` [ARM/FDPIC v5 18/21] [ARM][testsuite] FDPIC: Enable tests on pie_enabled targets Christophe Lyon
2019-07-19 8:59 ` Kyrill Tkachov
2019-07-22 19:50 ` Mike Stump
2019-05-15 12:46 ` [ARM/FDPIC v5 17/21] [ARM][testsuite] FDPIC: Handle *-*-uclinux* Christophe Lyon
2019-07-19 8:57 ` Kyrill Tkachov
2019-07-22 19:37 ` Mike Stump
2019-05-15 12:47 ` [ARM/FDPIC v5 21/21] [ARM] FDPIC: Handle stack-protector combined patterns Christophe Lyon
2019-07-19 9:40 ` Kyrill Tkachov
2019-05-15 12:47 ` [ARM/FDPIC v5 20/21] [ARM][testsuite] FDPIC: Skip tests using architectures unsupported by FDPIC Christophe Lyon
2019-07-19 9:03 ` Kyrill Tkachov
2019-09-06 8:01 ` Christophe Lyon
2019-09-06 8:28 ` Kyrill Tkachov
2019-09-06 9:10 ` Christophe Lyon
2019-09-06 17:44 ` Christophe Lyon
2019-09-09 8:38 ` Christophe Lyon
2019-05-23 12:46 ` [ARM/FDPIC v5 00/21] FDPIC ABI for ARM Christophe Lyon
2019-06-04 12:57 ` Christophe Lyon
2019-06-06 12:36 ` Christophe Lyon
2019-06-17 11:42 ` Christophe Lyon
2019-07-01 12:16 ` Christophe Lyon
2019-07-08 14:28 ` Christophe Lyon
2019-07-16 9:13 ` Christophe Lyon
2019-08-29 14:54 ` Christophe Lyon
2019-08-29 16:29 ` Christophe Lyon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190830143234.GN9487@redhat.com \
--to=jwakely@redhat.com \
--cc=christophe.lyon@st.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=ian@airs.com \
--cc=kyrylo.tkachov@foss.arm.com \
--cc=libstdc++@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).