aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-08-23 16:18:25 +0930
committerAlan Modra <amodra@gmail.com>2022-08-28 21:05:10 +0930
commit6f6f5b0adc9efd103c434fd316e8c880a259775d (patch)
tree7ab9bde0935f59158110fffe3f2746fad9ede041 /gas
parentd91ab9a73b8dfe7a6cfc24cb4d5491dcb97fa567 (diff)
downloadfsf-binutils-gdb-6f6f5b0adc9efd103c434fd316e8c880a259775d.zip
fsf-binutils-gdb-6f6f5b0adc9efd103c434fd316e8c880a259775d.tar.gz
fsf-binutils-gdb-6f6f5b0adc9efd103c434fd316e8c880a259775d.tar.bz2
PR29494 Trailing jump table on ARM
out_inc_line_addr and relax_inc_line_addr are passed INT_MAX as line_delta to flag end of section. This filters its way down to size_inc_line_addr and emit_inc_line_addr. Pass line_delta on to scale_addr_delta where it can be used to omit an unaligned opcode error. PR 29494 * dwarf2dbg.c (scale_addr_delta): Delete unnecessary forward decl. Add line_delta param. Don't print error at end of section, just round the address down. (size_inc_line_addr, emit_inc_line_addr): Adjust calls.
Diffstat (limited to 'gas')
-rw-r--r--gas/dwarf2dbg.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
index 8f3d528..dbcf9cf 100644
--- a/gas/dwarf2dbg.c
+++ b/gas/dwarf2dbg.c
@@ -1572,15 +1572,15 @@ out_set_addr (symbolS *sym)
emit_expr (&exp, sizeof_address);
}
-static void scale_addr_delta (addressT *);
-
static void
-scale_addr_delta (addressT *addr_delta)
+scale_addr_delta (int line_delta, addressT *addr_delta)
{
static int printed_this = 0;
if (DWARF2_LINE_MIN_INSN_LENGTH > 1)
{
- if (*addr_delta % DWARF2_LINE_MIN_INSN_LENGTH != 0 && !printed_this)
+ /* Don't error on non-instruction bytes at end of section. */
+ if (line_delta != INT_MAX
+ && *addr_delta % DWARF2_LINE_MIN_INSN_LENGTH != 0 && !printed_this)
{
as_bad("unaligned opcodes detected in executable segment");
printed_this = 1;
@@ -1603,7 +1603,7 @@ size_inc_line_addr (int line_delta, addressT addr_delta)
int len = 0;
/* Scale the address delta by the minimum instruction length. */
- scale_addr_delta (&addr_delta);
+ scale_addr_delta (line_delta, &addr_delta);
/* INT_MAX is a signal that this is actually a DW_LNE_end_sequence.
We cannot use special opcodes here, since we want the end_sequence
@@ -1667,7 +1667,7 @@ emit_inc_line_addr (int line_delta, addressT addr_delta, char *p, int len)
gas_assert ((offsetT) addr_delta >= 0);
/* Scale the address delta by the minimum instruction length. */
- scale_addr_delta (&addr_delta);
+ scale_addr_delta (line_delta, &addr_delta);
/* INT_MAX is a signal that this is actually a DW_LNE_end_sequence.
We cannot use special opcodes here, since we want the end_sequence