Kaveh Ghazi's printf format attribute checking patch.

bfd:
	* 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.

binutils:
	* 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.

gas:
	* config/tc-tic30.c (debug): Add format attribute.  Fix format
	bugs.

include:
	* dis-asm.h (fprintf_ftype): Add format attribute.

opcodes:
	* 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.
This commit is contained in:
Jim Wilson 2005-07-07 19:27:52 +00:00
parent 9968d831f9
commit 0fd3a4776c
41 changed files with 212 additions and 175 deletions

View File

@ -1,3 +1,10 @@
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> 2005-07-07 H.J. Lu <hongjiu.lu@intel.com>
PR 975 PR 975

View File

@ -1775,7 +1775,7 @@ elf_xtensa_do_reloc (reloc_howto_type *howto,
} }
static char * static char * ATTRIBUTE_PRINTF(2,4)
vsprint_msg (const char *origmsg, const char *fmt, int arglen, ...) vsprint_msg (const char *origmsg, const char *fmt, int arglen, ...)
{ {
/* To reduce the size of the memory leak, /* To reduce the size of the memory leak,
@ -2355,7 +2355,7 @@ elf_xtensa_relocate_section (bfd *output_bfd,
else else
error_message = vsprint_msg (error_message, ": (%s+0x%x)", error_message = vsprint_msg (error_message, ": (%s+0x%x)",
strlen (name) + 22, strlen (name) + 22,
name, rel->r_addend); name, (int)rel->r_addend);
} }
if (!((*info->callbacks->reloc_dangerous) if (!((*info->callbacks->reloc_dangerous)

View File

@ -620,8 +620,8 @@ struct vms_private_data_struct
#define SECTION_NAME_TEMPLATE "__SEC__%d" #define SECTION_NAME_TEMPLATE "__SEC__%d"
#if VMS_DEBUG #if VMS_DEBUG
extern void _bfd_vms_debug (int, char *, ..); extern void _bfd_vms_debug (int, char *, ...) ATTRIBUTE_PRINTF_2;
extern void _bfd_hexdump (int, unsignedchar *, int, int); extern void _bfd_hexdump (int, unsigned char *, int, int);
#define vms_debug _bfd_vms_debug #define vms_debug _bfd_vms_debug
#endif #endif

View File

@ -1,3 +1,11 @@
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> 2005-07-05 Dmitry V. Levin <ldv@altlinux.org>
Nick Clifton <nickc@redhat.com> Nick Clifton <nickc@redhat.com>

View File

@ -159,7 +159,7 @@ void bfd_nonfatal (const char *);
void bfd_fatal (const char *) ATTRIBUTE_NORETURN; 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; void fatal (const char *, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;

View File

@ -708,7 +708,7 @@ static void fill_ordinals (export_type **);
static int alphafunc (const void *, const void *); static int alphafunc (const void *, const void *);
static void mangle_defs (void); static void mangle_defs (void);
static void usage (FILE *, int); 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 void set_dll_name_from_def (const char *);
static char * static char *

View File

@ -118,9 +118,9 @@ static int run (const char *, char *);
static char *mybasename (const char *); static char *mybasename (const char *);
static int strhash (const char *); static int strhash (const char *);
static void usage (FILE *, int); static void usage (FILE *, int);
static void display (const char *, va_list); static void display (const char *, va_list) ATTRIBUTE_PRINTF(1,0);
static void inform (const char *, ...); static void inform (const char *, ...) ATTRIBUTE_PRINTF_1;
static void warn (const char *, ...); static void warn (const char *, ...) ATTRIBUTE_PRINTF_1;
static char *look_for_prog (const char *, const char *, int); static char *look_for_prog (const char *, const char *, int);
static char *deduce_name (const char *); static char *deduce_name (const char *);
static void delete_temp_files (void); static void delete_temp_files (void);

View File

@ -1189,7 +1189,7 @@ typedef struct
/* sprintf to a "stream". */ /* sprintf to a "stream". */
static int static int ATTRIBUTE_PRINTF_2
objdump_sprintf (SFILE *f, const char *format, ...) objdump_sprintf (SFILE *f, const char *format, ...)
{ {
size_t n; size_t n;

View File

@ -264,7 +264,7 @@ static void (*byte_put) (unsigned char *, bfd_vma, int);
#define streq(a,b) (strcmp ((a), (b)) == 0) #define streq(a,b) (strcmp ((a), (b)) == 0)
#define strneq(a,b,n) (strncmp ((a), (b), (n)) == 0) #define strneq(a,b,n) (strncmp ((a), (b), (n)) == 0)
static void static void ATTRIBUTE_PRINTF_1
error (const char *message, ...) error (const char *message, ...)
{ {
va_list args; va_list args;
@ -275,7 +275,7 @@ error (const char *message, ...)
va_end (args); va_end (args);
} }
static void static void ATTRIBUTE_PRINTF_1
warn (const char *message, ...) warn (const char *message, ...)
{ {
va_list args; va_list args;
@ -327,7 +327,7 @@ get_data (void *var, FILE *file, long offset, size_t size, size_t nmemb,
if (fseek (file, archive_file_offset + offset, SEEK_SET)) 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); archive_file_offset + offset, reason);
return NULL; return NULL;
} }
@ -342,8 +342,8 @@ get_data (void *var, FILE *file, long offset, size_t size, size_t nmemb,
if (mvar == NULL) if (mvar == NULL)
{ {
error (_("Out of memory allocating 0x%x bytes for %s\n"), error (_("Out of memory allocating 0x%lx bytes for %s\n"),
size * nmemb, reason); (unsigned long)(size * nmemb), reason);
return NULL; return NULL;
} }
@ -352,7 +352,8 @@ get_data (void *var, FILE *file, long offset, size_t size, size_t nmemb,
if (fread (mvar, size, nmemb, file) != nmemb) 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) if (mvar != var)
free (mvar); free (mvar);
return NULL; return NULL;
@ -7453,7 +7454,7 @@ fetch_indirect_string (unsigned long offset)
if (offset > debug_str_size) 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>"); return _("<offset is too big>");
} }
@ -8464,7 +8465,7 @@ read_and_display_attr_value (unsigned long attribute,
break; break;
default: default:
warn (_("Unrecognized form: %d\n"), form); warn (_("Unrecognized form: %lu\n"), form);
break; break;
} }
@ -9799,10 +9800,10 @@ display_debug_loc (Elf_Internal_Shdr *section,
{ {
if (start < next) if (start < next)
warn (_("There is a hole [0x%lx - 0x%lx] in .debug_loc section.\n"), 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) else if (start > next)
warn (_("There is an overlap [0x%lx - 0x%lx] in .debug_loc section.\n"), 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; start = next;
@ -10152,10 +10153,10 @@ display_debug_ranges (Elf_Internal_Shdr *section,
{ {
if (start < next) if (start < next)
warn (_("There is a hole [0x%lx - 0x%lx] in .debug_ranges section.\n"), 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) else if (start > next)
warn (_("There is an overlap [0x%lx - 0x%lx] in .debug_ranges section.\n"), 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; start = next;
@ -10528,7 +10529,7 @@ display_debug_frames (Elf_Internal_Shdr *section,
if (!cie) 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); cie_id, saved_start);
start = block_end; start = block_end;
fc->ncols = 0; fc->ncols = 0;
@ -11814,9 +11815,9 @@ process_corefile_note_segment (FILE *file, bfd_vma offset, bfd_vma length)
if (((char *) next) > (((char *) pnotes) + length)) if (((char *) next) > (((char *) pnotes) + length))
{ {
warn (_("corrupt note found at offset %x into core notes\n"), warn (_("corrupt note found at offset %lx into core notes\n"),
((char *) external) - ((char *) pnotes)); (long)((char *)external - (char *)pnotes));
warn (_(" type: %x, namesize: %08lx, descsize: %08lx\n"), warn (_(" type: %lx, namesize: %08lx, descsize: %08lx\n"),
inote.type, inote.namesz, inote.descsz); inote.type, inote.namesz, inote.descsz);
break; break;
} }
@ -12295,7 +12296,7 @@ process_archive (char *file_name, FILE *file)
off = strtoul (arhdr.ar_name + 1, NULL, 10); off = strtoul (arhdr.ar_name + 1, NULL, 10);
if (off >= longnames_size) 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; ret = 1;
break; break;
} }
@ -12311,7 +12312,7 @@ process_archive (char *file_name, FILE *file)
if (nameend == NULL) if (nameend == NULL)
{ {
error (_("%s: bad archive file name\n")); error (_("%s: bad archive file name\n"), file_name);
ret = 1; ret = 1;
break; break;
} }

View File

@ -1,3 +1,8 @@
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> 2005-07-06 H.J. Lu <hongjiu.lu@intel.com>
* config/tc-i386.c (cpu_arch): Add sse3. * config/tc-i386.c (cpu_arch): Add sse3.

View File

@ -86,7 +86,7 @@ const pseudo_typeS md_pseudo_table[] =
{0, 0, 0} {0, 0, 0}
}; };
static int static int ATTRIBUTE_PRINTF_1
debug (const char *string, ...) debug (const char *string, ...)
{ {
if (flag_debug) if (flag_debug)
@ -439,9 +439,9 @@ tic30_operand (char *token)
debug ("Expression type: %d\n", debug ("Expression type: %d\n",
current_op->direct.direct_expr.X_op); current_op->direct.direct_expr.X_op);
debug ("Expression addnum: %d\n", debug ("Expression addnum: %ld\n",
current_op->direct.direct_expr.X_add_number); (long) current_op->direct.direct_expr.X_add_number);
debug ("Segment: %d\n", retval); debug ("Segment: %p\n", retval);
input_line_pointer = save_input_line_pointer; input_line_pointer = save_input_line_pointer;
@ -609,9 +609,9 @@ tic30_operand (char *token)
retval = expression (&current_op->immediate.imm_expr); retval = expression (&current_op->immediate.imm_expr);
debug ("Expression type: %d\n", debug ("Expression type: %d\n",
current_op->immediate.imm_expr.X_op); current_op->immediate.imm_expr.X_op);
debug ("Expression addnum: %d\n", debug ("Expression addnum: %ld\n",
current_op->immediate.imm_expr.X_add_number); (long) current_op->immediate.imm_expr.X_add_number);
debug ("Segment: %d\n", retval); debug ("Segment: %p\n", retval);
input_line_pointer = save_input_line_pointer; input_line_pointer = save_input_line_pointer;
if (current_op->immediate.imm_expr.X_op == O_constant) if (current_op->immediate.imm_expr.X_op == O_constant)
@ -1140,7 +1140,7 @@ md_apply_fix (fixS *fixP,
debug ("Values in fixP\n"); debug ("Values in fixP\n");
debug ("fx_size = %d\n", fixP->fx_size); debug ("fx_size = %d\n", fixP->fx_size);
debug ("fx_pcrel = %d\n", fixP->fx_pcrel); 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); debug ("fx_offset = %d\n", (int) fixP->fx_offset);
{ {
char *buf = fixP->fx_frag->fr_literal + fixP->fx_where; char *buf = fixP->fx_frag->fr_literal + fixP->fx_where;
@ -1182,11 +1182,11 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
valueT valueT
md_section_align (segT segment, valueT size) md_section_align (segT segment, valueT size)
{ {
debug ("In md_section_align() segment = %d and size = %d\n", debug ("In md_section_align() segment = %p and size = %lu\n",
segment, size); segment, (unsigned long) size);
size = (size + 3) / 4; size = (size + 3) / 4;
size *= 4; size *= 4;
debug ("New size value = %d\n", size); debug ("New size value = %lu\n", (unsigned long) size);
return size; return size;
} }
@ -1196,7 +1196,7 @@ md_pcrel_from (fixS *fixP)
int offset; int offset;
debug ("In md_pcrel_from()\n"); 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); debug ("fx_size = %d\n", fixP->fx_size);
/* Find the opcode that represents the current instruction in the /* Find the opcode that represents the current instruction in the
fr_literal storage area, and check bit 21. Bit 21 contains whether the fr_literal storage area, and check bit 21. Bit 21 contains whether the

View File

@ -1,3 +1,7 @@
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> 2005-07-03 Steve Ellcey <sje@cup.hp.com>
PR other/13906 PR other/13906

View File

@ -35,7 +35,7 @@ extern "C" {
#include <stdio.h> #include <stdio.h>
#include "bfd.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 { enum dis_insn_type {
dis_noninsn, /* Not a valid instruction */ dis_noninsn, /* Not a valid instruction */

View File

@ -1,3 +1,14 @@
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> 2005-07-07 Khem Raj <kraj@mvista.com>
* arm-dis.c (opcode32 arm_opcodes): Fix ARM VFP fadds instruction * arm-dis.c (opcode32 arm_opcodes): Fix ARM VFP fadds instruction

View File

@ -1202,7 +1202,7 @@ decodeInstr (bfd_vma address, /* Address of this instruction. */
bytes = dsmOneArcInst (address, (void *)& s); bytes = dsmOneArcInst (address, (void *)& s);
/* Display the disassembly instruction. */ /* Display the disassembly instruction. */
(*func) (stream, "%08x ", s.words[0]); (*func) (stream, "%08lx ", s.words[0]);
(*func) (stream, " "); (*func) (stream, " ");
(*func) (stream, "%-10s ", s.instrBuffer); (*func) (stream, "%-10s ", s.instrBuffer);

View File

@ -1578,7 +1578,7 @@ print_insn_arm (bfd_vma pc, struct disassemble_info *info, long given)
reg = given >> bitstart; reg = given >> bitstart;
reg &= (2 << (bitend - bitstart)) - 1; reg &= (2 << (bitend - bitstart)) - 1;
func (stream, "%d", reg); func (stream, "%ld", reg);
} }
break; break;
case 'W': case 'W':
@ -1588,7 +1588,7 @@ print_insn_arm (bfd_vma pc, struct disassemble_info *info, long given)
reg = given >> bitstart; reg = given >> bitstart;
reg &= (2 << (bitend - bitstart)) - 1; reg &= (2 << (bitend - bitstart)) - 1;
func (stream, "%d", reg + 1); func (stream, "%ld", reg + 1);
} }
break; break;
case 'x': case 'x':
@ -1598,7 +1598,7 @@ print_insn_arm (bfd_vma pc, struct disassemble_info *info, long given)
reg = given >> bitstart; reg = given >> bitstart;
reg &= (2 << (bitend - bitstart)) - 1; reg &= (2 << (bitend - bitstart)) - 1;
func (stream, "0x%08x", reg); func (stream, "0x%08lx", reg);
/* Some SWI instructions have special /* Some SWI instructions have special
meanings. */ meanings. */
@ -1615,7 +1615,7 @@ print_insn_arm (bfd_vma pc, struct disassemble_info *info, long given)
reg = given >> bitstart; reg = given >> bitstart;
reg &= (2 << (bitend - bitstart)) - 1; reg &= (2 << (bitend - bitstart)) - 1;
func (stream, "%01x", reg & 0xf); func (stream, "%01lx", reg & 0xf);
} }
break; break;
case 'f': case 'f':
@ -1629,7 +1629,7 @@ print_insn_arm (bfd_vma pc, struct disassemble_info *info, long given)
func (stream, "#%s", func (stream, "#%s",
arm_fp_const[reg & 7]); arm_fp_const[reg & 7]);
else else
func (stream, "f%d", reg); func (stream, "f%ld", reg);
} }
break; break;
@ -1991,7 +1991,7 @@ print_insn_thumb16 (bfd_vma pc, struct disassemble_info *info, long given)
long imm = (given & 0x07c0) >> 6; long imm = (given & 0x07c0) >> 6;
if (imm == 0) if (imm == 0)
imm = 32; imm = 32;
func (stream, "#%d", imm); func (stream, "#%ld", imm);
} }
break; break;
@ -2024,15 +2024,15 @@ print_insn_thumb16 (bfd_vma pc, struct disassemble_info *info, long given)
break; break;
case 'd': case 'd':
func (stream, "%d", reg); func (stream, "%ld", reg);
break; break;
case 'H': case 'H':
func (stream, "%d", reg << 1); func (stream, "%ld", reg << 1);
break; break;
case 'W': case 'W':
func (stream, "%d", reg << 2); func (stream, "%ld", reg << 2);
break; break;
case 'a': case 'a':
@ -2044,7 +2044,7 @@ print_insn_thumb16 (bfd_vma pc, struct disassemble_info *info, long given)
break; break;
case 'x': case 'x':
func (stream, "0x%04x", reg); func (stream, "0x%04lx", reg);
break; break;
case 'B': case 'B':

