Skip to content

Commit bd9dc0a

Browse files
committed
gas: sframe: reword diagnostic to address ambiguity
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.
1 parent 9819d84 commit bd9dc0a

File tree

8 files changed

+21
-20
lines changed

8 files changed

+21
-20
lines changed

gas/gen-sframe.c

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,8 @@ sframe_xlate_do_def_cfa (struct sframe_xlate_ctx *xlate_ctx,
981981
if (cfi_insn->u.ri.reg != SFRAME_CFA_SP_REG
982982
&& cfi_insn->u.ri.reg != SFRAME_CFA_FP_REG)
983983
{
984-
as_warn (_("skipping SFrame FDE; non-SP/FP register %u in .cfi_def_cfa"),
984+
as_warn (_("no SFrame FDE emitted; "
985+
"non-SP/FP register %u in .cfi_def_cfa"),
985986
cfi_insn->u.ri.reg);
986987
return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented. */
987988
}
@@ -1010,7 +1011,7 @@ sframe_xlate_do_def_cfa_register (struct sframe_xlate_ctx *xlate_ctx,
10101011
if (cfi_insn->u.r != SFRAME_CFA_SP_REG
10111012
&& cfi_insn->u.r != SFRAME_CFA_FP_REG)
10121013
{
1013-
as_warn (_("skipping SFrame FDE; "
1014+
as_warn (_("no SFrame FDE emitted; "
10141015
"non-SP/FP register %u in .cfi_def_cfa_register"),
10151016
cfi_insn->u.r);
10161017
return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented. */
@@ -1050,7 +1051,7 @@ sframe_xlate_do_def_cfa_offset (struct sframe_xlate_ctx *xlate_ctx,
10501051
{
10511052
/* No CFA base register in effect. Non-SP/FP CFA base register should
10521053
not occur, as sframe_xlate_do_def_cfa[_register] would detect this. */
1053-
as_warn (_("skipping SFrame FDE; "
1054+
as_warn (_("no SFrame FDE emitted; "
10541055
".cfi_def_cfa_offset without CFA base register in effect"));
10551056
return SFRAME_XLATE_ERR_NOTREPRESENTED;
10561057
}
@@ -1111,7 +1112,7 @@ sframe_xlate_do_val_offset (const struct sframe_xlate_ctx *xlate_ctx ATTRIBUTE_U
11111112
/* Ignore SP reg, if offset matches assumed default rule. */
11121113
|| (cfi_insn->u.ri.reg == SFRAME_CFA_SP_REG && cfi_insn->u.ri.offset != 0))
11131114
{
1114-
as_warn (_("skipping SFrame FDE; %s with %s reg %u"),
1115+
as_warn (_("no SFrame FDE emitted; %s with %s reg %u"),
11151116
cfi_esc_p ? ".cfi_escape DW_CFA_val_offset" : ".cfi_val_offset",
11161117
sframe_register_name (cfi_insn->u.ri.reg), cfi_insn->u.ri.reg);
11171118
return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented. */
@@ -1137,7 +1138,7 @@ sframe_xlate_do_register (struct sframe_xlate_ctx *xlate_ctx ATTRIBUTE_UNUSED,
11371138
/* Ignore SP reg, as it can be recovered from the CFA tracking info. */
11381139
)
11391140
{
1140-
as_warn (_("skipping SFrame FDE; %s register %u in .cfi_register"),
1141+
as_warn (_("no SFrame FDE emitted; %s register %u in .cfi_register"),
11411142
sframe_register_name (cfi_insn->u.rr.reg1), cfi_insn->u.rr.reg1);
11421143
return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented. */
11431144
}
@@ -1159,7 +1160,7 @@ sframe_xlate_do_remember_state (struct sframe_xlate_ctx *xlate_ctx)
11591160
info for the function involved. */
11601161
if (!last_fre)
11611162
{
1162-
as_warn (_("skipping SFrame FDE; "
1163+
as_warn (_("no SFrame FDE emitted; "
11631164
".cfi_remember_state without prior SFrame FRE state"));
11641165
return SFRAME_XLATE_ERR_INVAL;
11651166
}
@@ -1253,7 +1254,7 @@ static int
12531254
sframe_xlate_do_aarch64_negate_ra_state_with_pc (struct sframe_xlate_ctx *xlate_ctx ATTRIBUTE_UNUSED,
12541255
struct cfi_insn_data *cfi_insn ATTRIBUTE_UNUSED)
12551256
{
1256-
as_warn (_("skipping SFrame FDE; .cfi_negate_ra_state_with_pc"));
1257+
as_warn (_("no SFrame FDE emitted; .cfi_negate_ra_state_with_pc"));
12571258
/* The used signing method should be encoded inside the FDE in SFrame v3.
12581259
For now, PAuth_LR extension is not supported with SFrame. */
12591260
return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented. */
@@ -1280,7 +1281,7 @@ sframe_xlate_do_gnu_window_save (struct sframe_xlate_ctx *xlate_ctx,
12801281
|| abi_arch == SFRAME_ABI_AARCH64_ENDIAN_LITTLE)
12811282
return sframe_xlate_do_aarch64_negate_ra_state (xlate_ctx, cfi_insn);
12821283

1283-
as_warn (_("skipping SFrame FDE; .cfi_window_save"));
1284+
as_warn (_("no SFrame FDE emitted; .cfi_window_save"));
12841285
return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented. */
12851286
}
12861287

@@ -1338,7 +1339,7 @@ sframe_xlate_do_escape_expr (const struct sframe_xlate_ctx *xlate_ctx,
13381339
|| (sframe_ra_tracking_p () && reg == SFRAME_CFA_RA_REG)
13391340
|| reg == xlate_ctx->cur_fre->cfa_base_reg)
13401341
{
1341-
as_warn (_("skipping SFrame FDE; "
1342+
as_warn (_("no SFrame FDE emitted; "
13421343
".cfi_escape DW_CFA_expression with %s reg %u"),
13431344
sframe_register_name (reg), reg);
13441345
err = SFRAME_XLATE_ERR_NOTREPRESENTED;
@@ -1499,7 +1500,7 @@ sframe_xlate_do_cfi_escape (const struct sframe_xlate_ctx *xlate_ctx,
14991500
OS-specific CFI opcodes), skip inspecting the DWARF expression.
15001501
This may impact the asynchronicity due to loss of coverage.
15011502
Continue to warn the user and bail out. */
1502-
as_warn (_("skipping SFrame FDE; .cfi_escape with op (%#lx)"),
1503+
as_warn (_("no SFrame FDE emitted; .cfi_escape with op (%#lx)"),
15031504
(unsigned long)firstop);
15041505
err = SFRAME_XLATE_ERR_NOTREPRESENTED;
15051506
}
@@ -1619,7 +1620,7 @@ sframe_do_cfi_insn (struct sframe_xlate_ctx *xlate_ctx,
16191620

16201621
if (!cfi_name)
16211622
cfi_name = _("(unknown)");
1622-
as_warn (_("skipping SFrame FDE; CFI insn %s (%#x)"),
1623+
as_warn (_("no SFrame FDE emitted; CFI insn %s (%#x)"),
16231624
cfi_name, op);
16241625
err = SFRAME_XLATE_ERR_NOTREPRESENTED;
16251626
}
@@ -1643,7 +1644,7 @@ sframe_do_fde (struct sframe_xlate_ctx *xlate_ctx,
16431644
/* SFrame format cannot represent a non-default DWARF return column reg. */
16441645
if (xlate_ctx->dw_fde->return_column != DWARF2_DEFAULT_RETURN_COLUMN)
16451646
{
1646-
as_warn (_("skipping SFrame FDE; non-default RA register %u"),
1647+
as_warn (_("no SFrame FDE emitted; non-default RA register %u"),
16471648
xlate_ctx->dw_fde->return_column);
16481649
return SFRAME_XLATE_ERR_NOTREPRESENTED;
16491650
}
@@ -1686,7 +1687,7 @@ sframe_do_fde (struct sframe_xlate_ctx *xlate_ctx,
16861687
if (fre->ra_loc != SFRAME_FRE_ELEM_LOC_STACK
16871688
&& fre->bp_loc == SFRAME_FRE_ELEM_LOC_STACK)
16881689
{
1689-
as_warn (_("skipping SFrame FDE; FP without RA on stack"));
1690+
as_warn (_("no SFrame FDE emitted; FP without RA on stack"));
16901691
return SFRAME_XLATE_ERR_NOTREPRESENTED;
16911692
}
16921693
}

gas/testsuite/gas/cfi-sframe/cfi-sframe-aarch64-4.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#as: --gsframe
22
#objdump: --sframe=.sframe
33
#name: SFrame cfi_negate_ra_state_with_pc test
4-
#warning: Warning: skipping SFrame FDE; \.cfi_negate_ra_state_with_pc
4+
#warning: \.cfi_negate_ra_state_with_pc
55

66
## The support for .cfi_negate_ra_state_with_pc is currently pending on SFrame
77
## v3 (currently in development). The unimplemented support is reported to the

gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-empty-1.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#as: --gsframe
2-
#warning: skipping SFrame FDE; \.cfi_escape DW\_CFA\_expression with SP reg 7
2+
#warning: \.cfi_escape DW\_CFA\_expression with SP reg 7
33
#objdump: --sframe=.sframe
44
#name: CFI_escape with register of significance to SFrame
55
#...

gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-empty-2.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#as: --gsframe
2-
#warning: skipping SFrame FDE; \.cfi\_escape DW\_CFA\_val\_offset with FP reg 6
2+
#warning: \.cfi\_escape DW\_CFA\_val\_offset with FP reg 6
33
#objdump: --sframe=.sframe
44
#name: CFI_escape with register of significance to SFrame II
55
#...

gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-empty-3.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#as: --gsframe
2-
#warning: skipping SFrame FDE; \.cfi\_escape with op \(0x14\)
2+
#warning: \.cfi\_escape with op \(0x14\)
33
#objdump: --sframe=.sframe
44
#name: CFI_escape with multiple DWARF expr
55
#...

gas/testsuite/gas/cfi-sframe/common-empty-1.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#as: --gsframe
2-
#warning: skipping SFrame FDE; \.cfi_remember_state without prior SFrame FRE state
2+
#warning: \.cfi_remember_state without prior SFrame FRE state
33
#objdump: --sframe=.sframe
44
#name: Uninteresting cfi directives generate an empty SFrame section
55
#...

gas/testsuite/gas/cfi-sframe/common-empty-2.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#as: --gsframe
2-
#warning: skipping SFrame FDE; \.cfi_def_cfa_offset without CFA base register in effect
2+
#warning: \.cfi_def_cfa_offset without CFA base register in effect
33
#objdump: --sframe=.sframe
44
#name: SFrame supports only FP/SP based CFA
55
#...

gas/testsuite/gas/cfi-sframe/common-empty-3.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#as: --gsframe
2-
#warning: skipping SFrame FDE; non-default RA register 0
2+
#warning: non-default RA register 0
33
#objdump: --sframe=.sframe
44
#name: SFrame supports only default return column
55
#...

0 commit comments

Comments
 (0)