* config/tc-mcore.c (mcore_s_literals <ignore>): Add ATTRIBUTE_UNUSED.

(md_undefined_symbol <ignore>): Likewise.
	(md_create_short_jump <all args>): Likewise.
	(md_create_long_jump <all args>): Likewise.
	(md_convert_frag <abfd, sec>): Likewise.
	(md_apply_fix3 <segment>): Likewise.
	(md_section_align <segment>): Likewise.
	(md_pcrel_from_section <sec>): Likewise.
	(tc_gen_reloc <section>): Likewise.
	(reg_m, reg_n, immediate): Delete unused vars.
	(dump_literals): Fix signed/unsigned warning.
	(enter_literal): Likewise.
	(parse_imm): Likewise.  Also fix format string.
	(parse_mem): Remove unused var.
	(md_assemble <LS>): Abort on unexpected inst.
	(md_atof): Remove declaration of atof_ieee.
	(md_parse_option): Remove unused vars.
	(md_apply_fix3): Fix format strings, cast args.
	(tc_gen_reloc): Delete unused var.
	* config/tc-mcore.h (tc_coff_sizemachdep): Declare.
This commit is contained in:
Alan Modra
2002-12-12 22:11:32 +00:00
parent 2a8ce8da88
commit aa699a2caf
3 changed files with 52 additions and 40 deletions

View File

@ -1,5 +1,25 @@
2002-12-13 Alan Modra <amodra@bigpond.net.au> 2002-12-13 Alan Modra <amodra@bigpond.net.au>
* config/tc-mcore.c (mcore_s_literals <ignore>): Add ATTRIBUTE_UNUSED.
(md_undefined_symbol <ignore>): Likewise.
(md_create_short_jump <all args>): Likewise.
(md_create_long_jump <all args>): Likewise.
(md_convert_frag <abfd, sec>): Likewise.
(md_apply_fix3 <segment>): Likewise.
(md_section_align <segment>): Likewise.
(md_pcrel_from_section <sec>): Likewise.
(tc_gen_reloc <section>): Likewise.
(reg_m, reg_n, immediate): Delete unused vars.
(dump_literals): Fix signed/unsigned warning.
(enter_literal): Likewise.
(parse_imm): Likewise. Also fix format string.
(parse_mem): Remove unused var.
(md_assemble <LS>): Abort on unexpected inst.
(md_atof): Remove declaration of atof_ieee.
(md_parse_option): Remove unused vars.
(md_apply_fix3): Fix format strings, cast args.
(tc_gen_reloc): Delete unused var.
* config/tc-mcore.h (tc_coff_sizemachdep): Declare.
* config/tc-mn10200.c (md_parse_option <c, arg>): Add ATTRIBUTE_UNUSED. * config/tc-mn10200.c (md_parse_option <c, arg>): Add ATTRIBUTE_UNUSED.
(md_undefined_symbol <name>): Likewise. (md_undefined_symbol <name>): Likewise.
(md_convert_frag <abfd>): Likewise. (md_convert_frag <abfd>): Likewise.

View File

