This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [2/5][AArch64] Generate dwarf information for -msign-return-address
- From: Jiong Wang <jiong dot wang at foss dot arm dot com>
- To: "Richard Earnshaw (lists)" <Richard dot Earnshaw at arm dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Cc: James Greenhalgh <james dot greenhalgh at arm dot com>
- Date: Fri, 13 Jan 2017 18:02:36 +0000
- Subject: Re: [2/5][AArch64] Generate dwarf information for -msign-return-address
- Authentication-results: sourceware.org; auth=none
- References: <c9da17a6-c3de-4466-c023-4e4ddbe38efb@foss.arm.com> <4cf21d03-0a88-c6fa-df37-59ec4edf1d89@foss.arm.com> <ac547390-abfc-3d6a-f10b-dbb9e4bad5b2@foss.arm.com> <ae7c1f2a-06e4-55d1-d3be-e43ae7ec76df@foss.arm.com> <60457276-8566-8bef-6073-4b00dd975759@foss.arm.com> <2718d6de-4571-694b-3eeb-90b7b839a867@foss.arm.com> <4df3fc1f-bf5c-b5a5-d372-0b41fb377700@foss.arm.com> <887c9a40-3b8f-2c97-dd0c-c87c1d569abb@arm.com>
On 13/01/17 16:09, Richard Earnshaw (lists) wrote:
On 06/01/17 11:47, Jiong Wang wrote:
This patch is an update on DWARF generation for return address signing.
According to new proposal, we simply needs to generate REG_CFA_WINDOW_SAVE
annotation.
gcc/
2017-01-06 Jiong Wang <jiong.wang@arm.com>
* config/aarch64/aarch64.c (aarch64_expand_prologue): Generate
dwarf
annotation (REG_CFA_WINDOW_SAVE) for return address signing.
(aarch64_expand_epilogue): Likewise.
I don't think we should be overloading REG_CFA_WINDOW_SAVE internally in
the compiler -- it's one thing to do it in the dwarf output tables, but
quite another to be doing it elsewhere in the compiler.
Instead we should create a new reg note kind and use that, but in the
final dwarf output then emit the overloaded opcode.
I can see the reason for doing this is if you want to seperate the interpretion
of GCC CFA reg-note and the final DWARF CFA operation. My understanding is all
reg notes defined in gcc/reg-note.def should have general meaning, even the
CFA_WINDOW_SAVE. For those which are architecture specific we might need a
mechanism to define them in backend only.
For general reg-notes in gcc/reg-note.def, they are not always have the
corresponding standard DWARF CFA operation, for example CFA_WINDOW_SAVE,
therefore if we want to achieve what you described, I think we also need to
define a new target hook which maps a GCC CFA reg-note into architecture DWARF
CFA operation.
Regards,
Jiong