This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 1/3][GCC] Add new target hook asm_post_cfi_startproc
- From: Sam Tebbs <Sam dot Tebbs at arm dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>, "jakub at redhat dot com" <jakub at redhat dot com>, nd <nd at arm dot com>, "law at redhat dot com" <law at redhat dot com>, "jason at redhat dot com" <jason at redhat dot com>, "ccoutant at gmail dot com" <ccoutant at gmail dot com>
- Date: Mon, 5 Nov 2018 10:18:09 +0000
- Subject: Re: [PATCH 1/3][GCC] Add new target hook asm_post_cfi_startproc
- References: <1615d64d-7f42-a261-8041-281914712941@arm.com> <043bdf88-6e4b-33df-4772-2cc4ddffae98@arm.com> <alpine.LSU.2.20.1811050853030.1827@zhemvz.fhfr.qr>
On 11/05/2018 07:54 AM, Richard Biener wrote:
> On Fri, 2 Nov 2018, Sam Tebbs wrote:
>
>> On 11/02/2018 05:28 PM, Sam Tebbs wrote:
>>
>>> Hi all,
>>>
>>> This patch adds a new target hook called "asm_post_cfi_startproc". This hook is
>>> intended to be used by the aarch64 backend to emit a directive that enables
>>> support for unwinding frames signed with the pointer authentication B-key. This
>>> hook is triggered after the ".cfi_startproc" directive is emitted in
>>> gcc/dwarf2out.c.
>>>
>>> Bootstrapped on aarch64-none-linux-gnu and tested on aarch64-none-elf with no regressions.
>>>
>>> Ok for trunk?
> Can you explain why existing prologue/cfi emission points are not
> enough?
I couldn't find any target hooks that were triggered at the
assembly-printing level at the correct point in time (after
.cfi_startproc is emitted), please do point me to one if that is not the
case.
An alternative could have been to implement a new reg_note but that
would have meant adding target-specific code to target-agnostic files
and wouldn't have been as flexible.
Sam
>
>>> gcc/
>>> 2018-11-02 Sam Tebbs<sam.tebbs@arm.com>
>>>
>>> * doc/tm.texi (TARGET_ASM_POST_CFI_STARTPROC): Define.
>>> * doc/tm.texi.in (TARGET_ASM_POST_CFI_STARTPROC): Define.
>>> * dwarf2out.c (dwarf2out_do_cfi_startproc): Trigger the hook.
>>> * hooks.c (hook_void_FILEptr_tree): Define.
>>> * hooks.h (hook_void_FILEptr_tree): Define.
>>> * target.def (post_cfi_startproc): Define.
>> CCing global reviewers and dwarf maintainers.
>>
>>