From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by sourceware.org (Postfix) with ESMTPS id 9354A3858D28 for ; Thu, 21 Jul 2022 07:07:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9354A3858D28 Received: by mail-pj1-x102d.google.com with SMTP id t2-20020a17090a4e4200b001f21572f3a4so678631pjl.0 for ; Thu, 21 Jul 2022 00:07:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition; bh=aWMGmAk6qEDmaPBBjWOITkDH0Qg/ON2hIndJ/JqdLJo=; b=gHLw3u9Gd8M2f3xNsi266UVmGaTvR+yj0GharutV+6aweJvtMocC1XT+YmYCr5qaHK IWGlztfbPIieWyLcOCrJaMUmjzexselXccdBUO8Qik/uEDLaIEWkr6Ds8VX4iqvH8N7z VEiqlMqVmIeHIdwhUh3EyXg6qcZApr+zJOX/Kweq40FUrapq3YSK8M0JLhpCBuwVp04z Wxhjkw8/XyhIKNV0BKU6FWKVo4ZLTIxg1hBV+8JnxsIfHdOytdd0F/OXEr9JK3ucnlU1 Ogo/C6qk/nL3z3OsD9flScqbF8a3deL9RXxrWW+FLA1Xe4YkjI3/4iLtW3g/V9b6TBUR lVYQ== X-Gm-Message-State: AJIora9kY/czQcmo/RUMNSiwtBCav5R0jbPyIqPiKBSmfo0GBqSZtBC+ MH/Acx9rWteVG0WU8NhwRt5R7TwTMsQ= X-Google-Smtp-Source: AGRyM1tAjafsVQ3UmWfoaEmZiE43RaJxVcOcOShbbQJspmF/QeWkP3Xe+NNl2boHq5WVF2F2x6Hgkw== X-Received: by 2002:a17:902:8bc5:b0:16c:f48b:d5b5 with SMTP id r5-20020a1709028bc500b0016cf48bd5b5mr19009444plo.128.1658387222380; Thu, 21 Jul 2022 00:07:02 -0700 (PDT) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id f15-20020a170902ce8f00b0016b68cf6ae5sm799732plg.226.2022.07.21.00.07.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jul 2022 00:07:01 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 8B673114030D; Thu, 21 Jul 2022 16:36:59 +0930 (ACST) Date: Thu, 21 Jul 2022 16:36:59 +0930 From: Alan Modra To: binutils@sourceware.org Subject: PR29390, DW_CFA_AARCH64_negate_ra_state vs. DW_CFA_GNU_window_save Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3036.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jul 2022 07:07:05 -0000 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