View File

@ -1448,7 +1448,7 @@ print_insn_cris_generic (bfd_vma memaddr,
advance += 2; advance += 2;
/* If to print data as offsets, then shortcut here. */ /* 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 + no_of_case_offsets
- case_offset_counter, - case_offset_counter,
case_offset_counter == 1 ? "/default" : case_offset_counter == 1 ? "/default" :
@ -1520,7 +1520,7 @@ print_insn_cris_generic (bfd_vma memaddr,
if (matchedp == NULL) if (matchedp == NULL)
{ {
(*info->fprintf_func) (info->stream, "??0x%lx", insn); (*info->fprintf_func) (info->stream, "??0x%x", insn);
advance += 2; advance += 2;
info->insn_type = dis_noninsn; info->insn_type = dis_noninsn;

View File

@ -547,7 +547,7 @@ print_arg (argument *a, bfd_vma memaddr, struct disassemble_info *info)
func (stream, "%s", string); func (stream, "%s", string);
} }
else else
func (stream, "$0x%x", a->constant); func (stream, "$0x%lx", a->constant);
} }
else else
{ {
@ -556,11 +556,11 @@ print_arg (argument *a, bfd_vma memaddr, struct disassemble_info *info)
} }
} }
else else
func (stream, "$0x%x", a->constant); func (stream, "$0x%lx", a->constant);
break; break;
case arg_idxr: 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)); getregname (a->i_r), powerof2 (a->scale));
break; break;
@ -569,7 +569,7 @@ print_arg (argument *a, bfd_vma memaddr, struct disassemble_info *info)
break; break;
case arg_cr: 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)) if (IS_INSN_TYPE (LD_STOR_INS_INC))
func (stream, "+"); func (stream, "+");

View File

@ -182,7 +182,7 @@ dis_long (unsigned long insn,
} }
if (!match) if (!match)
(*info->fprintf_func) (info->stream, ".long\t0x%08x", insn); (*info->fprintf_func) (info->stream, ".long\t0x%08lx", insn);
if (need_paren) if (need_paren)
(*info->fprintf_func) (info->stream, ")"); (*info->fprintf_func) (info->stream, ")");
@ -255,7 +255,7 @@ dis_2_short (unsigned long insn,
} }
if (num_match == 0) 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) if (need_paren)
(*info->fprintf_func) (info->stream, ")"); (*info->fprintf_func) (info->stream, ")");

View File

@ -344,7 +344,7 @@ print_insn_d30v (bfd_vma memaddr, struct disassemble_info *info)
{ {
info->bytes_per_line = 8; info->bytes_per_line = 8;
if (!(result = lookup_opcode (&insn, in1, 0))) 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 else
print_insn (info, memaddr, (long long) in1, &insn, 0, result); print_insn (info, memaddr, (long long) in1, &insn, 0, result);
return 4; return 4;
@ -356,7 +356,7 @@ print_insn_d30v (bfd_vma memaddr, struct disassemble_info *info)
/* LONG instruction. */ /* LONG instruction. */
if (!(result = lookup_opcode (&insn, in1, 1))) 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; return 8;
} }
num = (long long) in1 << 32 | in2; num = (long long) in1 << 32 | in2;
@ -366,7 +366,7 @@ print_insn_d30v (bfd_vma memaddr, struct disassemble_info *info)
{ {
num = in1; num = in1;
if (!(result = lookup_opcode (&insn, in1, 0))) 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 else
print_insn (info, memaddr, num, &insn, 0, result); print_insn (info, memaddr, num, &insn, 0, result);
@ -387,7 +387,7 @@ print_insn_d30v (bfd_vma memaddr, struct disassemble_info *info)
insn.form = NULL; insn.form = NULL;
num = in2; num = in2;
if (!(result = lookup_opcode (&insn, in2, 0))) 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 else
print_insn (info, memaddr, num, &insn, 0, result); print_insn (info, memaddr, num, &insn, 0, result);
} }

