aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-mips.c
diff options
context:
space:
mode:
authorFaraz Shahbazker <fshahbazker@wavecomp.com>2019-08-05 23:38:46 +0000
committerFaraz Shahbazker <fshahbazker@wavecomp.com>2019-08-19 13:43:50 -0700
commit770c015139f038bd7b7abb5c6d84eb39d36d3080 (patch)
tree29807efdc505a9762d32ffb02fba43a1c3aa80a7 /gas/config/tc-mips.c
parent7ce8f214f1af1dd593ad42665da416ac46033f97 (diff)
downloadgdb-770c015139f038bd7b7abb5c6d84eb39d36d3080.zip
gdb-770c015139f038bd7b7abb5c6d84eb39d36d3080.tar.gz
gdb-770c015139f038bd7b7abb5c6d84eb39d36d3080.tar.bz2
MIPS/gas: Retain ISA mode bit for labels with .insn annotation
gas/ * config/tc-mips.c (mips_move_labels): Retain ISA mode bit when moving labels in text segments. (mips_align): Indicate text mode when aligning labels in text segments. * gas/testsuite/gas/mips/insn-isa-mode.d: New test. * gas/testsuite/gas/mips/insn-isa-mode.s: New test source. * gas/testsuite/gas/mips/mips.exp: Run the new test.
Diffstat (limited to 'gas/config/tc-mips.c')
-rw-r--r--gas/config/tc-mips.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index b7b4b69..38a1b8c 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -4441,9 +4441,10 @@ mips_move_labels (struct insn_label_list *labels, bfd_boolean text_p)
gas_assert (S_GET_SEGMENT (l->label) == now_seg);
symbol_set_frag (l->label, frag_now);
val = (valueT) frag_now_fix ();
- /* MIPS16/microMIPS text labels are stored as odd. */
+ /* MIPS16/microMIPS text labels are stored as odd.
+ We just carry the ISA mode bit forward. */
if (text_p && HAVE_CODE_COMPRESSION)
- ++val;
+ val |= (S_GET_VALUE (l->label) & 0x1);
S_SET_VALUE (l->label, val);
}
}
@@ -16218,7 +16219,7 @@ mips_align (int to, int *fill, struct insn_label_list *labels)
else
frag_align (to, fill ? *fill : 0, 0);
record_alignment (now_seg, to);
- mips_move_labels (labels, FALSE);
+ mips_move_labels (labels, subseg_text_p (now_seg));
}
/* Align to a given power of two. .align 0 turns off the automatic