From: liuzhensong Date: Sun, 20 Mar 2022 01:19:55 +0000 (+0800) Subject: gas:LoongArch: Fix wrong line number in .debug_line X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1848a40fdd134c5579e743d93f1ca9acc0b4b486;p=binutils-gdb.git gas:LoongArch: Fix wrong line number in .debug_line The dwarf2_emit_insn() can create debuginfo of line. But it is called too late in append_fixp_and_insn. It causes extra offs when debuginfo of line sets address. gas/config/ * tc-loongarch.c --- diff --git a/gas/config/tc-loongarch.c b/gas/config/tc-loongarch.c index d7ab1555ee6..3f7aa996f3f 100644 --- a/gas/config/tc-loongarch.c +++ b/gas/config/tc-loongarch.c @@ -877,6 +877,8 @@ append_fixp_and_insn (struct loongarch_cl_insn *ip) struct reloc_info *reloc_info = ip->reloc_info; size_t i; + dwarf2_emit_insn (0); + for (i = 0; i < ip->reloc_num; i++) { reloc_type = reloc_info[i].type; @@ -893,8 +895,6 @@ append_fixp_and_insn (struct loongarch_cl_insn *ip) as_fatal (_("Internal error: not support relax now")); else append_fixed_insn (ip); - - dwarf2_emit_insn (0); } /* Ask helper for returning a malloced c_str or NULL. */