View File

@ -77,7 +77,7 @@ print_register_list (void * dis_info,
if (value & mask) if (value & mask)
{ {
(*info->fprintf_func) (info->stream, "r%i", index + offset); (*info->fprintf_func) (info->stream, "r%li", index + offset);
comma = ","; comma = ",";
} }
@ -90,7 +90,7 @@ print_register_list (void * dis_info,
if (value & mask) if (value & mask)
{ {
(*info->fprintf_func) (info->stream, "%sr%i", comma, index + offset); (*info->fprintf_func) (info->stream, "%sr%li", comma, index + offset);
comma = ","; comma = ",";
} }
} }

View File

@ -279,17 +279,17 @@ print_one_arg (disassemble_info *info,
if ((x & SIZE) == L_16 || if ((x & SIZE) == L_16 ||
(x & SIZE) == L_16U) (x & SIZE) == L_16U)
{ {
outfn (stream, ".%s%d (0x%x)", outfn (stream, ".%s%d (0x%lx)",
(short) cst > 0 ? "+" : "", (short) cst > 0 ? "+" : "",
(short) cst, (short) cst,
addr + (short) cst + len); (long)(addr + (short) cst + len));
} }
else else
{ {
outfn (stream, ".%s%d (0x%x)", outfn (stream, ".%s%d (0x%lx)",
(char) cst > 0 ? "+" : "", (char) cst > 0 ? "+" : "",
(char) cst, (char) cst,
addr + (char) cst + len); (long)(addr + (char) cst + len));
} }
} }
else if ((x & MODE) == DISP) else if ((x & MODE) == DISP)

