]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gas: sframe: reword diagnostic to address ambiguity
authorIndu Bhagat <indu.bhagat@oracle.com>
Mon, 19 May 2025 07:03:39 +0000 (00:03 -0700)
committerIndu Bhagat <indu.bhagat@oracle.com>
Mon, 19 May 2025 07:03:39 +0000 (00:03 -0700)
The current warning text of "skipping SFrame FDE" does not unabiguously
indicate that the SFrame FDE is not generated in the output section.
Reword the diagnostic to say "no SFrame FDE emitted" as requested.

Adjust the testcases for the updated warning.

gas/gen-sframe.c
gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-4.d
gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-empty-1.d
gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-empty-2.d
gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-empty-3.d
gas/testsuite/gas/cfi-sframe/common-empty-1.d
gas/testsuite/gas/cfi-sframe/common-empty-2.d
gas/testsuite/gas/cfi-sframe/common-empty-3.d

index 307025866c14360b51847de13d8b4127a3804f43..aedeb3603a09eec4071859696d39ec1476c75878 100644 (file)
@@ -981,7 +981,8 @@ sframe_xlate_do_def_cfa (struct sframe_xlate_ctx *xlate_ctx,
   if (cfi_insn->u.ri.reg != SFRAME_CFA_SP_REG
       && cfi_insn->u.ri.reg != SFRAME_CFA_FP_REG)
     {
-      as_warn (_("skipping SFrame FDE; non-SP/FP register %u in .cfi_def_cfa"),
+      as_warn (_("no SFrame FDE emitted; "
+                "non-SP/FP register %u in .cfi_def_cfa"),
               cfi_insn->u.ri.reg);
       return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented.  */
     }
@@ -1010,7 +1011,7 @@ sframe_xlate_do_def_cfa_register (struct sframe_xlate_ctx *xlate_ctx,
   if (cfi_insn->u.r != SFRAME_CFA_SP_REG
       && cfi_insn->u.r != SFRAME_CFA_FP_REG)
     {
-      as_warn (_("skipping SFrame FDE; "
+      as_warn (_("no SFrame FDE emitted; "
                 "non-SP/FP register %u in .cfi_def_cfa_register"),
               cfi_insn->u.r);
       return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented.  */
@@ -1050,7 +1051,7 @@ sframe_xlate_do_def_cfa_offset (struct sframe_xlate_ctx *xlate_ctx,
     {
       /* No CFA base register in effect.  Non-SP/FP CFA base register should
         not occur, as sframe_xlate_do_def_cfa[_register] would detect this.  */
-      as_warn (_("skipping SFrame FDE; "
+      as_warn (_("no SFrame FDE emitted; "
                 ".cfi_def_cfa_offset without CFA base register in effect"));
       return SFRAME_XLATE_ERR_NOTREPRESENTED;
     }
@@ -1111,7 +1112,7 @@ sframe_xlate_do_val_offset (const struct sframe_xlate_ctx *xlate_ctx ATTRIBUTE_U
       /* Ignore SP reg, if offset matches assumed default rule.  */
       || (cfi_insn->u.ri.reg == SFRAME_CFA_SP_REG && cfi_insn->u.ri.offset != 0))
     {
-      as_warn (_("skipping SFrame FDE; %s with %s reg %u"),
+      as_warn (_("no SFrame FDE emitted; %s with %s reg %u"),
               cfi_esc_p ? ".cfi_escape DW_CFA_val_offset" : ".cfi_val_offset",
               sframe_register_name (cfi_insn->u.ri.reg), cfi_insn->u.ri.reg);
       return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented.  */
@@ -1137,7 +1138,7 @@ sframe_xlate_do_register (struct sframe_xlate_ctx *xlate_ctx ATTRIBUTE_UNUSED,
       /* Ignore SP reg, as it can be recovered from the CFA tracking info.  */
       )
     {
-      as_warn (_("skipping SFrame FDE; %s register %u in .cfi_register"),
+      as_warn (_("no SFrame FDE emitted; %s register %u in .cfi_register"),
               sframe_register_name (cfi_insn->u.rr.reg1), cfi_insn->u.rr.reg1);
       return SFRAME_XLATE_ERR_NOTREPRESENTED;  /* Not represented.  */
     }
@@ -1159,7 +1160,7 @@ sframe_xlate_do_remember_state (struct sframe_xlate_ctx *xlate_ctx)
      info for the function involved.  */
   if (!last_fre)
     {
-      as_warn (_("skipping SFrame FDE; "
+      as_warn (_("no SFrame FDE emitted; "
                 ".cfi_remember_state without prior SFrame FRE state"));
       return SFRAME_XLATE_ERR_INVAL;
     }
@@ -1253,7 +1254,7 @@ static int
 sframe_xlate_do_aarch64_negate_ra_state_with_pc (struct sframe_xlate_ctx *xlate_ctx ATTRIBUTE_UNUSED,
                                                 struct cfi_insn_data *cfi_insn ATTRIBUTE_UNUSED)
 {
-  as_warn (_("skipping SFrame FDE; .cfi_negate_ra_state_with_pc"));
+  as_warn (_("no SFrame FDE emitted; .cfi_negate_ra_state_with_pc"));
   /* The used signing method should be encoded inside the FDE in SFrame v3.
      For now, PAuth_LR extension is not supported with SFrame.  */
   return SFRAME_XLATE_ERR_NOTREPRESENTED;  /* Not represented.  */
@@ -1280,7 +1281,7 @@ sframe_xlate_do_gnu_window_save (struct sframe_xlate_ctx *xlate_ctx,
       || abi_arch == SFRAME_ABI_AARCH64_ENDIAN_LITTLE)
     return sframe_xlate_do_aarch64_negate_ra_state (xlate_ctx, cfi_insn);
 
-  as_warn (_("skipping SFrame FDE; .cfi_window_save"));
+  as_warn (_("no SFrame FDE emitted; .cfi_window_save"));
   return SFRAME_XLATE_ERR_NOTREPRESENTED;  /* Not represented.  */
 }
 
@@ -1338,7 +1339,7 @@ sframe_xlate_do_escape_expr (const struct sframe_xlate_ctx *xlate_ctx,
       || (sframe_ra_tracking_p () && reg == SFRAME_CFA_RA_REG)
       || reg == xlate_ctx->cur_fre->cfa_base_reg)
     {
-      as_warn (_("skipping SFrame FDE; "
+      as_warn (_("no SFrame FDE emitted; "
                 ".cfi_escape DW_CFA_expression with %s reg %u"),
               sframe_register_name (reg), reg);
       err = SFRAME_XLATE_ERR_NOTREPRESENTED;
@@ -1499,7 +1500,7 @@ sframe_xlate_do_cfi_escape (const struct sframe_xlate_ctx *xlate_ctx,
         OS-specific CFI opcodes), skip inspecting the DWARF expression.
         This may impact the asynchronicity due to loss of coverage.
         Continue to warn the user and bail out.  */
-      as_warn (_("skipping SFrame FDE; .cfi_escape with op (%#lx)"),
+      as_warn (_("no SFrame FDE emitted; .cfi_escape with op (%#lx)"),
               (unsigned long)firstop);
       err = SFRAME_XLATE_ERR_NOTREPRESENTED;
     }
@@ -1619,7 +1620,7 @@ sframe_do_cfi_insn (struct sframe_xlate_ctx *xlate_ctx,
 
        if (!cfi_name)
          cfi_name = _("(unknown)");
-       as_warn (_("skipping SFrame FDE; CFI insn %s (%#x)"),
+       as_warn (_("no SFrame FDE emitted; CFI insn %s (%#x)"),
                 cfi_name, op);
        err = SFRAME_XLATE_ERR_NOTREPRESENTED;
       }
@@ -1643,7 +1644,7 @@ sframe_do_fde (struct sframe_xlate_ctx *xlate_ctx,
   /* SFrame format cannot represent a non-default DWARF return column reg.  */
   if (xlate_ctx->dw_fde->return_column != DWARF2_DEFAULT_RETURN_COLUMN)
     {
-      as_warn (_("skipping SFrame FDE; non-default RA register %u"),
+      as_warn (_("no SFrame FDE emitted; non-default RA register %u"),
               xlate_ctx->dw_fde->return_column);
       return SFRAME_XLATE_ERR_NOTREPRESENTED;
     }
@@ -1686,7 +1687,7 @@ sframe_do_fde (struct sframe_xlate_ctx *xlate_ctx,
          if (fre->ra_loc != SFRAME_FRE_ELEM_LOC_STACK
              && fre->bp_loc == SFRAME_FRE_ELEM_LOC_STACK)
            {
-             as_warn (_("skipping SFrame FDE; FP without RA on stack"));
+             as_warn (_("no SFrame FDE emitted; FP without RA on stack"));
              return SFRAME_XLATE_ERR_NOTREPRESENTED;
            }
        }
index c81888b00219f7baf38f1a282c6eef542e9cca9f..51fad9c08932e10938040eeb1fa7223fb3af8382 100644 (file)
@@ -1,7 +1,7 @@
 #as: --gsframe
 #objdump: --sframe=.sframe
 #name: SFrame cfi_negate_ra_state_with_pc test
-#warning: Warning: skipping SFrame FDE; \.cfi_negate_ra_state_with_pc
+#warning: \.cfi_negate_ra_state_with_pc
 
 ## The support for .cfi_negate_ra_state_with_pc is currently pending on SFrame
 ## v3 (currently in development). The unimplemented support is reported to the
index 01239944863ff018c716444cfd37adf8a3774a8b..0bae4b95b31da7fcdc1f4c97ecae4db8b5944c8f 100644 (file)
@@ -1,5 +1,5 @@
 #as: --gsframe
-#warning: skipping SFrame FDE; \.cfi_escape DW\_CFA\_expression with SP reg 7
+#warning: \.cfi_escape DW\_CFA\_expression with SP reg 7
 #objdump: --sframe=.sframe
 #name: CFI_escape with register of significance to SFrame
 #...
index 482803b65a2841d7662fe59d94dc2ff044a3b960..f1ba0443273e338ccc9ee4faffc889dfa2506afb 100644 (file)
@@ -1,5 +1,5 @@
 #as: --gsframe
-#warning: skipping SFrame FDE; \.cfi\_escape DW\_CFA\_val\_offset with FP reg 6
+#warning: \.cfi\_escape DW\_CFA\_val\_offset with FP reg 6
 #objdump: --sframe=.sframe
 #name: CFI_escape with register of significance to SFrame II
 #...
index 177fb21fc8a34f7acc2af859d5bbbdb8c4a998f3..c8fc7a43dd4f89e2ae3797d89cf8bd4233da7e82 100644 (file)
@@ -1,5 +1,5 @@
 #as: --gsframe
-#warning: skipping SFrame FDE; \.cfi\_escape with op \(0x14\)
+#warning: \.cfi\_escape with op \(0x14\)
 #objdump: --sframe=.sframe
 #name: CFI_escape with multiple DWARF expr
 #...
index 6e99dd57af94d077a33a5a3dbbe081258c1576cc..736aea87505525d1131611e9f37a7324f266dea5 100644 (file)
@@ -1,5 +1,5 @@
 #as: --gsframe
-#warning: skipping SFrame FDE; \.cfi_remember_state without prior SFrame FRE state
+#warning: \.cfi_remember_state without prior SFrame FRE state
 #objdump: --sframe=.sframe
 #name: Uninteresting cfi directives generate an empty SFrame section
 #...
index 77c303eec8fb594375a4b1b2fdc59bb14c68d598..163b504a687337a3eae5299db8a17495bb45521c 100644 (file)
@@ -1,5 +1,5 @@
 #as: --gsframe
-#warning: skipping SFrame FDE; \.cfi_def_cfa_offset without CFA base register in effect
+#warning: \.cfi_def_cfa_offset without CFA base register in effect
 #objdump: --sframe=.sframe
 #name: SFrame supports only FP/SP based CFA
 #...
index 4ec5b44dd51f3b2925335528ab416f5319ec5df4..39caad5a1d45b5899552badf1c30482bdf5700c1 100644 (file)
@@ -1,5 +1,5 @@
 #as: --gsframe
-#warning: skipping SFrame FDE; non-default RA register 0
+#warning: non-default RA register 0
 #objdump: --sframe=.sframe
 #name: SFrame supports only default return column
 #...