+2005-07-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * elf32-xtensa.c (vsprint_msg): Add format attribute. Fix
+ format bugs.
+ * vms.h (_bfd_vms_debug): Add format attribute.
+ (_bfd_vms_debug, _bfd_hexdump): Fix typos.
+
2005-07-07 H.J. Lu <hongjiu.lu@intel.com>
PR 975
}
-static char *
+static char * ATTRIBUTE_PRINTF(2,4)
vsprint_msg (const char *origmsg, const char *fmt, int arglen, ...)
{
/* To reduce the size of the memory leak,
else
error_message = vsprint_msg (error_message, ": (%s+0x%x)",
strlen (name) + 22,
- name, rel->r_addend);
+ name, (int)rel->r_addend);
}
if (!((*info->callbacks->reloc_dangerous)
#define SECTION_NAME_TEMPLATE "__SEC__%d"
#if VMS_DEBUG
-extern void _bfd_vms_debug (int, char *, ..);
-extern void _bfd_hexdump (int, unsignedchar *, int, int);
+extern void _bfd_vms_debug (int, char *, ...) ATTRIBUTE_PRINTF_2;
+extern void _bfd_hexdump (int, unsigned char *, int, int);
#define vms_debug _bfd_vms_debug
#endif
+2005-07-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * bucomm.h (report): Add format attribute.
+ * dlltool.c (inform): Likewise.
+ * dllwrap.c (display, inform, warn): Likewise.
+ * objdump.c (objdump_sprintf): Likewise.
+ * readelf.c (error, warn): Likewise. Fix format bugs.
+
2005-07-05 Dmitry V. Levin <ldv@altlinux.org>
Nick Clifton <nickc@redhat.com>
void bfd_fatal (const char *) ATTRIBUTE_NORETURN;
-void report (const char *, va_list);
+void report (const char *, va_list) ATTRIBUTE_PRINTF(1,0);
void fatal (const char *, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
static int alphafunc (const void *, const void *);
static void mangle_defs (void);
static void usage (FILE *, int);
-static void inform (const char *, ...);
+static void inform (const char *, ...) ATTRIBUTE_PRINTF_1;
static void set_dll_name_from_def (const char *);
static char *
static char *mybasename (const char *);
static int strhash (const char *);
static void usage (FILE *, int);
-static void display (const char *, va_list);
-static void inform (const char *, ...);
-static void warn (const char *, ...);
+static void display (const char *, va_list) ATTRIBUTE_PRINTF(1,0);
+static void inform (const char *, ...) ATTRIBUTE_PRINTF_1;
+static void warn (const char *, ...) ATTRIBUTE_PRINTF_1;
static char *look_for_prog (const char *, const char *, int);
static char *deduce_name (const char *);
static void delete_temp_files (void);
/* sprintf to a "stream". */
-static int
+static int ATTRIBUTE_PRINTF_2
objdump_sprintf (SFILE *f, const char *format, ...)
{
size_t n;
#define streq(a,b) (strcmp ((a), (b)) == 0)
#define strneq(a,b,n) (strncmp ((a), (b), (n)) == 0)
\f
-static void
+static void ATTRIBUTE_PRINTF_1
error (const char *message, ...)
{
va_list args;
va_end (args);
}
-static void
+static void ATTRIBUTE_PRINTF_1
warn (const char *message, ...)
{
va_list args;
if (fseek (file, archive_file_offset + offset, SEEK_SET))
{
- error (_("Unable to seek to 0x%x for %s\n"),
+ error (_("Unable to seek to 0x%lx for %s\n"),
archive_file_offset + offset, reason);
return NULL;
}
if (mvar == NULL)
{
- error (_("Out of memory allocating 0x%x bytes for %s\n"),
- size * nmemb, reason);
+ error (_("Out of memory allocating 0x%lx bytes for %s\n"),
+ (unsigned long)(size * nmemb), reason);
return NULL;
}
if (fread (mvar, size, nmemb, file) != nmemb)
{
- error (_("Unable to read in 0x%x bytes of %s\n"), size * nmemb, reason);
+ error (_("Unable to read in 0x%lx bytes of %s\n"),
+ (unsigned long)(size * nmemb), reason);
if (mvar != var)
free (mvar);
return NULL;
if (offset > debug_str_size)
{
- warn (_("DW_FORM_strp offset too big: %x\n"), offset);
+ warn (_("DW_FORM_strp offset too big: %lx\n"), offset);
return _("<offset is too big>");
}
break;
default:
- warn (_("Unrecognized form: %d\n"), form);
+ warn (_("Unrecognized form: %lu\n"), form);
break;
}
{
if (start < next)
warn (_("There is a hole [0x%lx - 0x%lx] in .debug_loc section.\n"),
- start - section_begin, next - section_begin);
+ (long)(start - section_begin), (long)(next - section_begin));
else if (start > next)
warn (_("There is an overlap [0x%lx - 0x%lx] in .debug_loc section.\n"),
- start - section_begin, next - section_begin);
+ (long)(start - section_begin), (long)(next - section_begin));
}
start = next;
{
if (start < next)
warn (_("There is a hole [0x%lx - 0x%lx] in .debug_ranges section.\n"),
- start - section_begin, next - section_begin);
+ (long)(start - section_begin), (long)(next - section_begin));
else if (start > next)
warn (_("There is an overlap [0x%lx - 0x%lx] in .debug_ranges section.\n"),
- start - section_begin, next - section_begin);
+ (long)(start - section_begin), (long)(next - section_begin));
}
start = next;
if (!cie)
{
- warn ("Invalid CIE pointer %08lx in FDE at %08lx\n",
+ warn ("Invalid CIE pointer %08lx in FDE at %p\n",
cie_id, saved_start);
start = block_end;
fc->ncols = 0;
if (((char *) next) > (((char *) pnotes) + length))
{
- warn (_("corrupt note found at offset %x into core notes\n"),
- ((char *) external) - ((char *) pnotes));
- warn (_(" type: %x, namesize: %08lx, descsize: %08lx\n"),
+ warn (_("corrupt note found at offset %lx into core notes\n"),
+ (long)((char *)external - (char *)pnotes));
+ warn (_(" type: %lx, namesize: %08lx, descsize: %08lx\n"),
inote.type, inote.namesz, inote.descsz);
break;
}
off = strtoul (arhdr.ar_name + 1, NULL, 10);
if (off >= longnames_size)
{
- error (_("%s: invalid archive string table offset %lu\n"), off);
+ error (_("%s: invalid archive string table offset %lu\n"), file_name, off);
ret = 1;
break;
}
if (nameend == NULL)
{
- error (_("%s: bad archive file name\n"));
+ error (_("%s: bad archive file name\n"), file_name);
ret = 1;
break;
}
+2005-07-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * config/tc-tic30.c (debug): Add format attribute. Fix format
+ bugs.
+
2005-07-06 H.J. Lu <hongjiu.lu@intel.com>
* config/tc-i386.c (cpu_arch): Add sse3.
{0, 0, 0}
};
-static int
+static int ATTRIBUTE_PRINTF_1
debug (const char *string, ...)
{
if (flag_debug)
debug ("Expression type: %d\n",
current_op->direct.direct_expr.X_op);
- debug ("Expression addnum: %d\n",
- current_op->direct.direct_expr.X_add_number);
- debug ("Segment: %d\n", retval);
+ debug ("Expression addnum: %ld\n",
+ (long) current_op->direct.direct_expr.X_add_number);
+ debug ("Segment: %p\n", retval);
input_line_pointer = save_input_line_pointer;
retval = expression (¤t_op->immediate.imm_expr);
debug ("Expression type: %d\n",
current_op->immediate.imm_expr.X_op);
- debug ("Expression addnum: %d\n",
- current_op->immediate.imm_expr.X_add_number);
- debug ("Segment: %d\n", retval);
+ debug ("Expression addnum: %ld\n",
+ (long) current_op->immediate.imm_expr.X_add_number);
+ debug ("Segment: %p\n", retval);
input_line_pointer = save_input_line_pointer;
if (current_op->immediate.imm_expr.X_op == O_constant)
debug ("Values in fixP\n");
debug ("fx_size = %d\n", fixP->fx_size);
debug ("fx_pcrel = %d\n", fixP->fx_pcrel);
- debug ("fx_where = %d\n", fixP->fx_where);
+ debug ("fx_where = %ld\n", fixP->fx_where);
debug ("fx_offset = %d\n", (int) fixP->fx_offset);
{
char *buf = fixP->fx_frag->fr_literal + fixP->fx_where;
valueT
md_section_align (segT segment, valueT size)
{
- debug ("In md_section_align() segment = %d and size = %d\n",
- segment, size);
+ debug ("In md_section_align() segment = %p and size = %lu\n",
+ segment, (unsigned long) size);
size = (size + 3) / 4;
size *= 4;
- debug ("New size value = %d\n", size);
+ debug ("New size value = %lu\n", (unsigned long) size);
return size;
}
int offset;
debug ("In md_pcrel_from()\n");
- debug ("fx_where = %d\n", fixP->fx_where);
+ debug ("fx_where = %ld\n", fixP->fx_where);
debug ("fx_size = %d\n", fixP->fx_size);
/* Find the opcode that represents the current instruction in the
fr_literal storage area, and check bit 21. Bit 21 contains whether the
+2005-07-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * dis-asm.h (fprintf_ftype): Add format attribute.
+
2005-07-03 Steve Ellcey <sje@cup.hp.com>
PR other/13906
#include <stdio.h>
#include "bfd.h"
-typedef int (*fprintf_ftype) (void *, const char*, ...);
+typedef int (*fprintf_ftype) (void *, const char*, ...) ATTRIBUTE_FPTR_PRINTF_2;
enum dis_insn_type {
dis_noninsn, /* Not a valid instruction */
+2005-07-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * arc-dis.c, arm-dis.c, cris-dis.c, crx-dis.c, d10v-dis.c,
+ d30v-dis.c, fr30-dis.c, h8300-dis.c, h8500-dis.c, i860-dis.c,
+ ia64-dis.c, ip2k-dis.c, m10200-dis.c, m10300-dis.c,
+ m88k-dis.c, mcore-dis.c, mips-dis.c, ms1-dis.c, or32-dis.c,
+ ppc-dis.c, sh64-dis.c, sparc-dis.c, tic4x-dis.c, tic80-dis.c,
+ v850-dis.c: Fix format bugs.
+ * ia64-gen.c (fail, warn): Add format attribute.
+ * or32-opc.c (debug): Likewise.
+
2005-07-07 Khem Raj <kraj@mvista.com>
* arm-dis.c (opcode32 arm_opcodes): Fix ARM VFP fadds instruction
bytes = dsmOneArcInst (address, (void *)& s);
/* Display the disassembly instruction. */
- (*func) (stream, "%08x ", s.words[0]);
+ (*func) (stream, "%08lx ", s.words[0]);
(*func) (stream, " ");
(*func) (stream, "%-10s ", s.instrBuffer);
reg = given >> bitstart;
reg &= (2 << (bitend - bitstart)) - 1;
- func (stream, "%d", reg);
+ func (stream, "%ld", reg);
}
break;
case 'W':
reg = given >> bitstart;
reg &= (2 << (bitend - bitstart)) - 1;
- func (stream, "%d", reg + 1);
+ func (stream, "%ld", reg + 1);
}
break;
case 'x':
reg = given >> bitstart;
reg &= (2 << (bitend - bitstart)) - 1;
- func (stream, "0x%08x", reg);
+ func (stream, "0x%08lx", reg);
/* Some SWI instructions have special
meanings. */
reg = given >> bitstart;
reg &= (2 << (bitend - bitstart)) - 1;
- func (stream, "%01x", reg & 0xf);
+ func (stream, "%01lx", reg & 0xf);
}
break;
case 'f':
func (stream, "#%s",
arm_fp_const[reg & 7]);
else
- func (stream, "f%d", reg);
+ func (stream, "f%ld", reg);
}
break;
long imm = (given & 0x07c0) >> 6;
if (imm == 0)
imm = 32;
- func (stream, "#%d", imm);
+ func (stream, "#%ld", imm);
}
break;
break;
case 'd':
- func (stream, "%d", reg);
+ func (stream, "%ld", reg);
break;
case 'H':
- func (stream, "%d", reg << 1);
+ func (stream, "%ld", reg << 1);
break;
case 'W':
- func (stream, "%d", reg << 2);
+ func (stream, "%ld", reg << 2);
break;
case 'a':
break;
case 'x':
- func (stream, "0x%04x", reg);
+ func (stream, "0x%04lx", reg);
break;
case 'B':
advance += 2;
/* If to print data as offsets, then shortcut here. */
- (*info->fprintf_func) (info->stream, "case %d%s: -> ",
+ (*info->fprintf_func) (info->stream, "case %ld%s: -> ",
case_offset + no_of_case_offsets
- case_offset_counter,
case_offset_counter == 1 ? "/default" :
if (matchedp == NULL)
{
- (*info->fprintf_func) (info->stream, "??0x%lx", insn);
+ (*info->fprintf_func) (info->stream, "??0x%x", insn);
advance += 2;
info->insn_type = dis_noninsn;
func (stream, "%s", string);
}
else
- func (stream, "$0x%x", a->constant);
+ func (stream, "$0x%lx", a->constant);
}
else
{
}
}
else
- func (stream, "$0x%x", a->constant);
+ func (stream, "$0x%lx", a->constant);
break;
case arg_idxr:
- func (stream, "0x%x(%s,%s,%d)", a->constant, getregname (a->r),
+ func (stream, "0x%lx(%s,%s,%d)", a->constant, getregname (a->r),
getregname (a->i_r), powerof2 (a->scale));
break;
break;
case arg_cr:
- func (stream, "0x%x(%s)", a->constant, getregname (a->r));
+ func (stream, "0x%lx(%s)", a->constant, getregname (a->r));
if (IS_INSN_TYPE (LD_STOR_INS_INC))
func (stream, "+");
}
if (!match)
- (*info->fprintf_func) (info->stream, ".long\t0x%08x", insn);
+ (*info->fprintf_func) (info->stream, ".long\t0x%08lx", insn);
if (need_paren)
(*info->fprintf_func) (info->stream, ")");
}
if (num_match == 0)
- (*info->fprintf_func) (info->stream, ".long\t0x%08x", insn);
+ (*info->fprintf_func) (info->stream, ".long\t0x%08lx", insn);
if (need_paren)
(*info->fprintf_func) (info->stream, ")");
{
info->bytes_per_line = 8;
if (!(result = lookup_opcode (&insn, in1, 0)))
- (*info->fprintf_func) (info->stream, ".long\t0x%x", in1);
+ (*info->fprintf_func) (info->stream, ".long\t0x%lx", in1);
else
print_insn (info, memaddr, (long long) in1, &insn, 0, result);
return 4;
/* LONG instruction. */
if (!(result = lookup_opcode (&insn, in1, 1)))
{
- (*info->fprintf_func) (info->stream, ".long\t0x%x,0x%x", in1, in2);
+ (*info->fprintf_func) (info->stream, ".long\t0x%lx,0x%lx", in1, in2);
return 8;
}
num = (long long) in1 << 32 | in2;
{
num = in1;
if (!(result = lookup_opcode (&insn, in1, 0)))
- (*info->fprintf_func) (info->stream, ".long\t0x%x", in1);
+ (*info->fprintf_func) (info->stream, ".long\t0x%lx", in1);
else
print_insn (info, memaddr, num, &insn, 0, result);
insn.form = NULL;
num = in2;
if (!(result = lookup_opcode (&insn, in2, 0)))
- (*info->fprintf_func) (info->stream, ".long\t0x%x", in2);
+ (*info->fprintf_func) (info->stream, ".long\t0x%lx", in2);
else
print_insn (info, memaddr, num, &insn, 0, result);
}
if (value & mask)
{
- (*info->fprintf_func) (info->stream, "r%i", index + offset);
+ (*info->fprintf_func) (info->stream, "r%li", index + offset);
comma = ",";
}
if (value & mask)
{
- (*info->fprintf_func) (info->stream, "%sr%i", comma, index + offset);
+ (*info->fprintf_func) (info->stream, "%sr%li", comma, index + offset);
comma = ",";
}
}
if ((x & SIZE) == L_16 ||
(x & SIZE) == L_16U)
{
- outfn (stream, ".%s%d (0x%x)",
+ outfn (stream, ".%s%d (0x%lx)",
(short) cst > 0 ? "+" : "",
(short) cst,
- addr + (short) cst + len);
+ (long)(addr + (short) cst + len));
}
else
{
- outfn (stream, ".%s%d (0x%x)",
+ outfn (stream, ".%s%d (0x%lx)",
(char) cst > 0 ? "+" : "",
(char) cst,
- addr + (char) cst + len);
+ (long)(addr + (char) cst + len));
}
}
else if ((x & MODE) == DISP)
func (stream, "@(0x%x:8 (%d), r%d)", disp & 0xff, disp, rd);
break;
case FPIND_D8:
- func (stream, "@(0x%x:8 (%d), fp)", disp & 0xff, disp, rn);
+ func (stream, "@(0x%x:8 (%d), fp)", disp & 0xff, disp);
break;
case CRB:
case CRW:
break;
case PCREL16:
func (stream, "0x%0x:16",
- (pcrel + addr + opcode->length) & 0xffff);
+ (int)(pcrel + addr + opcode->length) & 0xffff);
break;
case PCREL8:
func (stream, "#0x%0x:8",
- ((char) pcrel + addr + opcode->length) & 0xffff);
+ (int)((char) pcrel + addr + opcode->length) & 0xffff);
break;
case QIM:
func (stream, "#%d:q", qim);
long adj = (long)memaddr + 4 + (val << 2);
- (*info->fprintf_func) (info->stream, "0x%08x", adj);
+ (*info->fprintf_func) (info->stream, "0x%08lx", adj);
/* Attempt to obtain a symbol for the target address. */
if (slotnum == 0)
(*info->fprintf_func) (info->stream, "[%s] ", tname);
else
- (*info->fprintf_func) (info->stream, " ", tname);
+ (*info->fprintf_func) (info->stream, " ");
unit = ia64_templ_desc[template].exec_unit[slotnum];
if (str)
(*info->fprintf_func) (info->stream, "%s", str);
else if (odesc->flags & IA64_OPND_FLAG_DECIMAL_SIGNED)
- (*info->fprintf_func) (info->stream, "%lld", value);
+ (*info->fprintf_func) (info->stream, "%lld", (long long) value);
else if (odesc->flags & IA64_OPND_FLAG_DECIMAL_UNSIGNED)
- (*info->fprintf_func) (info->stream, "%llu", value);
+ (*info->fprintf_func) (info->stream, "%llu", (long long) value);
else
- (*info->fprintf_func) (info->stream, "0x%llx", value);
+ (*info->fprintf_func) (info->stream, "0x%llx", (long long) value);
break;
case IA64_OPND_CLASS_REL:
return retval;
decoding_failed:
- (*info->fprintf_func) (info->stream, " data8 %#011llx", insn);
+ (*info->fprintf_func) (info->stream, " data8 %#011llx", (long long) insn);
goto failed;
}
static int dlisttotlen = 0;
-static void fail (const char *, ...);
-static void warn (const char *, ...);
+static void fail (const char *, ...) ATTRIBUTE_PRINTF_1;
+static void warn (const char *, ...) ATTRIBUTE_PRINTF_1;
static struct rdep * insert_resource (const char *, enum ia64_dependency_mode);
static int deplist_equals (struct deplist *, struct deplist *);
static short insert_deplist (int, unsigned short *);
if (offsetvalue == 0)
(*info->fprintf_func) (info->stream, "%s","(DP)");
else
- (*info->fprintf_func) (info->stream, "$%x%s",offsetvalue, "(DP)");
+ (*info->fprintf_func) (info->stream, "$%lx%s",offsetvalue, "(DP)");
return;
}
if (offsetvalue == 0)
(*info->fprintf_func) (info->stream, "%s", "(SP)");
else
- (*info->fprintf_func) (info->stream, "$%x%s", offsetvalue,"(SP)");
+ (*info->fprintf_func) (info->stream, "$%lx%s", offsetvalue,"(SP)");
return;
}
(*info->fprintf_func) (info->stream, "%s", ke->name);
else
/* Print as an address literal. */
- (*info->fprintf_func) (info->stream, "$%02x", value);
+ (*info->fprintf_func) (info->stream, "$%02lx", value);
}
static void
{
disassemble_info *info = (disassemble_info *) dis_info;
- (*info->fprintf_func) (info->stream, "$%x", value);
+ (*info->fprintf_func) (info->stream, "$%lx", value);
}
static void
{
disassemble_info *info = (disassemble_info *) dis_info;
- (*info->fprintf_func) (info->stream, "$%02x", value);
+ (*info->fprintf_func) (info->stream, "$%02lx", value);
}
static void
by 8 bits so that disassembled code will reassemble properly. */
value = ((value << 8) & 0xFF00);
- (*info->fprintf_func) (info->stream, "$%04x", value);
+ (*info->fprintf_func) (info->stream, "$%04lx", value);
}
static void
{
disassemble_info *info = (disassemble_info *) dis_info;
- (*info->fprintf_func) (info->stream, "$%04x", value);
+ (*info->fprintf_func) (info->stream, "$%04lx", value);
}
static void
value = ((value << 14) & 0x1C000);
;value = (value & 0x1FFFF);
- (*info->fprintf_func) (info->stream, "$%05x", value);
+ (*info->fprintf_func) (info->stream, "$%05lx", value);
}
static void
disassemble_info *info = (disassemble_info *) dis_info;
value = ((value << 1) & 0x1FFFF);
- (*info->fprintf_func) (info->stream, "$%05x", value);
+ (*info->fprintf_func) (info->stream, "$%05lx", value);
}
static void
{
disassemble_info *info = (disassemble_info *) dis_info;
- (*info->fprintf_func) (info->stream, "%d", value);
+ (*info->fprintf_func) (info->stream, "%ld", value);
}
{
value = ((insn >> (operand->shift + extra_shift))
& ((1 << operand->bits) - 1));
- (*info->fprintf_func) (info->stream, "d%d", value);
+ (*info->fprintf_func) (info->stream, "d%ld", value);
}
else if ((operand->flags & MN10200_OPERAND_AREG) != 0)
{
value = ((insn >> (operand->shift + extra_shift))
& ((1 << operand->bits) - 1));
- (*info->fprintf_func) (info->stream, "a%d", value);
+ (*info->fprintf_func) (info->stream, "a%ld", value);
}
else if ((operand->flags & MN10200_OPERAND_PSW) != 0)
}
else
{
- (*info->fprintf_func) (info->stream, _("unknown\t0x%02x"), insn);
+ (*info->fprintf_func) (info->stream, _("unknown\t0x%02lx"), insn);
return 1;
}
value = ((insn >> (operand->shift + extra_shift))
& ((1 << operand->bits) - 1));
if (value == 0)
- (*info->fprintf_func) (info->stream, "sp", value);
+ (*info->fprintf_func) (info->stream, "sp");
else
(*info->fprintf_func) (info->stream, "xr%d", (int) value);
}
if (!match)
/* xgettext:c-format */
- (*info->fprintf_func) (info->stream, _("unknown\t0x%04x"), insn);
+ (*info->fprintf_func) (info->stream, _("unknown\t0x%04lx"), insn);
}
int
default:
/* xgettext:c-format */
- (*info->fprintf_func) (info->stream, _("# <dis error: %08x>"), inst);
+ (*info->fprintf_func) (info->stream, _("# <dis error: %08lx>"), inst);
}
}
;
if (entry_ptr == NULL)
- (*info->fprintf_func) (info->stream, "word\t%08x", instruction);
+ (*info->fprintf_func) (info->stream, "word\t%08lx", instruction);
else
{
(*info->fprintf_func) (info->stream, "%s", entry_ptr->instr->mnemonic);
if (inst & 0x400)
val |= 0xFFFFFC00;
- fprintf (stream, "\t0x%x", memaddr + 2 + (val << 1));
+ fprintf (stream, "\t0x%lx", (long)(memaddr + 2 + (val << 1)));
if (strcmp (op->name, "bsr") == 0)
{
{
long val;
val = (inst & 0x000F);
- fprintf (stream, "\t%s, 0x%x",
- grname[(inst >> 4) & 0xF], memaddr - (val << 1));
+ fprintf (stream, "\t%s, 0x%lx",
+ grname[(inst >> 4) & 0xF], (long)(memaddr - (val << 1)));
}
break;
| (ibytes[2] << 8) | (ibytes[3]);
/* Removed [] around literal value to match ABI syntax 12/95. */
- fprintf (stream, "\t%s, 0x%X", grname[(inst >> 8) & 0xF], val);
+ fprintf (stream, "\t%s, 0x%lX", grname[(inst >> 8) & 0xF], val);
if (val == 0)
- fprintf (stream, "\t// from address pool at 0x%x",
- (memaddr + 2 + ((inst & 0xFF) << 2)) & 0xFFFFFFFC);
+ fprintf (stream, "\t// from address pool at 0x%lx",
+ (long)(memaddr + 2 + ((inst & 0xFF) << 2)) & 0xFFFFFFFC);
}
break;
| (ibytes[2] << 8) | (ibytes[3]);
/* Removed [] around literal value to match ABI syntax 12/95. */
- fprintf (stream, "\t0x%X", val);
+ fprintf (stream, "\t0x%lX", val);
/* For jmpi/jsri, we'll try to get a symbol for the target. */
if (info->print_address_func && val != 0)
{
}
else
{
- fprintf (stream, "\t// from address pool at 0x%x",
- (memaddr + 2 + ((inst & 0xFF) << 2)) & 0xFFFFFFFC);
+ fprintf (stream, "\t// from address pool at 0x%lx",
+ (long)(memaddr + 2 + ((inst & 0xFF) << 2)) & 0xFFFFFFFC);
}
}
break;
case 'i':
case 'u':
- (*info->fprintf_func) (info->stream, "0x%x",
+ (*info->fprintf_func) (info->stream, "0x%lx",
(l >> OP_SH_IMMEDIATE) & OP_MASK_IMMEDIATE);
break;
break;
case '<':
- (*info->fprintf_func) (info->stream, "0x%x",
+ (*info->fprintf_func) (info->stream, "0x%lx",
(l >> OP_SH_SHAMT) & OP_MASK_SHAMT);
break;
case 'c':
- (*info->fprintf_func) (info->stream, "0x%x",
+ (*info->fprintf_func) (info->stream, "0x%lx",
(l >> OP_SH_CODE) & OP_MASK_CODE);
break;
case 'q':
- (*info->fprintf_func) (info->stream, "0x%x",
+ (*info->fprintf_func) (info->stream, "0x%lx",
(l >> OP_SH_CODE2) & OP_MASK_CODE2);
break;
case 'C':
- (*info->fprintf_func) (info->stream, "0x%x",
+ (*info->fprintf_func) (info->stream, "0x%lx",
(l >> OP_SH_COPZ) & OP_MASK_COPZ);
break;
case 'B':
- (*info->fprintf_func) (info->stream, "0x%x",
+ (*info->fprintf_func) (info->stream, "0x%lx",
+
(l >> OP_SH_CODE20) & OP_MASK_CODE20);
break;
case 'J':
- (*info->fprintf_func) (info->stream, "0x%x",
+ (*info->fprintf_func) (info->stream, "0x%lx",
(l >> OP_SH_CODE19) & OP_MASK_CODE19);
break;
'T' format. Therefore, until we gain understanding of
cp2 register names, we can simply print the register
numbers. */
- (*info->fprintf_func) (info->stream, "$%d",
+ (*info->fprintf_func) (info->stream, "$%ld",
(l >> OP_SH_RT) & OP_MASK_RT);
break;
(*info->fprintf_func) (info->stream, "%s",
mips_cp0_names[(l >> OP_SH_RD) & OP_MASK_RD]);
else
- (*info->fprintf_func) (info->stream, "$%d",
+ (*info->fprintf_func) (info->stream, "$%ld",
(l >> OP_SH_RD) & OP_MASK_RD);
break;
break;
case 'N':
- (*info->fprintf_func) (info->stream, "$fcc%d",
+ (*info->fprintf_func) (info->stream, "$fcc%ld",
(l >> OP_SH_BCC) & OP_MASK_BCC);
break;
case 'M':
- (*info->fprintf_func) (info->stream, "$fcc%d",
+ (*info->fprintf_func) (info->stream, "$fcc%ld",
(l >> OP_SH_CCC) & OP_MASK_CCC);
break;
case 'P':
- (*info->fprintf_func) (info->stream, "%d",
+ (*info->fprintf_func) (info->stream, "%ld",
(l >> OP_SH_PERFREG) & OP_MASK_PERFREG);
break;
case 'e':
- (*info->fprintf_func) (info->stream, "%d",
+ (*info->fprintf_func) (info->stream, "%ld",
(l >> OP_SH_VECBYTE) & OP_MASK_VECBYTE);
break;
case '%':
- (*info->fprintf_func) (info->stream, "%d",
+ (*info->fprintf_func) (info->stream, "%ld",
(l >> OP_SH_VECALIGN) & OP_MASK_VECALIGN);
break;
case 'H':
- (*info->fprintf_func) (info->stream, "%d",
+ (*info->fprintf_func) (info->stream, "%ld",
(l >> OP_SH_SEL) & OP_MASK_SEL);
break;
case 'O':
- (*info->fprintf_func) (info->stream, "%d",
+ (*info->fprintf_func) (info->stream, "%ld",
(l >> OP_SH_ALN) & OP_MASK_ALN);
break;
for (fmt = 0; fmt < 3; fmt++, vsel >>= 1)
if ((vsel & 1) == 0)
break;
- (*info->fprintf_func) (info->stream, "$v%d[%d]",
+ (*info->fprintf_func) (info->stream, "$v%ld[%d]",
(l >> OP_SH_FT) & OP_MASK_FT,
vsel >> 1);
}
else if ((vsel & 0x08) == 0)
{
- (*info->fprintf_func) (info->stream, "$v%d",
+ (*info->fprintf_func) (info->stream, "$v%ld",
(l >> OP_SH_FT) & OP_MASK_FT);
}
else
{
- (*info->fprintf_func) (info->stream, "0x%x",
+ (*info->fprintf_func) (info->stream, "0x%lx",
(l >> OP_SH_FT) & OP_MASK_FT);
}
}
break;
case 'X':
- (*info->fprintf_func) (info->stream, "$v%d",
+ (*info->fprintf_func) (info->stream, "$v%ld",
(l >> OP_SH_FD) & OP_MASK_FD);
break;
case 'Y':
- (*info->fprintf_func) (info->stream, "$v%d",
+ (*info->fprintf_func) (info->stream, "$v%ld",
(l >> OP_SH_FS) & OP_MASK_FS);
break;
case 'Z':
- (*info->fprintf_func) (info->stream, "$v%d",
+ (*info->fprintf_func) (info->stream, "$v%ld",
(l >> OP_SH_FT) & OP_MASK_FT);
break;
/* Handle undefined instructions. */
info->insn_type = dis_noninsn;
- (*info->fprintf_func) (info->stream, "0x%x", word);
+ (*info->fprintf_func) (info->stream, "0x%lx", word);
return INSNLEN;
}
\f
{
disassemble_info *info = (disassemble_info *) dis_info;
- info->fprintf_func (info->stream, "$%x", value);
+ info->fprintf_func (info->stream, "$%lx", value);
if (0)
print_normal (cd, dis_info, value, attrs, pc, length);
/* This used to be %8x for binutils. */
(*info->fprintf_func)
- (info->stream, ".word 0x%08x", insn);
+ (info->stream, ".word 0x%08lx", insn);
return 4;
}
/* Define dummy, if debug is not defined. */
#if !defined HAS_DEBUG
-static void
+static void ATTRIBUTE_PRINTF_2
debug (int level ATTRIBUTE_UNUSED, const char *format ATTRIBUTE_UNUSED, ...)
{
}
last_match = i;
}
- debug (8, "%08X %08X\n", mask, cur_mask);
+ debug (8, "%08X %08lX\n", mask, cur_mask);
if (ninstr == 0)
return 0;
if (ninstr == 1)
{
/* Leaf holds instruction index. */
- debug (8, "%i>I%i %s\n",
- cur - automata, last_match, or32_opcodes[last_match].name);
+ debug (8, "%li>I%i %s\n",
+ (long)(cur - automata), last_match, or32_opcodes[last_match].name);
*cur = LEAF_FLAG | last_match;
cur++;
{
unsigned long m = (1UL << ((unsigned long) len)) - 1;
- debug (9, " (%i(%08X & %08X>>%i = %08X, %08X)",
+ debug (9, " (%i(%08lX & %08lX>>%i = %08lX, %08lX)",
len,m, cur_mask, i, (cur_mask >> (unsigned)i),
(cur_mask >> (unsigned) i) & m);
exit (1);
}
- debug (8, "%i> #### %i << %i (%i) ####\n",
- cur - automata, best_len, best_first, ninstr);
+ debug (8, "%li> #### %i << %i (%i) ####\n",
+ (long)(cur - automata), best_len, best_first, ninstr);
*cur = best_first;
cur++;
&& ((ti[j].insn_mask >> best_first) & cur_mask) == cur_mask)
ti[j].in_pass = curpass;
- debug (9, "%08X %08X %i\n", mask, cur_mask, best_first);
+ debug (9, "%08X %08lX %i\n", mask, cur_mask, best_first);
c = cover_insn (cur, curpass, mask & (~(cur_mask << best_first)));
if (c)
{
- debug (8, "%i> #%X -> %u\n", next - automata, i, cur - automata);
+ debug (8, "%li> #%X -> %lu\n", (long)(next - automata), i, (long)(cur - automata));
*next = cur - automata;
cur = c;
}
else
{
- debug (8, "%i> N/A\n", next - automata);
+ debug (8, "%li> N/A\n", (long)(next - automata));
*next = 0;
}
next++;
{
cur->type = OPTYPE_REG | OPTYPE_OP | OPTYPE_LAST;
cur->data = 0;
- debug (9, "#%08X %08X\n", cur->type, cur->data);
+ debug (9, "#%08lX %08lX\n", cur->type, cur->data);
cur++;
return cur;
}
unsigned long arg;
arg = insn_extract (*args, opcode->encoding);
- debug (9, "%s : %08X ------\n", opcode->name, arg);
+ debug (9, "%s : %08lX ------\n", opcode->name, arg);
if (letter_signed (*args))
{
type |= OPTYPE_SIG;
cur->type = type | shr;
cur->data = mask;
arg &= ~(((1 << mask) - 1) << shr);
- debug (6, "|%08X %08X\n", cur->type, cur->data);
+ debug (6, "|%08lX %08lX\n", cur->type, cur->data);
cur++;
}
args++;
Later we will treat them as one operand. */
cur--;
cur->type = type | cur->type | OPTYPE_DIS | OPTYPE_OP;
- debug (9, ">%08X %08X\n", cur->type, cur->data);
+ debug (9, ">%08lX %08lX\n", cur->type, cur->data);
cur++;
type = 0;
i++;
{
cur--;
cur->type = type | cur->type | OPTYPE_OP;
- debug (9, ">%08X %08X\n", cur->type, cur->data);
+ debug (9, ">%08lX %08lX\n", cur->type, cur->data);
cur++;
type = 0;
i++;
{
cur->type = type;
cur->data = 0;
- debug (9, ">%08X %08X\n", cur->type, cur->data);
+ debug (9, ">%08lX %08lX\n", cur->type, cur->data);
cur++;
type = 0;
i++;
cur--;
cur->type = type | cur->type | OPTYPE_OP | OPTYPE_LAST;
- debug (9, "#%08X %08X\n", cur->type, cur->data);
+ debug (9, "#%08lX %08lX\n", cur->type, cur->data);
cur++;
return cur;
{
unsigned int first = *a;
- debug (9, "%i ", a - automata);
+ debug (9, "%li ", (long)(a - automata));
a++;
i = (insn >> first) & *a;
if (!*(a + i))
{
/* Invalid instruction found? */
- debug (9, "XXX\n", i);
+ debug (9, "XXX\n");
return -1;
}
a = automata + *(a + i);
else
{
if (operand->bits == 3)
- (*info->fprintf_func) (info->stream, "cr%d", value);
+ (*info->fprintf_func) (info->stream, "cr%ld", value);
else
{
static const char *cbnames[4] = { "lt", "gt", "eq", "so" };
/* FIXME: We should also check register number constraints. */
if (op->name == NULL)
{
- fprintf_fn (stream, ".long 0x%08x", instruction);
+ fprintf_fn (stream, ".long 0x%08lx", instruction);
return 4;
}
imm = temp & 0x3f;
if (imm & (unsigned long) 0x20)
imm |= ~(unsigned long) 0x3f;
- fprintf_fn (stream, "%d", imm);
+ fprintf_fn (stream, "%ld", imm);
break;
/* A signed 6-bit number, multiplied by 32 when used. */
imm = temp & 0x3f;
if (imm & (unsigned long) 0x20)
imm |= ~(unsigned long) 0x3f;
- fprintf_fn (stream, "%d", imm * 32);
+ fprintf_fn (stream, "%ld", imm * 32);
break;
/* A signed 10-bit number, multiplied by 8 when used. */
if (imm & (unsigned long) 0x200)
imm |= ~(unsigned long) 0x3ff;
imm <<= by_number;
- fprintf_fn (stream, "%d", imm);
+ fprintf_fn (stream, "%ld", imm);
break;
/* A signed 16-bit number. */
imm = temp & 0xffff;
if (imm & (unsigned long) 0x8000)
imm |= ~((unsigned long) 0xffff);
- fprintf_fn (stream, "%d", imm);
+ fprintf_fn (stream, "%ld", imm);
break;
/* A PC-relative signed 16-bit number, multiplied by 4 when
/* An unsigned 5-bit number. */
case A_IMMU5:
imm = temp & 0x1f;
- fprintf_fn (stream, "%d", imm);
+ fprintf_fn (stream, "%ld", imm);
break;
/* An unsigned 6-bit number. */
case A_IMMU6:
imm = temp & 0x3f;
- fprintf_fn (stream, "%d", imm);
+ fprintf_fn (stream, "%ld", imm);
break;
/* An unsigned 16-bit number. */
case A_IMMU16:
imm = temp & 0xffff;
- fprintf_fn (stream, "%d", imm);
+ fprintf_fn (stream, "%ld", imm);
break;
default:
break;
case '3':
- (info->fprintf_func) (stream, "%d", X_IMM (insn, 3));
+ (info->fprintf_func) (stream, "%ld", X_IMM (insn, 3));
break;
case 'K':
if (name)
(*info->fprintf_func) (stream, "%s", name);
else
- (*info->fprintf_func) (stream, "%d", X_RD (insn));
+ (*info->fprintf_func) (stream, "%ld", X_RD (insn));
break;
}
case 'M':
- (*info->fprintf_func) (stream, "%%asr%d", X_RS1 (insn));
+ (*info->fprintf_func) (stream, "%%asr%ld", X_RS1 (insn));
break;
case 'm':
- (*info->fprintf_func) (stream, "%%asr%d", X_RD (insn));
+ (*info->fprintf_func) (stream, "%%asr%ld", X_RD (insn));
break;
case 'L':
if (name)
(*info->fprintf_func) (stream, "%s", name);
else
- (*info->fprintf_func) (stream, "(%d)", X_ASI (insn));
+ (*info->fprintf_func) (stream, "(%ld)", X_ASI (insn));
break;
}
break;
case 'x':
- (*info->fprintf_func) (stream, "%d",
+ (*info->fprintf_func) (stream, "%ld",
((X_LDST_I (insn) << 8)
+ X_ASI (insn)));
break;
{
case IMMED_SINT:
case IMMED_INT:
- (*info->fprintf_func) (info->stream, "%d", (long) arg);
+ (*info->fprintf_func) (info->stream, "%ld", (long) arg);
break;
case IMMED_SUINT:
case IMMED_UINT:
- (*info->fprintf_func) (info->stream, "%u", arg);
+ (*info->fprintf_func) (info->stream, "%lu", arg);
break;
case IMMED_SFLOAT:
&& tic4x_print_op (NULL, instruction, p, pc))
tic4x_print_op (info, instruction, p, pc);
else
- (*info->fprintf_func) (info->stream, "%08x", instruction);
+ (*info->fprintf_func) (info->stream, "%08lx", instruction);
}
else
{
break;
}
if (i == TIC4X_SPESOP_SIZE)
- (*info->fprintf_func) (info->stream, "%08x", instruction);
+ (*info->fprintf_func) (info->stream, "%08lx", instruction);
}
/* Return size of insn in words. */
if (tmp != NULL)
(*info->fprintf_func) (info->stream, "%s", tmp);
else
- (*info->fprintf_func) (info->stream, "%ld", bitnum);
+ (*info->fprintf_func) (info->stream, "%d", bitnum);
}
\f
/* Print the operand as directed by the flags. */
info->fprintf_func (info->stream, "ep");
break;
default:
- info->fprintf_func (info->stream, "%d", value);
+ info->fprintf_func (info->stream, "%ld", value);
break;
case V850_OPERAND_DISP:
{
if ((insn & 0x001fffc0) == 0x00130780)
value <<= 16;
- info->fprintf_func (info->stream, "0x%x", value);
+ info->fprintf_func (info->stream, "0x%lx", value);
}
else
info->memory_error_func (status, memaddr + bytes_read,
if (!match)
{
if (short_op)
- info->fprintf_func (info->stream, ".short\t0x%04x", insn);
+ info->fprintf_func (info->stream, ".short\t0x%04lx", insn);
else
- info->fprintf_func (info->stream, ".long\t0x%08x", insn);
+ info->fprintf_func (info->stream, ".long\t0x%08lx", insn);
}
return bytes_read;