diff options
author | Nick Clifton <nickc@redhat.com> | 2006-10-19 15:47:34 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2006-10-19 15:47:34 +0000 |
commit | b354976135880498dc76cb68e9ab47520205081b (patch) | |
tree | a6ac24d321c2f8f5c5b129f07e757cea61629e4e /gas | |
parent | 6870500c0404a6501f0a21fdbca6ce2695c6ca0c (diff) | |
download | gdb-b354976135880498dc76cb68e9ab47520205081b.zip gdb-b354976135880498dc76cb68e9ab47520205081b.tar.gz gdb-b354976135880498dc76cb68e9ab47520205081b.tar.bz2 |
Fix score bugs
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 5 | ||||
-rw-r--r-- | gas/config/tc-mn10300.c | 2 | ||||
-rw-r--r-- | gas/config/tc-score.c | 34 |
3 files changed, 21 insertions, 20 deletions
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 <ligang@sunnorth.com.cn> + + * config/tc-score.c (build_relax_frag): Compute correct + tc_frag_data.fixp. + 2006-10-18 Roy Marples <uberlord@gentoo.org> * 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); |