summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2001-06-06 17:01:35 +0000
committerNick Clifton <nickc@redhat.com>2001-06-06 17:01:35 +0000
commitf2e304498690bbea2a583e565318819ad530344a (patch)
tree6550b41e9f704d80b8a1f343d31846d20767b7c9
parent4a26861bc79838995c27d39ef6849dee2ec6962e (diff)
downloadbinutils-redhat-f2e304498690bbea2a583e565318819ad530344a.tar.gz
Remove warnings building z8k port.
Fix ld -r behaviour
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/coff-z8k.c50
-rw-r--r--gas/ChangeLog12
-rw-r--r--gas/config/tc-z8k.c178
-rw-r--r--gas/testsuite/gas/macros/macros.exp1
-rw-r--r--opcodes/ChangeLog7
-rw-r--r--opcodes/z8k-dis.c37
7 files changed, 130 insertions, 160 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index a1b799066a..a408b20b31 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2001-06-06 Christian Groessler <cpg@aladdin.de>
+
+ * coff-z8k.c: Fix formatting.
+ Fix howtos: howto->size was always 1.
+
2001-06-05 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
* configure.host (mips64*-*-linux*): Define.
diff --git a/bfd/coff-z8k.c b/bfd/coff-z8k.c
index 2e5da48880..794ea8740c 100644
--- a/bfd/coff-z8k.c
+++ b/bfd/coff-z8k.c
@@ -1,5 +1,5 @@
/* BFD back-end for Zilog Z800n COFF binaries.
- Copyright 1992, 1993, 1994, 1995, 1997, 1999, 2000
+ Copyright 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001
Free Software Foundation, Inc.
Contributed by Cygnus Support.
Written by Steve Chamberlain, <sac@cygnus.com>.
@@ -31,12 +31,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (1)
static reloc_howto_type r_imm32 =
-HOWTO (R_IMM32, 0, 1, 32, false, 0,
+HOWTO (R_IMM32, 0, 2, 32, false, 0,
complain_overflow_bitfield, 0, "r_imm32", true, 0xffffffff,
0xffffffff, false);
static reloc_howto_type r_imm4l =
-HOWTO (R_IMM4L, 0, 1, 4, false, 0,
+HOWTO (R_IMM4L, 0, 0, 4, false, 0,
complain_overflow_bitfield, 0, "r_imm4l", true, 0xf, 0xf, false);
static reloc_howto_type r_da =
@@ -45,7 +45,7 @@ HOWTO (R_IMM16, 0, 1, 16, false, 0,
false);
static reloc_howto_type r_imm8 =
-HOWTO (R_IMM8, 0, 1, 8, false, 0,
+HOWTO (R_IMM8, 0, 0, 8, false, 0,
complain_overflow_bitfield, 0, "r_imm8", true, 0x000000ff, 0x000000ff,
false);
@@ -55,11 +55,11 @@ HOWTO (R_REL16, 0, 1, 16, false, 0,
true);
static reloc_howto_type r_jr =
-HOWTO (R_JR, 0, 1, 8, true, 0, complain_overflow_signed, 0,
+HOWTO (R_JR, 0, 0, 8, true, 0, complain_overflow_signed, 0,
"r_jr", true, 0, 0, true);
static reloc_howto_type r_disp7 =
-HOWTO (R_DISP7, 0, 1, 7, true, 0, complain_overflow_bitfield, 0,
+HOWTO (R_DISP7, 0, 0, 7, true, 0, complain_overflow_bitfield, 0,
"r_disp7", true, 0, 0, true);
static reloc_howto_type r_callr =
@@ -141,7 +141,7 @@ rtype2howto (internal, dst)
static void
reloc_processing (relent, reloc, symbols, abfd, section)
arelent * relent;
- struct internal_reloc *reloc;
+ struct internal_reloc * reloc;
asymbol ** symbols;
bfd * abfd;
asection * section;
@@ -150,13 +150,9 @@ reloc_processing (relent, reloc, symbols, abfd, section)
rtype2howto (relent, reloc);
if (reloc->r_symndx > 0)
- {
- relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx];
- }
+ relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx];
else
- {
- relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
- }
+ relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
relent->addend = reloc->r_offset;
relent->address -= section->vma;
@@ -164,15 +160,15 @@ reloc_processing (relent, reloc, symbols, abfd, section)
static void
extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)
- bfd *in_abfd;
- struct bfd_link_info *link_info;
- struct bfd_link_order *link_order;
- arelent *reloc;
- bfd_byte *data;
- unsigned int *src_ptr;
- unsigned int *dst_ptr;
+ bfd * in_abfd;
+ struct bfd_link_info * link_info;
+ struct bfd_link_order * link_order;
+ arelent * reloc;
+ bfd_byte * data;
+ unsigned int * src_ptr;
+ unsigned int * dst_ptr;
{
- asection *input_section = link_order->u.indirect.section;
+ asection * input_section = link_order->u.indirect.section;
switch (reloc->howto->type)
{
@@ -186,7 +182,8 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)
case R_IMM32:
bfd_put_32 (in_abfd,
- bfd_coff_reloc16_get_value (reloc, link_info, input_section),
+ /* 0x80000000 indicates a long segmented address. */
+ bfd_coff_reloc16_get_value (reloc, link_info, input_section) | 0x80000000,
data + *dst_ptr);
(*dst_ptr) += 4;
(*src_ptr) += 4;
@@ -218,8 +215,8 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)
bfd_vma dot = (link_order->offset
+ *dst_ptr
+ input_section->output_section->vma);
- int gap = dst - dot - 1;/* -1 since were in the odd byte of the
- word and the pc's been incremented */
+ int gap = dst - dot - 1; /* -1, since we're in the odd byte of the
+ word and the pc's been incremented. */
if (gap & 1)
abort ();
@@ -245,8 +242,8 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)
bfd_vma dot = (link_order->offset
+ *dst_ptr
+ input_section->output_section->vma);
- int gap = dst - dot - 1;/* -1 since were in the odd byte of the
- word and the pc's been incremented */
+ int gap = dst - dot - 1; /* -1, since we're in the odd byte of the
+ word and the pc's been incremented. */
if (gap & 1)
abort ();
@@ -318,6 +315,7 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)
(*src_ptr) += 2;
break;
}
+
default:
abort ();
}
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 514934055b..82cc92c7fb 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,15 @@
+2001-06-06 Christian Groessler <cpg@aladdin.de>
+
+ * config/tc-z8k.c: Removed many warnings by removing unused
+ variables and tagging unused parameters as such.
+ (md_begin): Fixed a typo (","instead of ";").
+ (struct ctrl_table): Add parentheses to initialize array
+ correctly.
+ (struct flag_table): Likewise.
+ (struct intr_table): Likewise.
+ (struct table): Likewise.
+ (check_operand): "#if 0"'ed since it doesn't seem to be used.
+
2001-06-06 Peter Jakubek <pjak@snafu.de>
* gas/config/tc-m68k.c (md_show_usage): Add all supported ColdFire
diff --git a/gas/config/tc-z8k.c b/gas/config/tc-z8k.c
index 489a01b6ee..73666ca89a 100644
--- a/gas/config/tc-z8k.c
+++ b/gas/config/tc-z8k.c
@@ -159,8 +159,6 @@ md_begin ()
for (opcode = z8k_table; opcode->name; opcode++)
{
/* Only enter unique codes into the table. */
- char *src = opcode->name;
-
if (strcmp (opcode->name, prev_name))
{
hash_insert (opcode_hash_control, opcode->name, (char *) opcode);
@@ -178,8 +176,8 @@ md_begin ()
{
opcode_entry_type *fake_opcode;
fake_opcode = (opcode_entry_type *) malloc (sizeof (opcode_entry_type));
- fake_opcode->name = md_pseudo_table[idx].poc_name,
- fake_opcode->func = (void *) (md_pseudo_table + idx);
+ fake_opcode->name = md_pseudo_table[idx].poc_name;
+ fake_opcode->func = (void *) (md_pseudo_table + idx);
fake_opcode->opcode = 250;
hash_insert (opcode_hash_control, fake_opcode->name, fake_opcode);
}
@@ -404,25 +402,24 @@ struct ctrl_names {
};
struct ctrl_names ctrl_table[] = {
- 0x2, "fcw",
- 0X3, "refresh",
- 0x4, "psapseg",
- 0x5, "psapoff",
- 0x5, "psap",
- 0x6, "nspseg",
- 0x7, "nspoff",
- 0x7, "nsp",
- 0 , 0
+ { 0x2, "fcw" },
+ { 0x3, "refresh" },
+ { 0x4, "psapseg" },
+ { 0x5, "psapoff" },
+ { 0x5, "psap" },
+ { 0x6, "nspseg" },
+ { 0x7, "nspoff" },
+ { 0x7, "nsp" },
+ { 0 , 0 }
};
static void
get_ctrl_operand (ptr, mode, dst)
char **ptr;
struct z8k_op *mode;
- unsigned int dst;
+ unsigned int dst ATTRIBUTE_UNUSED;
{
char *src = *ptr;
- int r;
int i;
while (*src == ' ')
@@ -455,23 +452,22 @@ struct flag_names {
};
struct flag_names flag_table[] = {
- 0x1, "p",
- 0x1, "v",
- 0x2, "s",
- 0x4, "z",
- 0x8, "c",
- 0x0, "+",
- 0, 0
+ { 0x1, "p" },
+ { 0x1, "v" },
+ { 0x2, "s" },
+ { 0x4, "z" },
+ { 0x8, "c" },
+ { 0x0, "+" },
+ { 0, 0 }
};
static void
get_flags_operand (ptr, mode, dst)
char **ptr;
struct z8k_op *mode;
- unsigned int dst;
+ unsigned int dst ATTRIBUTE_UNUSED;
{
char *src = *ptr;
- int r;
int i;
int j;
@@ -508,21 +504,20 @@ struct interrupt_names {
};
struct interrupt_names intr_table[] = {
- 0x1, "nvi",
- 0x2, "vi",
- 0x3, "both",
- 0x3, "all",
- 0, 0
+ { 0x1, "nvi" },
+ { 0x2, "vi" },
+ { 0x3, "both" },
+ { 0x3, "all" },
+ { 0, 0 }
};
static void
get_interrupt_operand (ptr, mode, dst)
char **ptr;
struct z8k_op *mode;
- unsigned int dst;
+ unsigned int dst ATTRIBUTE_UNUSED;
{
char *src = *ptr;
- int r;
int i;
while (*src == ' ')
@@ -555,39 +550,38 @@ struct cc_names {
};
struct cc_names table[] = {
- 0x0, "f",
- 0x1, "lt",
- 0x2, "le",
- 0x3, "ule",
- 0x4, "ov",
- 0x4, "pe",
- 0x5, "mi",
- 0x6, "eq",
- 0x6, "z",
- 0x7, "c",
- 0x7, "ult",
- 0x8, "t",
- 0x9, "ge",
- 0xa, "gt",
- 0xb, "ugt",
- 0xc, "nov",
- 0xc, "po",
- 0xd, "pl",
- 0xe, "ne",
- 0xe, "nz",
- 0xf, "nc",
- 0xf, "uge",
- 0 , 0
+ { 0x0, "f" },
+ { 0x1, "lt" },
+ { 0x2, "le" },
+ { 0x3, "ule" },
+ { 0x4, "ov" },
+ { 0x4, "pe" },
+ { 0x5, "mi" },
+ { 0x6, "eq" },
+ { 0x6, "z" },
+ { 0x7, "c" },
+ { 0x7, "ult" },
+ { 0x8, "t" },
+ { 0x9, "ge" },
+ { 0xa, "gt" },
+ { 0xb, "ugt" },
+ { 0xc, "nov" },
+ { 0xc, "po" },
+ { 0xd, "pl" },
+ { 0xe, "ne" },
+ { 0xe, "nz" },
+ { 0xf, "nc" },
+ { 0xf, "uge" },
+ { 0 , 0 }
};
static void
get_cc_operand (ptr, mode, dst)
char **ptr;
struct z8k_op *mode;
- unsigned int dst;
+ unsigned int dst ATTRIBUTE_UNUSED;
{
char *src = *ptr;
- int r;
int i;
while (*src == ' ')
@@ -616,13 +610,10 @@ static void
get_operand (ptr, mode, dst)
char **ptr;
struct z8k_op *mode;
- unsigned int dst;
+ unsigned int dst ATTRIBUTE_UNUSED;
{
char *src = *ptr;
char *end;
- unsigned int num;
- unsigned int len;
- unsigned int size;
mode->mode = 0;
@@ -774,7 +765,7 @@ get_operands (opcode, op_end, operand)
ptr = savptr;
get_operand (&ptr, operand + 0, 0);
if (ptr == 0)
- return;
+ return NULL;
if (*ptr == ',')
ptr++;
get_ctrl_operand (&ptr, operand + 1, 1);
@@ -786,7 +777,7 @@ get_operands (opcode, op_end, operand)
get_operand (&ptr, operand + 0, 0);
}
if (ptr == 0)
- return;
+ return NULL;
if (*ptr == ',')
ptr++;
get_operand (&ptr, operand + 1, 1);
@@ -838,8 +829,7 @@ get_specific (opcode, operands)
int found = 0;
unsigned int noperands = opcode->noperands;
- unsigned int dispreg;
- unsigned int this_index = opcode->idx;
+ int this_index = opcode->idx;
while (this_index == opcode->idx && !found)
{
@@ -848,7 +838,7 @@ get_specific (opcode, operands)
this_try = opcode++;
for (i = 0; i < noperands; i++)
{
- int mode = operands[i].mode;
+ unsigned int mode = operands[i].mode;
if ((mode & CLASS_MASK) != (this_try->arg_info[i] & CLASS_MASK))
{
@@ -912,6 +902,7 @@ get_specific (opcode, operands)
return 0;
}
+#if 0 /* Not used. */
static void
check_operand (operand, width, string)
struct z8k_op *operand;
@@ -935,6 +926,7 @@ check_operand (operand, width, string)
}
}
+#endif
static char buffer[20];
@@ -966,17 +958,15 @@ apply_fix (ptr, type, operand, size)
{
int n = operand->X_add_number;
- operand->X_add_number = n;
newfix ((ptr - buffer) / 2, type, operand);
-#if 1
switch (size)
{
- case 8: /* 8 nibbles == 32 bits */
+ case 8: /* 8 nibbles == 32 bits. */
*ptr++ = n >> 28;
*ptr++ = n >> 24;
*ptr++ = n >> 20;
*ptr++ = n >> 16;
- case 4: /* 4 niblles == 16 bits */
+ case 4: /* 4 nibbles == 16 bits. */
*ptr++ = n >> 12;
*ptr++ = n >> 8;
case 2:
@@ -985,9 +975,7 @@ apply_fix (ptr, type, operand, size)
*ptr++ = n >> 0;
break;
}
-#endif
return ptr;
-
}
/* Now we know what sort of opcodes it is. Let's build the bytes. */
@@ -997,16 +985,10 @@ apply_fix (ptr, type, operand, size)
static void
build_bytes (this_try, operand)
opcode_entry_type *this_try;
- struct z8k_op *operand;
+ struct z8k_op *operand ATTRIBUTE_UNUSED;
{
- unsigned int i;
-
- int length;
- char *output;
char *output_ptr = buffer;
- char part;
int c;
- char high;
int nib;
int nibble;
unsigned int *class_ptr;
@@ -1017,8 +999,7 @@ build_bytes (this_try, operand)
memset (buffer, 20, 0);
class_ptr = this_try->byte_info;
- top:
- for (nibble = 0; c = *class_ptr++; nibble++)
+ for (nibble = 0; (c = *class_ptr++); nibble++)
{
switch (c & CLASS_MASK)
@@ -1030,7 +1011,7 @@ build_bytes (this_try, operand)
/* Direct address, we don't cope with the SS mode right now. */
if (segmented_mode)
{
- da_operand->X_add_number |= 0x80000000;
+ /* da_operand->X_add_number |= 0x80000000; -- Now set at relocation time. */
output_ptr = apply_fix (output_ptr, R_IMM32, da_operand, 8);
}
else
@@ -1113,11 +1094,11 @@ build_bytes (this_try, operand)
output_ptr = apply_fix (output_ptr, R_CALLR, da_operand, 4);
break;
case ARG_DISP16:
- output_ptr = apply_fix (output_ptr, R_REL16, da_operand, 4);
- break;
- default:
- output_ptr = apply_fix (output_ptr, R_IMM16, da_operand, 4);
- }
+ output_ptr = apply_fix (output_ptr, R_REL16, da_operand, 4);
+ break;
+ default:
+ output_ptr = apply_fix (output_ptr, R_IMM16, da_operand, 4);
+ }
da_operand = 0;
break;
@@ -1180,16 +1161,13 @@ void
md_assemble (str)
char *str;
{
+ char c;
char *op_start;
char *op_end;
- unsigned int i;
struct z8k_op operand[3];
opcode_entry_type *opcode;
opcode_entry_type *prev_opcode;
- char *dot = 0;
- char c;
-
/* Drop leading whitespace. */
while (*str == ' ')
str++;
@@ -1263,21 +1241,21 @@ md_assemble (str)
void
tc_crawl_symbol_chain (headers)
- object_headers *headers;
+ object_headers *headers ATTRIBUTE_UNUSED;
{
printf (_("call to tc_crawl_symbol_chain \n"));
}
symbolS *
md_undefined_symbol (name)
- char *name;
+ char *name ATTRIBUTE_UNUSED;
{
return 0;
}
void
tc_headers_hook (headers)
- object_headers *headers;
+ object_headers *headers ATTRIBUTE_UNUSED;
{
printf (_("call to tc_headers_hook \n"));
}
@@ -1399,9 +1377,9 @@ tc_aout_fix_to_chars ()
void
md_convert_frag (headers, seg, fragP)
- object_headers *headers;
- segT seg;
- fragS *fragP;
+ object_headers *headers ATTRIBUTE_UNUSED;
+ segT seg ATTRIBUTE_UNUSED;
+ fragS *fragP ATTRIBUTE_UNUSED;
{
printf (_("call to md_convert_frag \n"));
abort ();
@@ -1481,8 +1459,8 @@ md_apply_fix (fixP, val)
int
md_estimate_size_before_relax (fragP, segment_type)
- register fragS *fragP;
- register segT segment_type;
+ register fragS *fragP ATTRIBUTE_UNUSED;
+ register segT segment_type ATTRIBUTE_UNUSED;
{
printf (_("call tomd_estimate_size_before_relax \n"));
abort ();
@@ -1501,14 +1479,14 @@ md_number_to_chars (ptr, use, nbytes)
long
md_pcrel_from (fixP)
- fixS *fixP;
+ fixS *fixP ATTRIBUTE_UNUSED;
{
abort ();
}
void
tc_coff_symbol_emit_hook (s)
- symbolS *s;
+ symbolS *s ATTRIBUTE_UNUSED;
{
}
diff --git a/gas/testsuite/gas/macros/macros.exp b/gas/testsuite/gas/macros/macros.exp
index df53db854a..b4ddefe598 100644
--- a/gas/testsuite/gas/macros/macros.exp
+++ b/gas/testsuite/gas/macros/macros.exp
@@ -30,5 +30,6 @@ if { ![istarget hppa*-*-*] || [istarget *-*-linux*] } {
# FIXME: Due to macro mishandling of ONLY_STANDARD_ESCAPES.
setup_xfail cris-*-*
setup_xfail sh*-*-*
+ setup_xfail z8k*-*-*
run_dump_test strings
}
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index cb09a71a68..2e7e09e39d 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,10 @@
+2001-06-06 Christian Groessler <cpg@aladdin.de>
+
+ * z8k-dis.c: Fix formatting.
+ (unpack_instr): Remove unused cases in switch statement. Add
+ safety abort() in default case.
+ (unparse_instr): Add safety abort() in default case.
+
2001-06-06 Peter Jakubek <pjak@snafu.de>
* opcodes/m68k-dis.c (print_insn_m68k): Fix typo.
diff --git a/opcodes/z8k-dis.c b/opcodes/z8k-dis.c
index 77c2495f49..99e25789f4 100644
--- a/opcodes/z8k-dis.c
+++ b/opcodes/z8k-dis.c
@@ -142,7 +142,7 @@ int z8k_lookup_instr PARAMS ((unsigned char *, disassemble_info *));
static void output_instr
PARAMS ((instr_data_s *, unsigned long, disassemble_info *));
static void unpack_instr PARAMS ((instr_data_s *, int, disassemble_info *));
-static void unparse_instr PARAMS ((instr_data_s *,int));
+static void unparse_instr PARAMS ((instr_data_s *, int));
static int
print_insn_z8k (addr, info, is_segmented)
@@ -334,15 +334,6 @@ unpack_instr (instr_data, is_segmented, info)
switch (datum_class)
{
- case CLASS_X:
- instr_data->address = instr_nibl;
- break;
- case CLASS_BA:
- instr_data->displacement = instr_nibl;
- break;
- case CLASS_BX:
- instr_data->arg_reg[datum_value] = instr_nibl;
- break;
case CLASS_DISP:
switch (datum_value)
{
@@ -412,12 +403,6 @@ unpack_instr (instr_data, is_segmented, info)
case CLASS_CC:
instr_data->cond_code = instr_nibl;
break;
-#if 0
- case CLASS_CTRL:
- instr_data->ctrl_code = instr_nibl;
- break;
-#endif
- case CLASS_DA:
case CLASS_ADDRESS:
if (is_segmented)
{
@@ -465,38 +450,21 @@ unpack_instr (instr_data, is_segmented, info)
case CLASS_BIT:
instr_data->ctrl_code = instr_nibl & 0x7;
break;
- case CLASS_IR:
- instr_data->arg_reg[datum_value] = instr_nibl;
- break;
case CLASS_FLAGS:
instr_data->flags = instr_nibl;
break;
case CLASS_REG:
instr_data->arg_reg[datum_value] = instr_nibl;
break;
- case CLASS_REG_BYTE:
- instr_data->arg_reg[datum_value] = instr_nibl;
- break;
- case CLASS_REG_WORD:
- instr_data->arg_reg[datum_value] = instr_nibl;
- break;
- case CLASS_REG_QUAD:
- instr_data->arg_reg[datum_value] = instr_nibl;
- break;
- case CLASS_REG_LONG:
- instr_data->arg_reg[datum_value] = instr_nibl;
- break;
case CLASS_REGN0:
instr_data->arg_reg[datum_value] = instr_nibl;
break;
- case CLASS_PR:
- instr_data->arg_reg[datum_value] = instr_nibl;
- break;
case CLASS_DISP8:
instr_data->displacement = instr_data->insn_start + 2 + (signed char)instr_byte * 2;
nibl_count += 1;
break;
default:
+ abort ();
break;
}
@@ -605,6 +573,7 @@ unparse_instr (instr_data,is_segmented)
strcat (out_str, tmp_str);
break;
default:
+ abort ();
break;
}
}