From b354976135880498dc76cb68e9ab47520205081b Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 19 Oct 2006 15:47:34 +0000 Subject: Fix score bugs --- gas/ChangeLog | 5 +++++ gas/config/tc-mn10300.c | 2 +- gas/config/tc-score.c | 34 +++++++++++++++------------------- 3 files changed, 21 insertions(+), 20 deletions(-) (limited to 'gas') diff --git a/gas/ChangeLog b/gas/ChangeLog index 22262e3..2d40bdf 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2006-10-19 Mei Ligang + + * config/tc-score.c (build_relax_frag): Compute correct + tc_frag_data.fixp. + 2006-10-18 Roy Marples * config/tc-sparc.c (md_parse_option): Treat any target starting with diff --git a/gas/config/tc-mn10300.c b/gas/config/tc-mn10300.c index a1cacf1..41358f3 100644 --- a/gas/config/tc-mn10300.c +++ b/gas/config/tc-mn10300.c @@ -691,7 +691,7 @@ void md_show_usage (stream) FILE *stream; { - fprintf (stream, _("MN10300 options:\n\ + fprintf (stream, _("MN10300 assembler options:\n\ none yet\n")); } diff --git a/gas/config/tc-score.c b/gas/config/tc-score.c index 15fec2a..6097d80 100644 --- a/gas/config/tc-score.c +++ b/gas/config/tc-score.c @@ -3602,7 +3602,7 @@ build_relax_frag (struct score_it fix_insts[RELAX_INST_NUM], int fix_num ATTRIBU int i; char *p; fixS *fixp = NULL; - fixS *head_fixp = NULL; + fixS *cur_fixp = NULL; long where; struct score_it inst_main; @@ -3638,19 +3638,11 @@ build_relax_frag (struct score_it fix_insts[RELAX_INST_NUM], int fix_num ATTRIBU md_number_to_chars (p, inst_main.instruction, inst_main.size); if (inst_main.reloc.type != BFD_RELOC_NONE) - { - fixp = fix_new_score (frag_now, p - frag_now->fr_literal, inst_main.size, - &inst_main.reloc.exp, inst_main.reloc.pc_rel, inst_main.reloc.type); - } - - head_fixp = xmalloc (sizeof (fixS *)); - frag_now->tc_frag_data.fixp = head_fixp; + fixp = fix_new_score (frag_now, p - frag_now->fr_literal, inst_main.size, + &inst_main.reloc.exp, inst_main.reloc.pc_rel, inst_main.reloc.type); - if (fixp) - { - head_fixp->fx_next = fixp; - head_fixp = head_fixp->fx_next; - } + frag_now->tc_frag_data.fixp = fixp; + cur_fixp = frag_now->tc_frag_data.fixp; #ifdef OBJ_ELF dwarf2_emit_insn (inst_main.size); @@ -3669,16 +3661,20 @@ build_relax_frag (struct score_it fix_insts[RELAX_INST_NUM], int fix_num ATTRIBU var_insts[i].reloc.type); if (fixp) { - head_fixp->fx_next = fixp; - head_fixp = head_fixp->fx_next; + if (cur_fixp) + { + cur_fixp->fx_next = fixp; + cur_fixp = cur_fixp->fx_next; + } + else + { + frag_now->tc_frag_data.fixp = fixp; + cur_fixp = frag_now->tc_frag_data.fixp; + } } } } - head_fixp = frag_now->tc_frag_data.fixp; - frag_now->tc_frag_data.fixp = head_fixp->fx_next; - free (head_fixp); - p = frag_var (rs_machine_dependent, inst_main.relax_size + RELAX_PAD_BYTE, 0, RELAX_ENCODE (inst_main.size, inst_main.relax_size, inst_main.type, 0, inst_main.size, 0), add_symbol, 0, NULL); -- cgit v1.1