This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] Emit MIPS assembler line numbers
- From: Momchil Velikov <velco at fadata dot bg>
- To: Richard Henderson <rth at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: 17 Apr 2002 23:25:11 +0300
- Subject: Re: [PATCH] Emit MIPS assembler line numbers
- References: <873cxutpho.fsf@fadata.bg> <20020417093047.A22780@redhat.com>
>>>>> "Richard" == Richard Henderson <rth@redhat.com> writes:
Richard> On Wed, Apr 17, 2002 at 04:37:55PM +0300, Momchil Velikov wrote:
>> - : md_number_to_chars (frag_more (4), 0, 4))
>> + : md_number_to_chars (frag_more (4), 0, 4)), emit_insn (4)
Richard> Typo vs the ?: parenthesis.
Uhh, thanks. Corrected patch follows.
Regards,
-velco
Index: tc-mips.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mips.c,v
retrieving revision 1.115
diff -u -d -p -r1.115 tc-mips.c
--- tc-mips.c 4 Apr 2002 07:43:11 -0000 1.115
+++ tc-mips.c 17 Apr 2002 20:16:43 -0000
@@ -69,7 +69,14 @@ static int mips_output_flavor () { retur
#if defined (OBJ_ELF)
#include "elf/mips.h"
-#endif
+#include "dwarf2dbg.h"
+#define emit_insn(s) dwarf2_emit_insn (s)
+
+#else /* ! OBJ_ELF */
+
+#define emit_insn(s) ((void) s)
+
+#endif /* OBJ_ELF */
#ifndef ECOFF_DEBUGGING
#define NO_ECOFF_DEBUGGING
@@ -1687,10 +1694,10 @@ append_insn (place, ip, address_expr, re
it. */
/* This is how a NOP is emitted. */
-#define emit_nop() \
- (mips_opts.mips16 \
- ? md_number_to_chars (frag_more (2), 0x6500, 2) \
- : md_number_to_chars (frag_more (4), 0, 4))
+#define emit_nop() \
+ (mips_opts.mips16 \
+ ? md_number_to_chars (frag_more (2), 0x6500, 2), emit_insn (2) \
+ : (md_number_to_chars (frag_more (4), 0, 4), emit_insn (4)))
/* The previous insn might require a delay slot, depending upon
the contents of the current insn. */
@@ -2222,20 +2229,26 @@ append_insn (place, ip, address_expr, re
}
if (! mips_opts.mips16)
- md_number_to_chars (f, ip->insn_opcode, 4);
- else if (*reloc_type == BFD_RELOC_MIPS16_JMP)
{
- md_number_to_chars (f, ip->insn_opcode >> 16, 2);
- md_number_to_chars (f + 2, ip->insn_opcode & 0xffff, 2);
+ md_number_to_chars (f, ip->insn_opcode, 4);
+ emit_insn (4);
}
+ else if (*reloc_type == BFD_RELOC_MIPS16_JMP)
+ {
+ md_number_to_chars (f, ip->insn_opcode >> 16, 2);
+ md_number_to_chars (f + 2, ip->insn_opcode & 0xffff, 2);
+ emit_insn (4);
+ }
else
{
if (ip->use_extend)
{
md_number_to_chars (f, 0xf000 | ip->extend, 2);
f += 2;
+ emit_insn (2);
}
md_number_to_chars (f, ip->insn_opcode, 2);
+ emit_insn (2);
}
/* Update the register mask information. */