@ -223,7 +223,7 @@ const pseudo_typeS md_pseudo_table[] =
static void static void
mcore_s_literals (ignore) mcore_s_literals (ignore)
int ignore; int ignore ATTRIBUTE_UNUSED;
{ {
dump_literals (0); dump_literals (0);
demand_empty_rest_of_line (); demand_empty_rest_of_line ();
@ -410,10 +410,6 @@ md_begin ()
} }
} }
static int reg_m;
static int reg_n;
static expressionS immediate; /* absolute expression */
/* Get a log2(val). */ /* Get a log2(val). */
static int static int
log2 (val) log2 (val)
@ -641,7 +637,7 @@ static void
dump_literals (isforce) dump_literals (isforce)
int isforce; int isforce;
{ {
int i; unsigned int i;
struct literal * p; struct literal * p;
symbolS * brarsym; symbolS * brarsym;
@ -726,7 +722,7 @@ enter_literal (e, ispcrel)
expressionS * e; expressionS * e;
int ispcrel; int ispcrel;
{ {
int i; unsigned int i;
struct literal * p; struct literal * p;
if (poolsize >= MAX_POOL_SIZE - 2) if (poolsize >= MAX_POOL_SIZE - 2)
@ -839,9 +835,9 @@ parse_imm (s, val, min, max)
; /* An error message has already been emitted. */ ; /* An error message has already been emitted. */
else if (e.X_op != O_constant) else if (e.X_op != O_constant)
as_bad (_("operand must be a constant")); as_bad (_("operand must be a constant"));
else if (e.X_add_number < min || e.X_add_number > max) else if ((addressT) e.X_add_number < min || (addressT) e.X_add_number > max)
as_bad (_("operand must be absolute in range %d..%d, not %d"), as_bad (_("operand must be absolute in range %u..%u, not %ld"),
min, max, e.X_add_number); min, max, (long) e.X_add_number);
* val = e.X_add_number; * val = e.X_add_number;
@ -855,8 +851,6 @@ parse_mem (s, reg, off, siz)
unsigned * off; unsigned * off;
unsigned siz; unsigned siz;
{ {
char * new;
* off = 0; * off = 0;
while (ISSPACE (* s)) while (ISSPACE (* s))
@ -1323,6 +1317,8 @@ md_assemble (str)
size = 2; size = 2;
else if ((inst & 0x6000) == 0x2000) else if ((inst & 0x6000) == 0x2000)
size = 1; size = 1;
else
abort ();
op_end = parse_mem (op_end + 1, & reg, & off, size); op_end = parse_mem (op_end + 1, & reg, & off, size);
@ -1661,7 +1657,7 @@ md_assemble (str)
symbolS * symbolS *
md_undefined_symbol (name) md_undefined_symbol (name)
char * name; char *name ATTRIBUTE_UNUSED;
{ {
return 0; return 0;
} }
@ -1690,7 +1686,6 @@ md_atof (type, litP, sizeP)
LITTLENUM_TYPE words[MAX_LITTLENUMS]; LITTLENUM_TYPE words[MAX_LITTLENUMS];
int i; int i;
char * t; char * t;
char * atof_ieee ();
switch (type) switch (type)
{ {
@ -1779,9 +1774,6 @@ md_parse_option (c, arg)
int c; int c;
char * arg; char * arg;
{ {
int i;
char * p;
switch (c) switch (c)
{ {
case OPTION_CPU: case OPTION_CPU:
@ -1825,22 +1817,22 @@ int md_short_jump_size;
void void
md_create_short_jump (ptr, from_Nddr, to_Nddr, frag, to_symbol) md_create_short_jump (ptr, from_Nddr, to_Nddr, frag, to_symbol)
char * ptr; char * ptr ATTRIBUTE_UNUSED;
addressT from_Nddr; addressT from_Nddr ATTRIBUTE_UNUSED;
addressT to_Nddr; addressT to_Nddr ATTRIBUTE_UNUSED;
fragS * frag; fragS * frag ATTRIBUTE_UNUSED;
symbolS * to_symbol; symbolS * to_symbol ATTRIBUTE_UNUSED;
{ {
as_fatal (_("failed sanity check: short_jump")); as_fatal (_("failed sanity check: short_jump"));
} }
void void
md_create_long_jump (ptr, from_Nddr, to_Nddr, frag, to_symbol) md_create_long_jump (ptr, from_Nddr, to_Nddr, frag, to_symbol)
char * ptr; char * ptr ATTRIBUTE_UNUSED;
addressT from_Nddr; addressT from_Nddr ATTRIBUTE_UNUSED;
addressT to_Nddr; addressT to_Nddr ATTRIBUTE_UNUSED;
fragS * frag; fragS * frag ATTRIBUTE_UNUSED;
symbolS * to_symbol; symbolS * to_symbol ATTRIBUTE_UNUSED;
{ {
as_fatal (_("failed sanity check: long_jump")); as_fatal (_("failed sanity check: long_jump"));
} }
@ -1848,8 +1840,8 @@ md_create_long_jump (ptr, from_Nddr, to_Nddr, frag, to_symbol)
/* Called after relaxing, change the frags so they know how big they are. */ /* Called after relaxing, change the frags so they know how big they are. */
void void
md_convert_frag (abfd, sec, fragP) md_convert_frag (abfd, sec, fragP)
bfd * abfd; bfd * abfd ATTRIBUTE_UNUSED;
segT sec; segT sec ATTRIBUTE_UNUSED;
register fragS * fragP; register fragS * fragP;
{ {
unsigned char * buffer; unsigned char * buffer;
@ -2049,7 +2041,7 @@ void
md_apply_fix3 (fixP, valP, segment) md_apply_fix3 (fixP, valP, segment)
fixS * fixP; fixS * fixP;
valueT * valP; valueT * valP;
segT segment; segT segment ATTRIBUTE_UNUSED;
{ {
char * buf = fixP->fx_where + fixP->fx_frag->fr_literal; char * buf = fixP->fx_where + fixP->fx_frag->fr_literal;
char * file = fixP->fx_file ? fixP->fx_file : _("unknown"); char * file = fixP->fx_file ? fixP->fx_file : _("unknown");
@ -2078,12 +2070,12 @@ md_apply_fix3 (fixP, valP, segment)
case BFD_RELOC_MCORE_PCREL_IMM11BY2: /* second byte of 2 byte opcode */ case BFD_RELOC_MCORE_PCREL_IMM11BY2: /* second byte of 2 byte opcode */
if ((val & 1) != 0) if ((val & 1) != 0)
as_bad_where (file, fixP->fx_line, as_bad_where (file, fixP->fx_line,
_("odd distance branch (0x%x bytes)"), val); _("odd distance branch (0x%lx bytes)"), (long) val);
val /= 2; val /= 2;
if (((val & ~0x3ff) != 0) && ((val | 0x3ff) != -1)) if (((val & ~0x3ff) != 0) && ((val | 0x3ff) != -1))
as_bad_where (file, fixP->fx_line, as_bad_where (file, fixP->fx_line,
_("pcrel for branch to %s too far (0x%x)"), _("pcrel for branch to %s too far (0x%lx)"),
symname, val); symname, (long) val);
if (target_big_endian) if (target_big_endian)
{ {
buf[0] |= ((val >> 8) & 0x7); buf[0] |= ((val >> 8) & 0x7);
@ -2101,8 +2093,8 @@ md_apply_fix3 (fixP, valP, segment)
val /= 4; val /= 4;
if (val & ~0xff) if (val & ~0xff)
as_bad_where (file, fixP->fx_line, as_bad_where (file, fixP->fx_line,
_("pcrel for lrw/jmpi/jsri to %s too far (0x%x)"), _("pcrel for lrw/jmpi/jsri to %s too far (0x%lx)"),
symname, val); symname, (long) val);
else if (! target_big_endian) else if (! target_big_endian)
buf[0] |= (val & 0xff); buf[0] |= (val & 0xff);
else else
@ -2112,7 +2104,7 @@ md_apply_fix3 (fixP, valP, segment)
case BFD_RELOC_MCORE_PCREL_IMM4BY2: /* loopt instruction */ case BFD_RELOC_MCORE_PCREL_IMM4BY2: /* loopt instruction */
if ((val < -32) || (val > -2)) if ((val < -32) || (val > -2))
as_bad_where (file, fixP->fx_line, as_bad_where (file, fixP->fx_line,
_("pcrel for loopt too far (0x%x)"), val); _("pcrel for loopt too far (0x%lx)"), (long) val);
val /= 2; val /= 2;
if (! target_big_endian) if (! target_big_endian)
buf[0] |= (val & 0xf); buf[0] |= (val & 0xf);
@ -2275,7 +2267,7 @@ md_number_to_chars (ptr, use, nbytes)
/* Round up a section size to the appropriate boundary. */ /* Round up a section size to the appropriate boundary. */
valueT valueT
md_section_align (segment, size) md_section_align (segment, size)
segT segment; segT segment ATTRIBUTE_UNUSED;
valueT size; valueT size;
{ {
return size; /* Byte alignment is fine */ return size; /* Byte alignment is fine */
@ -2286,7 +2278,7 @@ md_section_align (segment, size)
long long
md_pcrel_from_section (fixp, sec) md_pcrel_from_section (fixp, sec)
fixS * fixp; fixS * fixp;
segT sec; segT sec ATTRIBUTE_UNUSED;
{ {
#ifdef OBJ_ELF #ifdef OBJ_ELF
/* If the symbol is undefined or defined in another section /* If the symbol is undefined or defined in another section
@ -2311,12 +2303,11 @@ md_pcrel_from_section (fixp, sec)
arelent * arelent *
tc_gen_reloc (section, fixp) tc_gen_reloc (section, fixp)
asection * section; asection * section ATTRIBUTE_UNUSED;
fixS * fixp; fixS * fixp;
{ {
arelent * rel; arelent * rel;
bfd_reloc_code_real_type code; bfd_reloc_code_real_type code;
int handled = 0;
switch (fixp->fx_r_type) switch (fixp->fx_r_type)
{ {

View File

@ -51,6 +51,7 @@
#define LOCAL_LABELS_FB 1 #define LOCAL_LABELS_FB 1
#define TC_COFF_SIZEMACHDEP(frag) tc_coff_sizemachdep (frag) #define TC_COFF_SIZEMACHDEP(frag) tc_coff_sizemachdep (frag)
int tc_coff_sizemachdep PARAMS ((struct frag *));
extern const struct relax_type md_relax_table[]; extern const struct relax_type md_relax_table[];
#define TC_GENERIC_RELAX_TABLE md_relax_table #define TC_GENERIC_RELAX_TABLE md_relax_table