Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Ivo Raisr <ivo.raisr@oracle.com>
To: GDB <gdb-patches@sourceware.org>
Cc: Jiong Wang <jiong.wang@foss.arm.com>
Subject: Re: [Patch] New gdbarch method "dwarf_cfa_op" and migrate SPARC to it
Date: Fri, 21 Apr 2017 20:45:00 -0000	[thread overview]
Message-ID: <edec7b0b-7f63-76f8-6546-d11c831e5058@oracle.com> (raw)
In-Reply-To: <d6197185-945d-d90b-6eb9-729fa6d3705b@foss.arm.com>



On 19.4.2017 12:17, Jiong Wang wrote:
> Hi,
>
> Recently a feature called "return address signing" has been added to GCC to
> prevent stack smash stack on AArch64.  For details please refer:
>
>   https://gcc.gnu.org/ml/gcc-patches/2017-01/msg00376.html
>
> GDB needs to be aware of this feature so it can restore the original return
> address which is critical for unwinding.
>
> On compiler side, whenever return address, i.e. LR register, is mangled or
> restored by hardware instruction, compiler is expected to generate a
> DW_CFA_GNU_window_save CFA instruction to toggle the LR signing status.
> DW_CFA_GNU_window_save was introduced by SPARC for their register window
> feature, here AArch64 want to multiplex this DWARF CFA instruction as
> it's in vendor space.  So, a new gdbarch method, dwarf_cfa_op, is introduced.

Are you sure to reuse DW_CFA_GNU_window_save for AArch64 purposes? 
Because semantics of DW_CFA_GNU_window_save (implied from "window save") 
mean much more than just fiddling with return address. For example as 
you learned from dwarf2-frame.c, whole register window needs to be copied.


>   SPARC-linux cross gdb build OK.

I have built gdb on sparc64-linux with your changes and no new 
regressions are introduced in the test suite. So the patch is ok w.r.t. 
this.

I.


  reply	other threads:[~2017-04-21 20:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-19 10:17 Jiong Wang
2017-04-21 20:45 ` Ivo Raisr [this message]
2017-04-21 18:33   ` Jiong Wang
2017-04-21 19:37     ` Pedro Alves
2017-04-21 19:53       ` Ivo Raisr
2017-04-25 10:40       ` Jiong Wang
2017-04-26  8:49         ` Ivo Raisr
2017-04-26  9:22           ` Pedro Alves

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=edec7b0b-7f63-76f8-6546-d11c831e5058@oracle.com \
    --to=ivo.raisr@oracle.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jiong.wang@foss.arm.com \
    /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