View File

@ -229,7 +229,7 @@ print_insn_h8500 (bfd_vma addr, disassemble_info *info)
func (stream, "@(0x%x:8 (%d), r%d)", disp & 0xff, disp, rd); func (stream, "@(0x%x:8 (%d), r%d)", disp & 0xff, disp, rd);
break; break;
case FPIND_D8: 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; break;
case CRB: case CRB:
case CRW: case CRW:
@ -298,11 +298,11 @@ print_insn_h8500 (bfd_vma addr, disassemble_info *info)
break; break;
case PCREL16: case PCREL16:
func (stream, "0x%0x:16", func (stream, "0x%0x:16",
(pcrel + addr + opcode->length) & 0xffff); (int)(pcrel + addr + opcode->length) & 0xffff);
break; break;
case PCREL8: case PCREL8:
func (stream, "#0x%0x:8", func (stream, "#0x%0x:8",
((char) pcrel + addr + opcode->length) & 0xffff); (int)((char) pcrel + addr + opcode->length) & 0xffff);
break; break;
case QIM: case QIM:
func (stream, "#%d:q", qim); func (stream, "#%d:q", qim);

View File

@ -73,7 +73,7 @@ print_br_address (disassemble_info *info, bfd_vma memaddr, long val)
long adj = (long)memaddr + 4 + (val << 2); 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. */ /* Attempt to obtain a symbol for the target address. */

View File

@ -109,7 +109,7 @@ print_insn_ia64 (bfd_vma memaddr, struct disassemble_info *info)
if (slotnum == 0) if (slotnum == 0)
(*info->fprintf_func) (info->stream, "[%s] ", tname); (*info->fprintf_func) (info->stream, "[%s] ", tname);
else else
(*info->fprintf_func) (info->stream, " ", tname); (*info->fprintf_func) (info->stream, " ");
unit = ia64_templ_desc[template].exec_unit[slotnum]; unit = ia64_templ_desc[template].exec_unit[slotnum];
@ -237,11 +237,11 @@ print_insn_ia64 (bfd_vma memaddr, struct disassemble_info *info)
if (str) if (str)
(*info->fprintf_func) (info->stream, "%s", str); (*info->fprintf_func) (info->stream, "%s", str);
else if (odesc->flags & IA64_OPND_FLAG_DECIMAL_SIGNED) 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) 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 else
(*info->fprintf_func) (info->stream, "0x%llx", value); (*info->fprintf_func) (info->stream, "0x%llx", (long long) value);
break; break;
case IA64_OPND_CLASS_REL: case IA64_OPND_CLASS_REL:
@ -268,6 +268,6 @@ print_insn_ia64 (bfd_vma memaddr, struct disassemble_info *info)
return retval; return retval;
decoding_failed: decoding_failed:
(*info->fprintf_func) (info->stream, " data8 %#011llx", insn); (*info->fprintf_func) (info->stream, " data8 %#011llx", (long long) insn);
goto failed; goto failed;
} }

View File

@ -239,8 +239,8 @@ static int dlistlen = 0;
static int dlisttotlen = 0; static int dlisttotlen = 0;
static void fail (const char *, ...); static void fail (const char *, ...) ATTRIBUTE_PRINTF_1;
static void warn (const char *, ...); static void warn (const char *, ...) ATTRIBUTE_PRINTF_1;
static struct rdep * insert_resource (const char *, enum ia64_dependency_mode); static struct rdep * insert_resource (const char *, enum ia64_dependency_mode);
static int deplist_equals (struct deplist *, struct deplist *); static int deplist_equals (struct deplist *, struct deplist *);
static short insert_deplist (int, unsigned short *); static short insert_deplist (int, unsigned short *);

View File

