public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: binutils@sourceware.org
Subject: PR29390, DW_CFA_AARCH64_negate_ra_state vs. DW_CFA_GNU_window_save
Date: Thu, 21 Jul 2022 16:36:59 +0930	[thread overview]
Message-ID: <Ytj7E/+pW9i0t6VL@squeak.grove.modra.org> (raw)

	PR 29390
binutils/
	* dwarf.c (is_aarch64, DW_CFA_GNU_window_save_name): New.
	(display_debug_frames): Use them.
	(init_dwarf_regnames_aarch64): Set is_aarch64.
	(init_dwarf_regnames_by_elf_machine_code): Clear is_aarch64.
	(init_dwarf_regnames_by_bfd_arch_and_mach): Likewise.
gas/
	* testsuite/gas/aarch64/pac_ab_key.d: Adjust expected output.
	* testsuite/gas/aarch64/pac_negate_ra_state.d: Likewise.

diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 7d0a9ffefea..68104a73786 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -8404,7 +8404,7 @@ typedef const char *(*dwarf_regname_lookup_ftype) (unsigned int);
 static dwarf_regname_lookup_ftype dwarf_regnames_lookup_func;
 static const char *const *dwarf_regnames;
 static unsigned int dwarf_regnames_count;
-
+static bool is_aarch64;
 
 /* A marker for a col_type that means this column was never referenced
    in the frame info.  */
@@ -8523,6 +8523,12 @@ init_dwarf_regnames_iamcu (void)
   dwarf_regnames_lookup_func = regname_internal_by_table_only;
 }
 
+static const char *const DW_CFA_GNU_window_save_name[] =
+{
+  "DW_CFA_GNU_window_save",
+  "DW_CFA_AARCH64_negate_ra_state"
+};
+
 static const char *const dwarf_regnames_x86_64[] =
 {
   "rax", "rdx", "rcx", "rbx",
@@ -8589,6 +8595,7 @@ init_dwarf_regnames_aarch64 (void)
   dwarf_regnames = dwarf_regnames_aarch64;
   dwarf_regnames_count = ARRAY_SIZE (dwarf_regnames_aarch64);
   dwarf_regnames_lookup_func = regname_internal_by_table_only;
+  is_aarch64 = true;
 }
 
 static const char *const dwarf_regnames_s390[] =
@@ -8678,6 +8685,7 @@ void
 init_dwarf_regnames_by_elf_machine_code (unsigned int e_machine)
 {
   dwarf_regnames_lookup_func = NULL;
+  is_aarch64 = false;
 
   switch (e_machine)
     {
@@ -8720,6 +8728,7 @@ init_dwarf_regnames_by_bfd_arch_and_mach (enum bfd_architecture arch,
 					  unsigned long mach)
 {
   dwarf_regnames_lookup_func = NULL;
+  is_aarch64 = false;
 
   switch (arch)
     {
@@ -9955,7 +9964,7 @@ display_debug_frames (struct dwarf_section *section,
 
 	    case DW_CFA_GNU_window_save:
 	      if (! do_debug_frames_interp)
-		printf ("  DW_CFA_GNU_window_save\n");
+		printf ("  %s\n", DW_CFA_GNU_window_save_name[is_aarch64]);
 	      break;
 
 	    case DW_CFA_GNU_args_size:
diff --git a/gas/testsuite/gas/aarch64/pac_ab_key.d b/gas/testsuite/gas/aarch64/pac_ab_key.d
index ea9cf2fb38a..5e7496a86bd 100644
--- a/gas/testsuite/gas/aarch64/pac_ab_key.d
+++ b/gas/testsuite/gas/aarch64/pac_ab_key.d
@@ -18,7 +18,7 @@ Contents of the .eh_frame section:
 
 0+14 0+18 0+18 FDE cie=0+ pc=0+\.\.0+8
   DW_CFA_advance_loc: 4 to 0+4
-  DW_CFA_GNU_window_save
+  DW_CFA_AARCH64_negate_ra_state
   DW_CFA_advance_loc: 4 to 0+8
   DW_CFA_def_cfa_offset: 16
   DW_CFA_offset: r29 \(x29\) at cfa-16
@@ -40,7 +40,7 @@ Contents of the .eh_frame section:
 
 0+48 0+1(c|8) 0+1c FDE cie=0+30 pc=0+8\.\.0+10
   DW_CFA_advance_loc: 4 to 0+c
-  DW_CFA_GNU_window_save
+  DW_CFA_AARCH64_negate_ra_state
   DW_CFA_advance_loc: 4 to 0+10
   DW_CFA_def_cfa_offset: 16
   DW_CFA_offset: r29 \(x29\) at cfa-16
diff --git a/gas/testsuite/gas/aarch64/pac_negate_ra_state.d b/gas/testsuite/gas/aarch64/pac_negate_ra_state.d
index cef533a7343..62717767608 100644
--- a/gas/testsuite/gas/aarch64/pac_negate_ra_state.d
+++ b/gas/testsuite/gas/aarch64/pac_negate_ra_state.d
@@ -15,7 +15,7 @@ Contents of the .eh_frame section:
 
 0+14 0+18 0+18 FDE cie=0+ pc=0+\.\.0+8
   DW_CFA_advance_loc: 4 to 0+4
-  DW_CFA_GNU_window_save
+  DW_CFA_AARCH64_negate_ra_state
   DW_CFA_advance_loc: 4 to 0+8
   DW_CFA_def_cfa_offset: 16
   DW_CFA_offset: r29 \(x29\) at cfa-16

-- 
Alan Modra
Australia Development Lab, IBM

                 reply	other threads:[~2022-07-21  7:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=Ytj7E/+pW9i0t6VL@squeak.grove.modra.org \
    --to=amodra@gmail.com \
    --cc=binutils@sourceware.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).