* [rfa] config/tc-mn10300.c fix GCC warnings
@ 2000-07-26 20:51 Andrew Cagney
2000-07-27 8:13 ` Jeffrey A Law
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Cagney @ 2000-07-26 20:51 UTC (permalink / raw)
To: Binutils Patches
Hello,
The attatched cleans up a few GCC warnings. For the most part I don't
think there will be problems (BUT).
The function md_estimate_size_before_relax() could in theory fall off
the end without returning a value. I added an abort() for that case.
Does someone have a better suggestion?
Andrew
Thu Jul 27 11:25:01 2000 Andrew Cagney <cagney@b1.cygnus.com>
* config/tc-mn10300.c (md_convert_frag): Fix printfs.
(tc_gen_reloc): Add cast when assigning bfd_abs_symbol to
sym_ptr_ptr
(md_estimate_size_before_relax): Don't fall off end of function.
Index: config/tc-mn10300.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mn10300.c,v
retrieving revision 1.8
diff -p -r1.8 tc-mn10300.c
*** tc-mn10300.c 2000/07/17 21:06:14 1.8
--- tc-mn10300.c 2000/07/27 03:45:20
*************** md_convert_frag (abfd, sec, fragP)
*** 659,665 ****
fragP->fr_literal[offset] = opcode;
/* Create a fixup for the reversed conditional branch. */
! sprintf (buf, ".%s_%d", FAKE_LABEL_NAME, label_count++);
fix_new (fragP, fragP->fr_fix + 1, 1,
symbol_new (buf, sec, 0, fragP->fr_next),
fragP->fr_offset + 1, 1, BFD_RELOC_8_PCREL);
--- 659,665 ----
fragP->fr_literal[offset] = opcode;
/* Create a fixup for the reversed conditional branch. */
! sprintf (buf, ".%s_%ld", FAKE_LABEL_NAME, label_count++);
fix_new (fragP, fragP->fr_fix + 1, 1,
symbol_new (buf, sec, 0, fragP->fr_next),
fragP->fr_offset + 1, 1, BFD_RELOC_8_PCREL);
*************** md_convert_frag (abfd, sec, fragP)
*** 716,722 ****
fragP->fr_literal[offset] = opcode;
/* Create a fixup for the reversed conditional branch. */
! sprintf (buf, ".%s_%d", FAKE_LABEL_NAME, label_count++);
fix_new (fragP, fragP->fr_fix + 1, 1,
symbol_new (buf, sec, 0, fragP->fr_next),
fragP->fr_offset + 1, 1, BFD_RELOC_8_PCREL);
--- 716,722 ----
fragP->fr_literal[offset] = opcode;
/* Create a fixup for the reversed conditional branch. */
! sprintf (buf, ".%s_%ld", FAKE_LABEL_NAME, label_count++);
fix_new (fragP, fragP->fr_fix + 1, 1,
symbol_new (buf, sec, 0, fragP->fr_next),
fragP->fr_offset + 1, 1, BFD_RELOC_8_PCREL);
*************** md_convert_frag (abfd, sec, fragP)
*** 762,768 ****
fragP->fr_literal[offset + 1] = opcode;
/* Create a fixup for the reversed conditional branch. */
! sprintf (buf, ".%s_%d", FAKE_LABEL_NAME, label_count++);
fix_new (fragP, fragP->fr_fix + 2, 1,
symbol_new (buf, sec, 0, fragP->fr_next),
fragP->fr_offset + 2, 1, BFD_RELOC_8_PCREL);
--- 762,768 ----
fragP->fr_literal[offset + 1] = opcode;
/* Create a fixup for the reversed conditional branch. */
! sprintf (buf, ".%s_%ld", FAKE_LABEL_NAME, label_count++);
fix_new (fragP, fragP->fr_fix + 2, 1,
symbol_new (buf, sec, 0, fragP->fr_next),
fragP->fr_offset + 2, 1, BFD_RELOC_8_PCREL);
*************** md_convert_frag (abfd, sec, fragP)
*** 798,804 ****
fragP->fr_literal[offset + 1] = opcode;
/* Create a fixup for the reversed conditional branch. */
! sprintf (buf, ".%s_%d", FAKE_LABEL_NAME, label_count++);
fix_new (fragP, fragP->fr_fix + 2, 1,
symbol_new (buf, sec, 0, fragP->fr_next),
fragP->fr_offset + 2, 1, BFD_RELOC_8_PCREL);
--- 798,804 ----
fragP->fr_literal[offset + 1] = opcode;
/* Create a fixup for the reversed conditional branch. */
! sprintf (buf, ".%s_%ld", FAKE_LABEL_NAME, label_count++);
fix_new (fragP, fragP->fr_fix + 2, 1,
symbol_new (buf, sec, 0, fragP->fr_next),
fragP->fr_offset + 2, 1, BFD_RELOC_8_PCREL);
*************** tc_gen_reloc (seg, fixp)
*** 1841,1847 ****
return NULL;
}
! reloc->sym_ptr_ptr = &bfd_abs_symbol;
reloc->addend = (S_GET_VALUE (fixp->fx_addsy)
- S_GET_VALUE (fixp->fx_subsy) + fixp->fx_offset);
}
--- 1841,1847 ----
return NULL;
}
! reloc->sym_ptr_ptr = (asymbol **) &bfd_abs_symbol;
reloc->addend = (S_GET_VALUE (fixp->fx_addsy)
- S_GET_VALUE (fixp->fx_subsy) + fixp->fx_offset);
}
*************** md_estimate_size_before_relax (fragp, se
*** 1896,1901 ****
--- 1896,1902 ----
else
return 2;
}
+ abort ();
}
long
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [rfa] config/tc-mn10300.c fix GCC warnings
2000-07-26 20:51 [rfa] config/tc-mn10300.c fix GCC warnings Andrew Cagney
@ 2000-07-27 8:13 ` Jeffrey A Law
0 siblings, 0 replies; 2+ messages in thread
From: Jeffrey A Law @ 2000-07-27 8:13 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Binutils Patches
In message < 397FB1CC.49578E88@cygnus.com >you write:
> Hello,
>
> The attatched cleans up a few GCC warnings. For the most part I don't
> think there will be problems (BUT).
>
> The function md_estimate_size_before_relax() could in theory fall off
> the end without returning a value. I added an abort() for that case.
> Does someone have a better suggestion?
>
> Andrew
> --------------A73B93E235368275385FF1DA
> Content-Type: text/plain; charset=us-ascii;
> name="diffs"
> Content-Transfer-Encoding: 7bit
> Content-Disposition: inline;
> filename="diffs"
>
> Thu Jul 27 11:25:01 2000 Andrew Cagney <cagney@b1.cygnus.com>
>
> * config/tc-mn10300.c (md_convert_frag): Fix printfs.
> (tc_gen_reloc): Add cast when assigning bfd_abs_symbol to
> sym_ptr_ptr
> (md_estimate_size_before_relax): Don't fall off end of function.
This is fine. Please install this patch.
Thanks,
jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2000-07-27 8:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-26 20:51 [rfa] config/tc-mn10300.c fix GCC warnings Andrew Cagney
2000-07-27 8:13 ` Jeffrey A Law
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).