@ -89,7 +89,7 @@ print_fr (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
if (offsetvalue == 0) if (offsetvalue == 0)
(*info->fprintf_func) (info->stream, "%s","(DP)"); (*info->fprintf_func) (info->stream, "%s","(DP)");
else else
(*info->fprintf_func) (info->stream, "$%x%s",offsetvalue, "(DP)"); (*info->fprintf_func) (info->stream, "$%lx%s",offsetvalue, "(DP)");
return; return;
} }
@ -99,7 +99,7 @@ print_fr (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
if (offsetvalue == 0) if (offsetvalue == 0)
(*info->fprintf_func) (info->stream, "%s", "(SP)"); (*info->fprintf_func) (info->stream, "%s", "(SP)");
else else
(*info->fprintf_func) (info->stream, "$%x%s", offsetvalue,"(SP)"); (*info->fprintf_func) (info->stream, "$%lx%s", offsetvalue,"(SP)");
return; return;
} }
@ -110,7 +110,7 @@ print_fr (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
(*info->fprintf_func) (info->stream, "%s", ke->name); (*info->fprintf_func) (info->stream, "%s", ke->name);
else else
/* Print as an address literal. */ /* Print as an address literal. */
(*info->fprintf_func) (info->stream, "$%02x", value); (*info->fprintf_func) (info->stream, "$%02lx", value);
} }
static void static void
@ -123,7 +123,7 @@ print_dollarhex (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
{ {
disassemble_info *info = (disassemble_info *) dis_info; disassemble_info *info = (disassemble_info *) dis_info;
(*info->fprintf_func) (info->stream, "$%x", value); (*info->fprintf_func) (info->stream, "$%lx", value);
} }
static void static void
@ -136,7 +136,7 @@ print_dollarhex8 (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
{ {
disassemble_info *info = (disassemble_info *) dis_info; disassemble_info *info = (disassemble_info *) dis_info;
(*info->fprintf_func) (info->stream, "$%02x", value); (*info->fprintf_func) (info->stream, "$%02lx", value);
} }
static void static void
@ -153,7 +153,7 @@ print_dollarhex_addr16h (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
by 8 bits so that disassembled code will reassemble properly. */ by 8 bits so that disassembled code will reassemble properly. */
value = ((value << 8) & 0xFF00); value = ((value << 8) & 0xFF00);
(*info->fprintf_func) (info->stream, "$%04x", value); (*info->fprintf_func) (info->stream, "$%04lx", value);
} }
static void static void
@ -166,7 +166,7 @@ print_dollarhex_addr16l (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
{ {
disassemble_info *info = (disassemble_info *) dis_info; disassemble_info *info = (disassemble_info *) dis_info;
(*info->fprintf_func) (info->stream, "$%04x", value); (*info->fprintf_func) (info->stream, "$%04lx", value);
} }
static void static void
@ -181,7 +181,7 @@ print_dollarhex_p (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
value = ((value << 14) & 0x1C000); value = ((value << 14) & 0x1C000);
;value = (value & 0x1FFFF); ;value = (value & 0x1FFFF);
(*info->fprintf_func) (info->stream, "$%05x", value); (*info->fprintf_func) (info->stream, "$%05lx", value);
} }
static void static void
@ -195,7 +195,7 @@ print_dollarhex_cj (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
disassemble_info *info = (disassemble_info *) dis_info; disassemble_info *info = (disassemble_info *) dis_info;
value = ((value << 1) & 0x1FFFF); value = ((value << 1) & 0x1FFFF);
(*info->fprintf_func) (info->stream, "$%05x", value); (*info->fprintf_func) (info->stream, "$%05lx", value);
} }
static void static void
@ -208,7 +208,7 @@ print_decimal (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
{ {
disassemble_info *info = (disassemble_info *) dis_info; disassemble_info *info = (disassemble_info *) dis_info;
(*info->fprintf_func) (info->stream, "%d", value); (*info->fprintf_func) (info->stream, "%ld", value);
} }

View File

@ -108,14 +108,14 @@ disassemble (bfd_vma memaddr,
{ {
value = ((insn >> (operand->shift + extra_shift)) value = ((insn >> (operand->shift + extra_shift))
& ((1 << operand->bits) - 1)); & ((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) else if ((operand->flags & MN10200_OPERAND_AREG) != 0)
{ {
value = ((insn >> (operand->shift + extra_shift)) value = ((insn >> (operand->shift + extra_shift))
& ((1 << operand->bits) - 1)); & ((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 if ((operand->flags & MN10200_OPERAND_PSW) != 0)
@ -323,7 +323,7 @@ print_insn_mn10200 (bfd_vma memaddr, struct disassemble_info *info)
} }
else else
{ {
(*info->fprintf_func) (info->stream, _("unknown\t0x%02x"), insn); (*info->fprintf_func) (info->stream, _("unknown\t0x%02lx"), insn);
return 1; return 1;
} }

View File

@ -449,7 +449,7 @@ disassemble (bfd_vma memaddr,
value = ((insn >> (operand->shift + extra_shift)) value = ((insn >> (operand->shift + extra_shift))
& ((1 << operand->bits) - 1)); & ((1 << operand->bits) - 1));
if (value == 0) if (value == 0)
(*info->fprintf_func) (info->stream, "sp", value); (*info->fprintf_func) (info->stream, "sp");
else else
(*info->fprintf_func) (info->stream, "xr%d", (int) value); (*info->fprintf_func) (info->stream, "xr%d", (int) value);
} }
@ -577,7 +577,7 @@ disassemble (bfd_vma memaddr,
if (!match) if (!match)
/* xgettext:c-format */ /* xgettext:c-format */
(*info->fprintf_func) (info->stream, _("unknown\t0x%04x"), insn); (*info->fprintf_func) (info->stream, _("unknown\t0x%04lx"), insn);
} }
int int

View File

@ -676,7 +676,7 @@ printop (struct disassemble_info *info,
default: default:
/* xgettext:c-format */ /* xgettext:c-format */
(*info->fprintf_func) (info->stream, _("# <dis error: %08x>"), inst); (*info->fprintf_func) (info->stream, _("# <dis error: %08lx>"), inst);
} }
} }
@ -729,7 +729,7 @@ m88kdis (bfd_vma pc,
; ;
if (entry_ptr == NULL) if (entry_ptr == NULL)
(*info->fprintf_func) (info->stream, "word\t%08x", instruction); (*info->fprintf_func) (info->stream, "word\t%08lx", instruction);
else else
{ {
(*info->fprintf_func) (info->stream, "%s", entry_ptr->instr->mnemonic); (*info->fprintf_func) (info->stream, "%s", entry_ptr->instr->mnemonic);

View File

@ -198,7 +198,7 @@ print_insn_mcore (memaddr, info)
if (inst & 0x400) if (inst & 0x400)
val |= 0xFFFFFC00; 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) if (strcmp (op->name, "bsr") == 0)
{ {
@ -218,8 +218,8 @@ print_insn_mcore (memaddr, info)
{ {
long val; long val;
val = (inst & 0x000F); val = (inst & 0x000F);
fprintf (stream, "\t%s, 0x%x", fprintf (stream, "\t%s, 0x%lx",
grname[(inst >> 4) & 0xF], memaddr - (val << 1)); grname[(inst >> 4) & 0xF], (long)(memaddr - (val << 1)));
} }
break; break;
@ -244,11 +244,11 @@ print_insn_mcore (memaddr, info)
| (ibytes[2] << 8) | (ibytes[3]); | (ibytes[2] << 8) | (ibytes[3]);
/* Removed [] around literal value to match ABI syntax 12/95. */ /* 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) if (val == 0)
fprintf (stream, "\t// from address pool at 0x%x", fprintf (stream, "\t// from address pool at 0x%lx",
(memaddr + 2 + ((inst & 0xFF) << 2)) & 0xFFFFFFFC); (long)(memaddr + 2 + ((inst & 0xFF) << 2)) & 0xFFFFFFFC);
} }
break; break;
@ -273,7 +273,7 @@ print_insn_mcore (memaddr, info)
| (ibytes[2] << 8) | (ibytes[3]); | (ibytes[2] << 8) | (ibytes[3]);
/* Removed [] around literal value to match ABI syntax 12/95. */ /* 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. */ /* For jmpi/jsri, we'll try to get a symbol for the target. */
if (info->print_address_func && val != 0) if (info->print_address_func && val != 0)
{ {
@ -282,8 +282,8 @@ print_insn_mcore (memaddr, info)
} }
else else
{ {
fprintf (stream, "\t// from address pool at 0x%x", fprintf (stream, "\t// from address pool at 0x%lx",
(memaddr + 2 + ((inst & 0xFF) << 2)) & 0xFFFFFFFC); (long)(memaddr + 2 + ((inst & 0xFF) << 2)) & 0xFFFFFFFC);
} }
} }
break; break;

View File

@ -796,7 +796,7 @@ print_insn_args (const char *d,
case 'i': case 'i':
case 'u': case 'u':
(*info->fprintf_func) (info->stream, "0x%x", (*info->fprintf_func) (info->stream, "0x%lx",
(l >> OP_SH_IMMEDIATE) & OP_MASK_IMMEDIATE); (l >> OP_SH_IMMEDIATE) & OP_MASK_IMMEDIATE);
break; break;
@ -870,32 +870,33 @@ print_insn_args (const char *d,
break; break;
case '<': case '<':
(*info->fprintf_func) (info->stream, "0x%x", (*info->fprintf_func) (info->stream, "0x%lx",
(l >> OP_SH_SHAMT) & OP_MASK_SHAMT); (l >> OP_SH_SHAMT) & OP_MASK_SHAMT);
break; break;
case 'c': case 'c':
(*info->fprintf_func) (info->stream, "0x%x", (*info->fprintf_func) (info->stream, "0x%lx",
(l >> OP_SH_CODE) & OP_MASK_CODE); (l >> OP_SH_CODE) & OP_MASK_CODE);
break; break;
case 'q': case 'q':
(*info->fprintf_func) (info->stream, "0x%x", (*info->fprintf_func) (info->stream, "0x%lx",
(l >> OP_SH_CODE2) & OP_MASK_CODE2); (l >> OP_SH_CODE2) & OP_MASK_CODE2);
break; break;
case 'C': case 'C':
(*info->fprintf_func) (info->stream, "0x%x", (*info->fprintf_func) (info->stream, "0x%lx",
(l >> OP_SH_COPZ) & OP_MASK_COPZ); (l >> OP_SH_COPZ) & OP_MASK_COPZ);
break; break;
case 'B': case 'B':
(*info->fprintf_func) (info->stream, "0x%x", (*info->fprintf_func) (info->stream, "0x%lx",
(l >> OP_SH_CODE20) & OP_MASK_CODE20); (l >> OP_SH_CODE20) & OP_MASK_CODE20);
break; break;
case 'J': case 'J':
(*info->fprintf_func) (info->stream, "0x%x", (*info->fprintf_func) (info->stream, "0x%lx",
(l >> OP_SH_CODE19) & OP_MASK_CODE19); (l >> OP_SH_CODE19) & OP_MASK_CODE19);
break; break;
@ -929,7 +930,7 @@ print_insn_args (const char *d,
'T' format. Therefore, until we gain understanding of 'T' format. Therefore, until we gain understanding of
cp2 register names, we can simply print the register cp2 register names, we can simply print the register
numbers. */ numbers. */
(*info->fprintf_func) (info->stream, "$%d", (*info->fprintf_func) (info->stream, "$%ld",
(l >> OP_SH_RT) & OP_MASK_RT); (l >> OP_SH_RT) & OP_MASK_RT);
break; break;
@ -943,7 +944,7 @@ print_insn_args (const char *d,
(*info->fprintf_func) (info->stream, "%s", (*info->fprintf_func) (info->stream, "%s",
mips_cp0_names[(l >> OP_SH_RD) & OP_MASK_RD]); mips_cp0_names[(l >> OP_SH_RD) & OP_MASK_RD]);
else else
(*info->fprintf_func) (info->stream, "$%d", (*info->fprintf_func) (info->stream, "$%ld",
(l >> OP_SH_RD) & OP_MASK_RD); (l >> OP_SH_RD) & OP_MASK_RD);
break; break;
@ -953,37 +954,37 @@ print_insn_args (const char *d,
break; break;
case 'N': case 'N':
(*info->fprintf_func) (info->stream, "$fcc%d", (*info->fprintf_func) (info->stream, "$fcc%ld",
(l >> OP_SH_BCC) & OP_MASK_BCC); (l >> OP_SH_BCC) & OP_MASK_BCC);
break; break;
case 'M': case 'M':
(*info->fprintf_func) (info->stream, "$fcc%d", (*info->fprintf_func) (info->stream, "$fcc%ld",
(l >> OP_SH_CCC) & OP_MASK_CCC); (l >> OP_SH_CCC) & OP_MASK_CCC);
break; break;
case 'P': case 'P':
(*info->fprintf_func) (info->stream, "%d", (*info->fprintf_func) (info->stream, "%ld",
(l >> OP_SH_PERFREG) & OP_MASK_PERFREG); (l >> OP_SH_PERFREG) & OP_MASK_PERFREG);
break; break;
case 'e': case 'e':
(*info->fprintf_func) (info->stream, "%d", (*info->fprintf_func) (info->stream, "%ld",
(l >> OP_SH_VECBYTE) & OP_MASK_VECBYTE); (l >> OP_SH_VECBYTE) & OP_MASK_VECBYTE);
break; break;
case '%': case '%':
(*info->fprintf_func) (info->stream, "%d", (*info->fprintf_func) (info->stream, "%ld",
(l >> OP_SH_VECALIGN) & OP_MASK_VECALIGN); (l >> OP_SH_VECALIGN) & OP_MASK_VECALIGN);
break; break;
case 'H': case 'H':
(*info->fprintf_func) (info->stream, "%d", (*info->fprintf_func) (info->stream, "%ld",
(l >> OP_SH_SEL) & OP_MASK_SEL); (l >> OP_SH_SEL) & OP_MASK_SEL);
break; break;
case 'O': case 'O':
(*info->fprintf_func) (info->stream, "%d", (*info->fprintf_func) (info->stream, "%ld",
(l >> OP_SH_ALN) & OP_MASK_ALN); (l >> OP_SH_ALN) & OP_MASK_ALN);
break; break;
@ -999,35 +1000,35 @@ print_insn_args (const char *d,
for (fmt = 0; fmt < 3; fmt++, vsel >>= 1) for (fmt = 0; fmt < 3; fmt++, vsel >>= 1)
if ((vsel & 1) == 0) if ((vsel & 1) == 0)
break; break;
(*info->fprintf_func) (info->stream, "$v%d[%d]", (*info->fprintf_func) (info->stream, "$v%ld[%d]",
(l >> OP_SH_FT) & OP_MASK_FT, (l >> OP_SH_FT) & OP_MASK_FT,
vsel >> 1); vsel >> 1);
} }
else if ((vsel & 0x08) == 0) 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); (l >> OP_SH_FT) & OP_MASK_FT);
} }
else else
{ {
(*info->fprintf_func) (info->stream, "0x%x", (*info->fprintf_func) (info->stream, "0x%lx",
(l >> OP_SH_FT) & OP_MASK_FT); (l >> OP_SH_FT) & OP_MASK_FT);
} }
} }
break; break;
case 'X': case 'X':
(*info->fprintf_func) (info->stream, "$v%d", (*info->fprintf_func) (info->stream, "$v%ld",
(l >> OP_SH_FD) & OP_MASK_FD); (l >> OP_SH_FD) & OP_MASK_FD);
break; break;
case 'Y': case 'Y':
(*info->fprintf_func) (info->stream, "$v%d", (*info->fprintf_func) (info->stream, "$v%ld",
(l >> OP_SH_FS) & OP_MASK_FS); (l >> OP_SH_FS) & OP_MASK_FS);
break; break;
case 'Z': case 'Z':
(*info->fprintf_func) (info->stream, "$v%d", (*info->fprintf_func) (info->stream, "$v%ld",
(l >> OP_SH_FT) & OP_MASK_FT); (l >> OP_SH_FT) & OP_MASK_FT);
break; break;
@ -1141,7 +1142,7 @@ print_insn_mips (bfd_vma memaddr,
/* Handle undefined instructions. */ /* Handle undefined instructions. */
info->insn_type = dis_noninsn; info->insn_type = dis_noninsn;
(*info->fprintf_func) (info->stream, "0x%x", word); (*info->fprintf_func) (info->stream, "0x%lx", word);
return INSNLEN; return INSNLEN;
} }

View File

@ -71,7 +71,7 @@ print_dollarhex (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
{ {
disassemble_info *info = (disassemble_info *) dis_info; disassemble_info *info = (disassemble_info *) dis_info;
info->fprintf_func (info->stream, "$%x", value); info->fprintf_func (info->stream, "$%lx", value);
if (0) if (0)
print_normal (cd, dis_info, value, attrs, pc, length); print_normal (cd, dis_info, value, attrs, pc, length);

View File

@ -300,7 +300,7 @@ print_insn (bfd_vma memaddr, struct disassemble_info *info)
/* This used to be %8x for binutils. */ /* This used to be %8x for binutils. */
(*info->fprintf_func) (*info->fprintf_func)
(info->stream, ".word 0x%08x", insn); (info->stream, ".word 0x%08lx", insn);
return 4; return 4;
} }

View File

@ -334,7 +334,7 @@ const struct or32_opcode or32_opcodes[] =
/* Define dummy, if debug is not defined. */ /* Define dummy, if debug is not defined. */
#if !defined HAS_DEBUG #if !defined HAS_DEBUG
static void static void ATTRIBUTE_PRINTF_2
debug (int level ATTRIBUTE_UNUSED, const char *format ATTRIBUTE_UNUSED, ...) debug (int level ATTRIBUTE_UNUSED, const char *format ATTRIBUTE_UNUSED, ...)
{ {
} }
@ -502,7 +502,7 @@ cover_insn (unsigned long * cur, int pass, unsigned int mask)
last_match = i; last_match = i;
} }
debug (8, "%08X %08X\n", mask, cur_mask); debug (8, "%08X %08lX\n", mask, cur_mask);
if (ninstr == 0) if (ninstr == 0)
return 0; return 0;
@ -510,8 +510,8 @@ cover_insn (unsigned long * cur, int pass, unsigned int mask)
if (ninstr == 1) if (ninstr == 1)
{ {
/* Leaf holds instruction index. */ /* Leaf holds instruction index. */
debug (8, "%i>I%i %s\n", debug (8, "%li>I%i %s\n",
cur - automata, last_match, or32_opcodes[last_match].name); (long)(cur - automata), last_match, or32_opcodes[last_match].name);
*cur = LEAF_FLAG | last_match; *cur = LEAF_FLAG | last_match;
cur++; cur++;
@ -528,7 +528,7 @@ cover_insn (unsigned long * cur, int pass, unsigned int mask)
{ {
unsigned long m = (1UL << ((unsigned long) len)) - 1; 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), len,m, cur_mask, i, (cur_mask >> (unsigned)i),
(cur_mask >> (unsigned) i) & m); (cur_mask >> (unsigned) i) & m);
@ -557,8 +557,8 @@ cover_insn (unsigned long * cur, int pass, unsigned int mask)
exit (1); exit (1);
} }
debug (8, "%i> #### %i << %i (%i) ####\n", debug (8, "%li> #### %i << %i (%i) ####\n",
cur - automata, best_len, best_first, ninstr); (long)(cur - automata), best_len, best_first, ninstr);
*cur = best_first; *cur = best_first;
cur++; cur++;
@ -582,17 +582,17 @@ cover_insn (unsigned long * cur, int pass, unsigned int mask)
&& ((ti[j].insn_mask >> best_first) & cur_mask) == cur_mask) && ((ti[j].insn_mask >> best_first) & cur_mask) == cur_mask)
ti[j].in_pass = curpass; 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))); c = cover_insn (cur, curpass, mask & (~(cur_mask << best_first)));
if (c) 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; *next = cur - automata;
cur = c; cur = c;
} }
else else
{ {
debug (8, "%i> N/A\n", next - automata); debug (8, "%li> N/A\n", (long)(next - automata));
*next = 0; *next = 0;
} }
next++; next++;
@ -635,7 +635,7 @@ parse_params (const struct or32_opcode * opcode,
{ {
cur->type = OPTYPE_REG | OPTYPE_OP | OPTYPE_LAST; cur->type = OPTYPE_REG | OPTYPE_OP | OPTYPE_LAST;
cur->data = 0; cur->data = 0;
debug (9, "#%08X %08X\n", cur->type, cur->data); debug (9, "#%08lX %08lX\n", cur->type, cur->data);
cur++; cur++;
return cur; return cur;
} }
@ -652,7 +652,7 @@ parse_params (const struct or32_opcode * opcode,
unsigned long arg; unsigned long arg;
arg = insn_extract (*args, opcode->encoding); 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)) if (letter_signed (*args))
{ {
type |= OPTYPE_SIG; type |= OPTYPE_SIG;
@ -678,7 +678,7 @@ parse_params (const struct or32_opcode * opcode,
cur->type = type | shr; cur->type = type | shr;
cur->data = mask; cur->data = mask;
arg &= ~(((1 << mask) - 1) << shr); arg &= ~(((1 << mask) - 1) << shr);
debug (6, "|%08X %08X\n", cur->type, cur->data); debug (6, "|%08lX %08lX\n", cur->type, cur->data);
cur++; cur++;
} }
args++; args++;
@ -689,7 +689,7 @@ parse_params (const struct or32_opcode * opcode,
Later we will treat them as one operand. */ Later we will treat them as one operand. */
cur--; cur--;
cur->type = type | cur->type | OPTYPE_DIS | OPTYPE_OP; 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++; cur++;
type = 0; type = 0;
i++; i++;
@ -699,7 +699,7 @@ parse_params (const struct or32_opcode * opcode,
{ {
cur--; cur--;
cur->type = type | cur->type | OPTYPE_OP; 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++; cur++;
type = 0; type = 0;
i++; i++;
@ -709,7 +709,7 @@ parse_params (const struct or32_opcode * opcode,
{ {
cur->type = type; cur->type = type;
cur->data = 0; cur->data = 0;
debug (9, ">%08X %08X\n", cur->type, cur->data); debug (9, ">%08lX %08lX\n", cur->type, cur->data);
cur++; cur++;
type = 0; type = 0;
i++; i++;
@ -726,7 +726,7 @@ parse_params (const struct or32_opcode * opcode,
cur--; cur--;
cur->type = type | cur->type | OPTYPE_OP | OPTYPE_LAST; 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++; cur++;
return cur; return cur;
@ -814,7 +814,7 @@ insn_decode (unsigned int insn)
{ {
unsigned int first = *a; unsigned int first = *a;
debug (9, "%i ", a - automata); debug (9, "%li ", (long)(a - automata));
a++; a++;
i = (insn >> first) & *a; i = (insn >> first) & *a;
@ -822,7 +822,7 @@ insn_decode (unsigned int insn)
if (!*(a + i)) if (!*(a + i))
{ {
/* Invalid instruction found? */ /* Invalid instruction found? */
debug (9, "XXX\n", i); debug (9, "XXX\n");
return -1; return -1;
} }
a = automata + *(a + i); a = automata + *(a + i);

View File

@ -249,7 +249,7 @@ print_insn_powerpc (bfd_vma memaddr,
else else
{ {
if (operand->bits == 3) if (operand->bits == 3)
(*info->fprintf_func) (info->stream, "cr%d", value); (*info->fprintf_func) (info->stream, "cr%ld", value);
else else
{ {
static const char *cbnames[4] = { "lt", "gt", "eq", "so" }; static const char *cbnames[4] = { "lt", "gt", "eq", "so" };

View File

@ -224,7 +224,7 @@ print_insn_shmedia (bfd_vma memaddr, struct disassemble_info *info)
/* FIXME: We should also check register number constraints. */ /* FIXME: We should also check register number constraints. */
if (op->name == NULL) if (op->name == NULL)
{ {
fprintf_fn (stream, ".long 0x%08x", instruction); fprintf_fn (stream, ".long 0x%08lx", instruction);
return 4; return 4;
} }
@ -312,7 +312,7 @@ print_insn_shmedia (bfd_vma memaddr, struct disassemble_info *info)
imm = temp & 0x3f; imm = temp & 0x3f;
if (imm & (unsigned long) 0x20) if (imm & (unsigned long) 0x20)
imm |= ~(unsigned long) 0x3f; imm |= ~(unsigned long) 0x3f;
fprintf_fn (stream, "%d", imm); fprintf_fn (stream, "%ld", imm);
break; break;
/* A signed 6-bit number, multiplied by 32 when used. */ /* A signed 6-bit number, multiplied by 32 when used. */
@ -320,7 +320,7 @@ print_insn_shmedia (bfd_vma memaddr, struct disassemble_info *info)
imm = temp & 0x3f; imm = temp & 0x3f;
if (imm & (unsigned long) 0x20) if (imm & (unsigned long) 0x20)
imm |= ~(unsigned long) 0x3f; imm |= ~(unsigned long) 0x3f;
fprintf_fn (stream, "%d", imm * 32); fprintf_fn (stream, "%ld", imm * 32);
break; break;
/* A signed 10-bit number, multiplied by 8 when used. */ /* A signed 10-bit number, multiplied by 8 when used. */
@ -345,7 +345,7 @@ print_insn_shmedia (bfd_vma memaddr, struct disassemble_info *info)
if (imm & (unsigned long) 0x200) if (imm & (unsigned long) 0x200)
imm |= ~(unsigned long) 0x3ff; imm |= ~(unsigned long) 0x3ff;
imm <<= by_number; imm <<= by_number;
fprintf_fn (stream, "%d", imm); fprintf_fn (stream, "%ld", imm);
break; break;
/* A signed 16-bit number. */ /* A signed 16-bit number. */
@ -353,7 +353,7 @@ print_insn_shmedia (bfd_vma memaddr, struct disassemble_info *info)
imm = temp & 0xffff; imm = temp & 0xffff;
if (imm & (unsigned long) 0x8000) if (imm & (unsigned long) 0x8000)
imm |= ~((unsigned long) 0xffff); imm |= ~((unsigned long) 0xffff);
fprintf_fn (stream, "%d", imm); fprintf_fn (stream, "%ld", imm);
break; break;
/* A PC-relative signed 16-bit number, multiplied by 4 when /* A PC-relative signed 16-bit number, multiplied by 4 when
@ -370,19 +370,19 @@ print_insn_shmedia (bfd_vma memaddr, struct disassemble_info *info)
/* An unsigned 5-bit number. */ /* An unsigned 5-bit number. */
case A_IMMU5: case A_IMMU5:
imm = temp & 0x1f; imm = temp & 0x1f;
fprintf_fn (stream, "%d", imm); fprintf_fn (stream, "%ld", imm);
break; break;
/* An unsigned 6-bit number. */ /* An unsigned 6-bit number. */
case A_IMMU6: case A_IMMU6:
imm = temp & 0x3f; imm = temp & 0x3f;
fprintf_fn (stream, "%d", imm); fprintf_fn (stream, "%ld", imm);
break; break;
/* An unsigned 16-bit number. */ /* An unsigned 16-bit number. */
case A_IMMU16: case A_IMMU16:
imm = temp & 0xffff; imm = temp & 0xffff;
fprintf_fn (stream, "%d", imm); fprintf_fn (stream, "%ld", imm);
break; break;
default: default:

View File

@ -693,7 +693,7 @@ print_insn_sparc (bfd_vma memaddr, disassemble_info *info)
break; break;
case '3': case '3':
(info->fprintf_func) (stream, "%d", X_IMM (insn, 3)); (info->fprintf_func) (stream, "%ld", X_IMM (insn, 3));
break; break;
case 'K': case 'K':
@ -806,16 +806,16 @@ print_insn_sparc (bfd_vma memaddr, disassemble_info *info)
if (name) if (name)
(*info->fprintf_func) (stream, "%s", name); (*info->fprintf_func) (stream, "%s", name);
else else
(*info->fprintf_func) (stream, "%d", X_RD (insn)); (*info->fprintf_func) (stream, "%ld", X_RD (insn));
break; break;
} }
case 'M': case 'M':
(*info->fprintf_func) (stream, "%%asr%d", X_RS1 (insn)); (*info->fprintf_func) (stream, "%%asr%ld", X_RS1 (insn));
break; break;
case 'm': case 'm':
(*info->fprintf_func) (stream, "%%asr%d", X_RD (insn)); (*info->fprintf_func) (stream, "%%asr%ld", X_RD (insn));
break; break;
case 'L': case 'L':
@ -840,7 +840,7 @@ print_insn_sparc (bfd_vma memaddr, disassemble_info *info)
if (name) if (name)
(*info->fprintf_func) (stream, "%s", name); (*info->fprintf_func) (stream, "%s", name);
else else
(*info->fprintf_func) (stream, "(%d)", X_ASI (insn)); (*info->fprintf_func) (stream, "(%ld)", X_ASI (insn));
break; break;
} }
@ -873,7 +873,7 @@ print_insn_sparc (bfd_vma memaddr, disassemble_info *info)
break; break;
case 'x': case 'x':
(*info->fprintf_func) (stream, "%d", (*info->fprintf_func) (stream, "%ld",
((X_LDST_I (insn) << 8) ((X_LDST_I (insn) << 8)
+ X_ASI (insn))); + X_ASI (insn)));
break; break;

View File

@ -222,12 +222,12 @@ tic4x_print_immed (struct disassemble_info *info,
{ {
case IMMED_SINT: case IMMED_SINT:
case IMMED_INT: case IMMED_INT:
(*info->fprintf_func) (info->stream, "%d", (long) arg); (*info->fprintf_func) (info->stream, "%ld", (long) arg);
break; break;
case IMMED_SUINT: case IMMED_SUINT:
case IMMED_UINT: case IMMED_UINT:
(*info->fprintf_func) (info->stream, "%u", arg); (*info->fprintf_func) (info->stream, "%lu", arg);
break; break;
case IMMED_SFLOAT: case IMMED_SFLOAT:
@ -724,7 +724,7 @@ tic4x_disassemble (unsigned long pc,
&& tic4x_print_op (NULL, instruction, p, pc)) && tic4x_print_op (NULL, instruction, p, pc))
tic4x_print_op (info, instruction, p, pc); tic4x_print_op (info, instruction, p, pc);
else else
(*info->fprintf_func) (info->stream, "%08x", instruction); (*info->fprintf_func) (info->stream, "%08lx", instruction);
} }
else else
{ {
@ -736,7 +736,7 @@ tic4x_disassemble (unsigned long pc,
break; break;
} }
if (i == TIC4X_SPESOP_SIZE) 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. */ /* Return size of insn in words. */

View File

@ -87,7 +87,7 @@ print_operand_bitnum (struct disassemble_info *info, long value)
if (tmp != NULL) if (tmp != NULL)
(*info->fprintf_func) (info->stream, "%s", tmp); (*info->fprintf_func) (info->stream, "%s", tmp);
else else
(*info->fprintf_func) (info->stream, "%ld", bitnum); (*info->fprintf_func) (info->stream, "%d", bitnum);
} }
/* Print the operand as directed by the flags. */ /* Print the operand as directed by the flags. */

View File

@ -187,7 +187,7 @@ disassemble (bfd_vma memaddr,
info->fprintf_func (info->stream, "ep"); info->fprintf_func (info->stream, "ep");
break; break;
default: default:
info->fprintf_func (info->stream, "%d", value); info->fprintf_func (info->stream, "%ld", value);
break; break;
case V850_OPERAND_DISP: case V850_OPERAND_DISP:
{ {
@ -314,7 +314,7 @@ disassemble (bfd_vma memaddr,
if ((insn & 0x001fffc0) == 0x00130780) if ((insn & 0x001fffc0) == 0x00130780)
value <<= 16; value <<= 16;
info->fprintf_func (info->stream, "0x%x", value); info->fprintf_func (info->stream, "0x%lx", value);
} }
else else
info->memory_error_func (status, memaddr + bytes_read, info->memory_error_func (status, memaddr + bytes_read,
@ -355,9 +355,9 @@ disassemble (bfd_vma memaddr,
if (!match) if (!match)
{ {
if (short_op) if (short_op)
info->fprintf_func (info->stream, ".short\t0x%04x", insn); info->fprintf_func (info->stream, ".short\t0x%04lx", insn);
else else
info->fprintf_func (info->stream, ".long\t0x%08x", insn); info->fprintf_func (info->stream, ".long\t0x%08lx", insn);
} }
return bytes_read; return bytes_read;