[5/5][AArch64, libgcc] Runtime support for AArch64 DWARF operations
Jiong Wang
jiong.wang@foss.arm.com
Fri Jan 6 11:47:00 GMT 2017
On 11/11/16 18:22, Jiong Wang wrote:
> This patch add AArch64 specific runtime EH unwinding support for
> DW_OP_AARCH64_pauth, DW_OP_AARCH64_paciasp and DW_OP_AARCH64_paciasp_deref.
>
> The semantics of them are described at the specification in patch [1/9].
>
> The support includes:
> * Parsing these DWARF operations. Perform unwinding actions according to
> their semantics.
>
> * Handling eh_return multi return paths.
> Function calling __builtin_eh_return (_Unwind_RaiseException*) will have
> multiple return paths. One is for normal exit, the other is for install
> EH handler. If the _Unwind_RaiseException itself is return address signed,
> then there will always be return address authentication before return,
> however, if the return path in _Unwind_RaiseException if from installing EH
> handler the address of which has already been authenticated during
> unwinding, then we need to re-sign that address, so when the execution flow
> continues at _Unwind_RaiseException's epilogue, the authentication still
> works correctly.
>
>
> OK for trunk?
>
> libgcc/
> 2016-11-11 Jiong Wang<jiong.wang@arm.com>
>
> * config/aarch64/unwind-aarch64.c (RA_SIGN_BIT): New flag to indicate
> one frame is return address signed.
> (execute_stack_op): Handle DW_OP_AARCH64_pauth, DW_OP_AARCH64_paciasp,
> DW_OP_AARCH64_paciasp_deref.
> (uw_init_context): Call aarch64_uw_init_context_1.
> (uw_init_context_1): Rename to aarch64_uw_init_context_1. Strip
> signature for seed address.
> (uw_install_context): Re-sign handler's address so it works correctly
> with caller's context.
> (uw_install_context_1): by_value[LR] can be true, after return address
> signing LR will come from DWARF value expression rule which is a
> by_value true rule.
>
>
This is the update on libgcc unwinder support according to new DWARF proposal.
As Joseph commented, duplication of unwind-dw2.c is not encouraged in libgcc,
But from this patch, you can see there are a few places we need to modify for
AArch64 in unwind-aarch64.c, so the file duplication approach is acceptable?
libgcc/
2017-01-06 Jiong Wang <jiong.wang@arm.com>
* config/aarch64/unwind-aarch64.c (DWARF_REGNUM_AARCH64_RA_STATE,
RA_A_SIGNED_BIT): New macros.
(execute_cfa_program): Multiplex DW_CFA_GNU_window_save on AArch64.
(uw_frame_state_for): Clear bit[0] of DWARF_REGNUM_AARCH64_RA_STATE.
(uw_update_context): Authenticate return address according to
DWARF_REGNUM_AARCH64_RA_STATE.
(uw_init_context_1): Strip signature of seed address.
(uw_install_context): Re-authenticate EH handler's address.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 5.patch
Type: text/x-diff
Size: 5381 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20170106/8c8de32e/attachment.bin>
More information about the Gcc-patches
mailing list