#define NO_GET ((bfd_vma (*) (const void *)) swap_abort)
#define NO_PUT ((void (*) (bfd_vma, void *)) swap_abort)
#define NO_GETS ((bfd_signed_vma (*) (const void *)) swap_abort)
-#define NO_GET64 ((bfd_uint64_t (*) (const void *)) swap_abort)
-#define NO_PUT64 ((void (*) (bfd_uint64_t, void *)) swap_abort)
-#define NO_GETS64 ((bfd_int64_t (*) (const void *)) swap_abort)
+#define NO_GET64 ((uint64_t (*) (const void *)) swap_abort)
+#define NO_PUT64 ((void (*) (uint64_t, void *)) swap_abort)
+#define NO_GETS64 ((int64_t (*) (const void *)) swap_abort)
const bfd_target core_aix386_vec =
{
#error No 64 bit integer type available
#endif /* ! defined (BFD_HOST_64_BIT) */
-typedef BFD_HOST_U_64_BIT bfd_vma;
-typedef BFD_HOST_64_BIT bfd_signed_vma;
-typedef BFD_HOST_U_64_BIT bfd_size_type;
-typedef BFD_HOST_U_64_BIT symvalue;
+typedef uint64_t bfd_vma;
+typedef int64_t bfd_signed_vma;
+typedef uint64_t bfd_size_type;
+typedef uint64_t symvalue;
#if BFD_HOST_64BIT_LONG
#define BFD_VMA_FMT "l"
/* Byte swapping routines. */
-bfd_uint64_t bfd_getb64 (const void *);
-bfd_uint64_t bfd_getl64 (const void *);
-bfd_int64_t bfd_getb_signed_64 (const void *);
-bfd_int64_t bfd_getl_signed_64 (const void *);
+uint64_t bfd_getb64 (const void *);
+uint64_t bfd_getl64 (const void *);
+int64_t bfd_getb_signed_64 (const void *);
+int64_t bfd_getl_signed_64 (const void *);
bfd_vma bfd_getb32 (const void *);
bfd_vma bfd_getl32 (const void *);
bfd_signed_vma bfd_getb_signed_32 (const void *);
bfd_vma bfd_getl16 (const void *);
bfd_signed_vma bfd_getb_signed_16 (const void *);
bfd_signed_vma bfd_getl_signed_16 (const void *);
-void bfd_putb64 (bfd_uint64_t, void *);
-void bfd_putl64 (bfd_uint64_t, void *);
+void bfd_putb64 (uint64_t, void *);
+void bfd_putl64 (uint64_t, void *);
void bfd_putb32 (bfd_vma, void *);
void bfd_putl32 (bfd_vma, void *);
void bfd_putb24 (bfd_vma, void *);
/* Byte swapping routines which take size and endiannes as arguments. */
-bfd_uint64_t bfd_get_bits (const void *, int, bool);
-void bfd_put_bits (bfd_uint64_t, void *, int, bool);
+uint64_t bfd_get_bits (const void *, int, bool);
+void bfd_put_bits (uint64_t, void *, int, bool);
/* mmap hacks */
#error No 64 bit integer type available
#endif /* ! defined (BFD_HOST_64_BIT) */
-typedef BFD_HOST_U_64_BIT bfd_vma;
-typedef BFD_HOST_64_BIT bfd_signed_vma;
-typedef BFD_HOST_U_64_BIT bfd_size_type;
-typedef BFD_HOST_U_64_BIT symvalue;
+typedef uint64_t bfd_vma;
+typedef int64_t bfd_signed_vma;
+typedef uint64_t bfd_size_type;
+typedef uint64_t symvalue;
#if BFD_HOST_64BIT_LONG
#define BFD_VMA_FMT "l"
/* Byte swapping routines. */
-bfd_uint64_t bfd_getb64 (const void *);
-bfd_uint64_t bfd_getl64 (const void *);
-bfd_int64_t bfd_getb_signed_64 (const void *);
-bfd_int64_t bfd_getl_signed_64 (const void *);
+uint64_t bfd_getb64 (const void *);
+uint64_t bfd_getl64 (const void *);
+int64_t bfd_getb_signed_64 (const void *);
+int64_t bfd_getl_signed_64 (const void *);
bfd_vma bfd_getb32 (const void *);
bfd_vma bfd_getl32 (const void *);
bfd_signed_vma bfd_getb_signed_32 (const void *);
bfd_vma bfd_getl16 (const void *);
bfd_signed_vma bfd_getb_signed_16 (const void *);
bfd_signed_vma bfd_getl_signed_16 (const void *);
-void bfd_putb64 (bfd_uint64_t, void *);
-void bfd_putl64 (bfd_uint64_t, void *);
+void bfd_putb64 (uint64_t, void *);
+void bfd_putl64 (uint64_t, void *);
void bfd_putb32 (bfd_vma, void *);
void bfd_putl32 (bfd_vma, void *);
void bfd_putb24 (bfd_vma, void *);
/* Byte swapping routines which take size and endiannes as arguments. */
-bfd_uint64_t bfd_get_bits (const void *, int, bool);
-void bfd_put_bits (bfd_uint64_t, void *, int, bool);
+uint64_t bfd_get_bits (const void *, int, bool);
+void bfd_put_bits (uint64_t, void *, int, bool);
/* mmap hacks */
/* Entries for byte swapping for data. These are different from the
other entry points, since they don't take a BFD as the first argument.
Certain other handlers could do the same. */
- bfd_uint64_t (*bfd_getx64) (const void *);
- bfd_int64_t (*bfd_getx_signed_64) (const void *);
- void (*bfd_putx64) (bfd_uint64_t, void *);
+ uint64_t (*bfd_getx64) (const void *);
+ int64_t (*bfd_getx_signed_64) (const void *);
+ void (*bfd_putx64) (uint64_t, void *);
bfd_vma (*bfd_getx32) (const void *);
bfd_signed_vma (*bfd_getx_signed_32) (const void *);
void (*bfd_putx32) (bfd_vma, void *);
void (*bfd_putx16) (bfd_vma, void *);
/* Byte swapping for the headers. */
- bfd_uint64_t (*bfd_h_getx64) (const void *);
- bfd_int64_t (*bfd_h_getx_signed_64) (const void *);
- void (*bfd_h_putx64) (bfd_uint64_t, void *);
+ uint64_t (*bfd_h_getx64) (const void *);
+ int64_t (*bfd_h_getx_signed_64) (const void *);
+ void (*bfd_h_putx64) (uint64_t, void *);
bfd_vma (*bfd_h_getx32) (const void *);
bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
void (*bfd_h_putx32) (bfd_vma, void *);
}
static char buff20[XCOFFARMAGBIG_ELEMENT_SIZE + 1];
-#if BFD_HOST_64BIT_LONG
-#define FMT20 "%-20ld"
-#elif defined (__MSVCRT__)
-#define FMT20 "%-20I64d"
-#else
-#define FMT20 "%-20lld"
-#endif
+#define FMT20 "%-20" PRId64
#define FMT12 "%-12d"
#define FMT12_OCTAL "%-12o"
#define FMT4 "%-4d"
#define PRINT20(d, v) \
- sprintf (buff20, FMT20, (bfd_uint64_t)(v)), \
+ sprintf (buff20, FMT20, (uint64_t) (v)), \
memcpy ((void *) (d), buff20, 20)
#define PRINT12(d, v) \
case 4:
{
- bfd_uint64_t x = bfd_get_64 (abfd, addr);
+ uint64_t x = bfd_get_64 (abfd, addr);
DOIT (x);
bfd_put_64 (abfd, x, addr);
}
static const char*
ext_immu (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
{
- BFD_HOST_U_64_BIT value = 0;
+ uint64_t value = 0;
int i, bits = 0, total = 0;
for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
{
bits = self->field[i].bits;
value |= ((code >> self->field[i].shift)
- & ((((BFD_HOST_U_64_BIT) 1) << bits) - 1)) << total;
+ & (((uint64_t) 1 << bits) - 1)) << total;
total += bits;
}
*valuep = value;
ins_imms_scaled (const struct ia64_operand *self, ia64_insn value,
ia64_insn *code, int scale)
{
- BFD_HOST_64_BIT svalue = value, sign_bit = 0;
+ int64_t svalue = value, sign_bit = 0;
ia64_insn new_insn = 0;
int i;
ia64_insn *valuep, int scale)
{
int i, bits = 0, total = 0;
- BFD_HOST_U_64_BIT val = 0, sign;
+ uint64_t val = 0, sign;
for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
{
bits = self->field[i].bits;
val |= ((code >> self->field[i].shift)
- & ((((BFD_HOST_U_64_BIT) 1) << bits) - 1)) << total;
+ & (((uint64_t) 1 << bits) - 1)) << total;
total += bits;
}
/* sign extend: */
- sign = (BFD_HOST_U_64_BIT) 1 << (total - 1);
+ sign = (uint64_t) 1 << (total - 1);
val = (val ^ sign) - sign;
*valuep = val << scale;
ins_cnt (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
{
--value;
- if (value >= ((BFD_HOST_U_64_BIT) 1) << self->field[0].bits)
+ if (value >= (uint64_t) 1 << self->field[0].bits)
return "count out of range";
*code |= value << self->field[0].shift;
ext_cnt (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
{
*valuep = ((code >> self->field[0].shift)
- & ((((BFD_HOST_U_64_BIT) 1) << self->field[0].bits) - 1)) + 1;
+ & (((uint64_t) 1 << self->field[0].bits) - 1)) + 1;
return 0;
}
static const char*
ins_inc3 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
{
- BFD_HOST_64_BIT val = value;
- BFD_HOST_U_64_BIT sign = 0;
+ int64_t val = value;
+ uint64_t sign = 0;
if (val < 0)
{
static const char*
ext_inc3 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
{
- BFD_HOST_64_BIT val;
+ int64_t val;
int negate;
val = (code >> self->field[0].shift) & 0x7;
{
char *str;
struct dwarf_block *blk;
- bfd_uint64_t val;
- bfd_int64_t sval;
+ uint64_t val;
+ int64_t sval;
}
u;
};
the located section does not contain at least OFFSET bytes. */
static bool
-read_section (bfd * abfd,
+read_section (bfd *abfd,
const struct dwarf_debug_section *sec,
- asymbol ** syms,
- bfd_uint64_t offset,
- bfd_byte ** section_buffer,
- bfd_size_type * section_size)
+ asymbol **syms,
+ uint64_t offset,
+ bfd_byte **section_buffer,
+ bfd_size_type *section_size)
{
const char *section_name = sec->uncompressed_name;
bfd_byte *contents = *section_buffer;
bfd_byte **ptr,
bfd_byte *buf_end)
{
- bfd_uint64_t offset;
+ uint64_t offset;
struct dwarf2_debug *stash = unit->stash;
struct dwarf2_debug_file *file = unit->file;
char *str;
bfd_byte **ptr,
bfd_byte *buf_end)
{
- bfd_uint64_t offset;
+ uint64_t offset;
struct dwarf2_debug *stash = unit->stash;
struct dwarf2_debug_file *file = unit->file;
char *str;
bfd_byte **ptr,
bfd_byte *buf_end)
{
- bfd_uint64_t offset;
+ uint64_t offset;
struct dwarf2_debug *stash = unit->stash;
char *str;
or NULL upon failure. */
static bfd_byte *
-read_alt_indirect_ref (struct comp_unit * unit,
- bfd_uint64_t offset)
+read_alt_indirect_ref (struct comp_unit *unit, uint64_t offset)
{
struct dwarf2_debug *stash = unit->stash;
return stash->alt.dwarf_info_buffer + offset;
}
-static bfd_uint64_t
+static uint64_t
read_address (struct comp_unit *unit, bfd_byte **ptr, bfd_byte *buf_end)
{
bfd_byte *buf = *ptr;
in a hash table. */
static struct abbrev_info**
-read_abbrevs (bfd *abfd, bfd_uint64_t offset, struct dwarf2_debug *stash,
+read_abbrevs (bfd *abfd, uint64_t offset, struct dwarf2_debug *stash,
struct dwarf2_debug_file *file)
{
struct abbrev_info **abbrevs;
/* Returns the address in .debug_addr section using DW_AT_addr_base.
Used to implement DW_FORM_addrx*. */
static bfd_vma
-read_indexed_address (bfd_uint64_t idx,
- struct comp_unit *unit)
+read_indexed_address (uint64_t idx, struct comp_unit *unit)
{
struct dwarf2_debug *stash = unit->stash;
struct dwarf2_debug_file *file = unit->file;
/* Returns the string using DW_AT_str_offsets_base.
Used to implement DW_FORM_strx*. */
static const char *
-read_indexed_string (bfd_uint64_t idx,
- struct comp_unit *unit)
+read_indexed_string (uint64_t idx, struct comp_unit *unit)
{
struct dwarf2_debug *stash = unit->stash;
struct dwarf2_debug_file *file = unit->file;
struct funcinfo
{
/* Pointer to previous function in list of all functions. */
- struct funcinfo * prev_func;
+ struct funcinfo *prev_func;
/* Pointer to function one scope higher. */
- struct funcinfo * caller_func;
+ struct funcinfo *caller_func;
/* Source location file name where caller_func inlines this func. */
- char * caller_file;
+ char *caller_file;
/* Source location file name. */
- char * file;
+ char *file;
/* Source location line number where caller_func inlines this func. */
- int caller_line;
+ int caller_line;
/* Source location line number. */
- int line;
- int tag;
- bool is_linkage;
- const char * name;
- struct arange arange;
+ int line;
+ int tag;
+ bool is_linkage;
+ const char *name;
+ struct arange arange;
/* Where the symbol is defined. */
- asection * sec;
+ asection *sec;
/* The offset of the funcinfo from the start of the unit. */
- bfd_uint64_t unit_offset;
+ uint64_t unit_offset;
};
struct lookup_funcinfo
{
/* Function information corresponding to this lookup table entry. */
- struct funcinfo * funcinfo;
+ struct funcinfo *funcinfo;
/* The lowest address for this specific function. */
- bfd_vma low_addr;
+ bfd_vma low_addr;
/* The highest address of this function before the lookup table is sorted.
The highest address of all prior functions after the lookup table is
sorted, which is used for binary search. */
- bfd_vma high_addr;
+ bfd_vma high_addr;
/* Index of this function, used to ensure qsort is stable. */
unsigned int idx;
};
/* Pointer to previous variable in list of all variables. */
struct varinfo *prev_var;
/* The offset of the varinfo from the start of the unit. */
- bfd_uint64_t unit_offset;
+ uint64_t unit_offset;
/* Source location file name. */
char *file;
/* Source location line number. */
bfd_byte *info_ptr_end;
unsigned int abbrev_number, i;
struct abbrev_info *abbrev;
- bfd_uint64_t die_ref = attr_ptr->u.val;
+ uint64_t die_ref = attr_ptr->u.val;
struct attribute attr;
const char *name = NULL;
static bool
read_ranges (struct comp_unit *unit, struct arange *arange,
- struct trie_node **trie_root, bfd_uint64_t offset)
+ struct trie_node **trie_root, uint64_t offset)
{
bfd_byte *ranges_ptr;
bfd_byte *ranges_end;
static bool
read_rnglists (struct comp_unit *unit, struct arange *arange,
- struct trie_node **trie_root, bfd_uint64_t offset)
+ struct trie_node **trie_root, uint64_t offset)
{
bfd_byte *rngs_ptr;
bfd_byte *rngs_end;
static bool
read_rangelist (struct comp_unit *unit, struct arange *arange,
- struct trie_node **trie_root, bfd_uint64_t offset)
+ struct trie_node **trie_root, uint64_t offset)
{
if (unit->version <= 4)
return read_ranges (unit, arange, trie_root, offset);
}
static struct funcinfo *
-lookup_func_by_offset (bfd_uint64_t offset, struct funcinfo * table)
+lookup_func_by_offset (uint64_t offset, struct funcinfo * table)
{
for (; table != NULL; table = table->prev_func)
if (table->unit_offset == offset)
}
static struct varinfo *
-lookup_var_by_offset (bfd_uint64_t offset, struct varinfo * table)
+lookup_var_by_offset (uint64_t offset, struct varinfo * table)
{
while (table)
{
struct abbrev_info *abbrev;
struct funcinfo *func;
struct varinfo *var;
- bfd_uint64_t current_offset;
+ uint64_t current_offset;
/* PR 17512: file: 9f405d9d. */
if (info_ptr >= info_ptr_end)
bfd_vma low_pc = 0;
bfd_vma high_pc = 0;
bool high_pc_relative = false;
- bfd_uint64_t current_offset;
+ uint64_t current_offset;
/* PR 17512: file: 9f405d9d. */
if (info_ptr >= info_ptr_end)
{
struct comp_unit* unit;
unsigned int version;
- bfd_uint64_t abbrev_offset = 0;
+ uint64_t abbrev_offset = 0;
/* Initialize it just to avoid a GCC false warning. */
unsigned int addr_size = -1;
struct abbrev_info** abbrevs;
score3_bfd_getl48 (const void *p)
{
const bfd_byte *addr = p;
- bfd_uint64_t v;
-
- v = (bfd_uint64_t) addr[4];
- v |= (bfd_uint64_t) addr[5] << 8;
- v |= (bfd_uint64_t) addr[2] << 16;
- v |= (bfd_uint64_t) addr[3] << 24;
- v |= (bfd_uint64_t) addr[0] << 32;
- v |= (bfd_uint64_t) addr[1] << 40;
+ uint64_t v;
+
+ v = (uint64_t) addr[4];
+ v |= (uint64_t) addr[5] << 8;
+ v |= (uint64_t) addr[2] << 16;
+ v |= (uint64_t) addr[3] << 24;
+ v |= (uint64_t) addr[0] << 32;
+ v |= (uint64_t) addr[1] << 40;
return v;
}
struct elf_obj_tdata root;
/* Ident for shared library. */
- bfd_uint64_t ident;
+ uint64_t ident;
/* Used only during link: offset in the .fixups section for this bfd. */
bfd_vma fixups_off;
if (!_bfd_elf_add_dynamic_entry (info, DT_IA_64_VMS_IDENT, 0))
return false;
if (!_bfd_elf_add_dynamic_entry (info, DT_IA_64_VMS_LINKTIME,
- (((bfd_uint64_t)time_hi) << 32)
+ ((uint64_t) time_hi << 32)
+ time_lo))
return false;
if ((isize & 7) != 0)
{
int ishort = 8 - (isize & 7);
- bfd_uint64_t pad = 0;
+ uint64_t pad = 0;
bfd_seek (abfd, isize, SEEK_SET);
bfd_bwrite (&pad, ishort, abfd);
bed->s->swap_dyn_in (abfd, extdyn, &dyn);
if (dyn.d_tag == DT_IA_64_VMS_IDENT)
{
- bfd_uint64_t tagv = dyn.d_un.d_val;
+ uint64_t tagv = dyn.d_un.d_val;
elf_ia64_vms_ident (abfd) = tagv;
break;
}
size_t best_size = 0;
unsigned long int i;
- /* We have a problem here. The following code to optimize the table
- size requires an integer type with more the 32 bits. If
- BFD_HOST_U_64_BIT is set we know about such a type. */
-#ifdef BFD_HOST_U_64_BIT
if (info->optimize)
{
size_t minsize;
size_t maxsize;
- BFD_HOST_U_64_BIT best_chlen = ~((BFD_HOST_U_64_BIT) 0);
+ uint64_t best_chlen = ~((uint64_t) 0);
bfd *dynobj = elf_hash_table (info)->dynobj;
size_t dynsymcount = elf_hash_table (info)->dynsymcount;
const struct elf_backend_data *bed = get_elf_backend_data (dynobj);
for (i = minsize; i < maxsize; ++i)
{
/* Walk through the array of hashcodes and count the collisions. */
- BFD_HOST_U_64_BIT max;
+ uint64_t max;
unsigned long int j;
unsigned long int fact;
free (counts);
}
else
-#endif /* defined (BFD_HOST_U_64_BIT) */
{
- /* This is the fallback solution if no 64bit type is available or if we
- are not supposed to spend much time on optimizations. We select the
- bucket count using a fixed set of numbers. */
for (i = 0; elf_buckets[i] != 0; i++)
{
best_size = elf_buckets[i];
return aval;
}
-#ifdef BFD_HOST_64_BIT
static bfd_vma
ext64l_r_offset (const void *p)
{
| (uint64_t) a->c[7]);
return aval;
}
-#endif
/* When performing a relocatable link, the input relocations are
preserved. But, if they reference global symbols, the indices
}
else
{
-#ifdef BFD_HOST_64_BIT
if (abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE)
ext_r_off = ext64l_r_offset;
else if (abfd->xvec->header_byteorder == BFD_ENDIAN_BIG)
ext_r_off = ext64b_r_offset;
else
-#endif
abort ();
}
enum ia64_opnd opnd;
const char *err;
size_t size = 8;
-#ifdef BFD_HOST_U_64_BIT
- BFD_HOST_U_64_BIT val = (BFD_HOST_U_64_BIT) v;
-#else
- bfd_vma val = v;
-#endif
+ uint64_t val = v;
opnd = IA64_OPND_NIL;
switch (r_type)
#define NO_GET ((bfd_vma (*) (const void *)) swap_abort)
#define NO_PUT ((void (*) (bfd_vma, void *)) swap_abort)
#define NO_GETS ((bfd_signed_vma (*) (const void *)) swap_abort)
-#define NO_GET64 ((bfd_uint64_t (*) (const void *)) swap_abort)
-#define NO_PUT64 ((void (*) (bfd_uint64_t, void *)) swap_abort)
-#define NO_GETS64 ((bfd_int64_t (*) (const void *)) swap_abort)
+#define NO_GET64 ((uint64_t (*) (const void *)) swap_abort)
+#define NO_PUT64 ((void (*) (uint64_t, void *)) swap_abort)
+#define NO_GETS64 ((int64_t (*) (const void *)) swap_abort)
const bfd_target core_hppabsd_vec =
{
#define NO_GET ((bfd_vma (*) (const void *)) swap_abort)
#define NO_PUT ((void (*) (bfd_vma, void *)) swap_abort)
#define NO_GETS ((bfd_signed_vma (*) (const void *)) swap_abort)
-#define NO_GET64 ((bfd_uint64_t (*) (const void *)) swap_abort)
-#define NO_PUT64 ((void (*) (bfd_uint64_t, void *)) swap_abort)
-#define NO_GETS64 ((bfd_int64_t (*) (const void *)) swap_abort)
+#define NO_GET64 ((uint64_t (*) (const void *)) swap_abort)
+#define NO_PUT64 ((void (*) (uint64_t, void *)) swap_abort)
+#define NO_GETS64 ((int64_t (*) (const void *)) swap_abort)
const bfd_target core_hpux_vec =
{
#define NO_GET ((bfd_vma (*) (const void *)) swap_abort)
#define NO_PUT ((void (*) (bfd_vma, void *)) swap_abort)
#define NO_GETS ((bfd_signed_vma (*) (const void *)) swap_abort)
-#define NO_GET64 ((bfd_uint64_t (*) (const void *)) swap_abort)
-#define NO_PUT64 ((void (*) (bfd_uint64_t, void *)) swap_abort)
-#define NO_GETS64 ((bfd_int64_t (*) (const void *)) swap_abort)
+#define NO_GET64 ((uint64_t (*) (const void *)) swap_abort)
+#define NO_PUT64 ((void (*) (uint64_t, void *)) swap_abort)
+#define NO_GETS64 ((int64_t (*) (const void *)) swap_abort)
const bfd_target core_irix_vec =
{
#define COERCE16(x) (((bfd_vma) (x) ^ 0x8000) - 0x8000)
#define COERCE32(x) (((bfd_vma) (x) ^ 0x80000000) - 0x80000000)
#define COERCE64(x) \
- (((bfd_uint64_t) (x) ^ ((bfd_uint64_t) 1 << 63)) - ((bfd_uint64_t) 1 << 63))
+ (((uint64_t) (x) ^ ((uint64_t) 1 << 63)) - ((uint64_t) 1 << 63))
bfd_vma
bfd_getb16 (const void *p)
return COERCE32 (v);
}
-bfd_uint64_t
-bfd_getb64 (const void *p ATTRIBUTE_UNUSED)
+uint64_t
+bfd_getb64 (const void *p)
{
-#ifdef BFD_HOST_64_BIT
const bfd_byte *addr = (const bfd_byte *) p;
- bfd_uint64_t v;
+ uint64_t v;
v = addr[0]; v <<= 8;
v |= addr[1]; v <<= 8;
v |= addr[7];
return v;
-#else
- BFD_FAIL();
- return 0;
-#endif
}
-bfd_uint64_t
-bfd_getl64 (const void *p ATTRIBUTE_UNUSED)
+uint64_t
+bfd_getl64 (const void *p)
{
-#ifdef BFD_HOST_64_BIT
const bfd_byte *addr = (const bfd_byte *) p;
- bfd_uint64_t v;
+ uint64_t v;
v = addr[7]; v <<= 8;
v |= addr[6]; v <<= 8;
v |= addr[0];
return v;
-#else
- BFD_FAIL();
- return 0;
-#endif
-
}
-bfd_int64_t
-bfd_getb_signed_64 (const void *p ATTRIBUTE_UNUSED)
+int64_t
+bfd_getb_signed_64 (const void *p)
{
-#ifdef BFD_HOST_64_BIT
const bfd_byte *addr = (const bfd_byte *) p;
- bfd_uint64_t v;
+ uint64_t v;
v = addr[0]; v <<= 8;
v |= addr[1]; v <<= 8;
v |= addr[7];
return COERCE64 (v);
-#else
- BFD_FAIL();
- return 0;
-#endif
}
-bfd_int64_t
-bfd_getl_signed_64 (const void *p ATTRIBUTE_UNUSED)
+int64_t
+bfd_getl_signed_64 (const void *p)
{
-#ifdef BFD_HOST_64_BIT
const bfd_byte *addr = (const bfd_byte *) p;
- bfd_uint64_t v;
+ uint64_t v;
v = addr[7]; v <<= 8;
v |= addr[6]; v <<= 8;
v |= addr[0];
return COERCE64 (v);
-#else
- BFD_FAIL();
- return 0;
-#endif
}
void
}
void
-bfd_putb64 (bfd_uint64_t data ATTRIBUTE_UNUSED, void *p ATTRIBUTE_UNUSED)
+bfd_putb64 (uint64_t data, void *p)
{
-#ifdef BFD_HOST_64_BIT
bfd_byte *addr = (bfd_byte *) p;
addr[0] = (data >> (7*8)) & 0xff;
addr[1] = (data >> (6*8)) & 0xff;
addr[5] = (data >> (2*8)) & 0xff;
addr[6] = (data >> (1*8)) & 0xff;
addr[7] = (data >> (0*8)) & 0xff;
-#else
- BFD_FAIL();
-#endif
}
void
-bfd_putl64 (bfd_uint64_t data ATTRIBUTE_UNUSED, void *p ATTRIBUTE_UNUSED)
+bfd_putl64 (uint64_t data, void *p)
{
-#ifdef BFD_HOST_64_BIT
bfd_byte *addr = (bfd_byte *) p;
addr[7] = (data >> (7*8)) & 0xff;
addr[6] = (data >> (6*8)) & 0xff;
addr[2] = (data >> (2*8)) & 0xff;
addr[1] = (data >> (1*8)) & 0xff;
addr[0] = (data >> (0*8)) & 0xff;
-#else
- BFD_FAIL();
-#endif
}
void
-bfd_put_bits (bfd_uint64_t data, void *p, int bits, bool big_p)
+bfd_put_bits (uint64_t data, void *p, int bits, bool big_p)
{
bfd_byte *addr = (bfd_byte *) p;
int i;
}
}
-bfd_uint64_t
+uint64_t
bfd_get_bits (const void *p, int bits, bool big_p)
{
const bfd_byte *addr = (const bfd_byte *) p;
- bfd_uint64_t data;
+ uint64_t data;
int i;
int bytes;
{
bfd_mach_o_source_version_command *cmd = &command->command.source_version;
struct mach_o_source_version_command_external raw;
- bfd_uint64_t ver;
+ uint64_t ver;
if (command->len < sizeof (raw) + 8)
return false;
typedef struct bfd_mach_o_main_command
{
- bfd_uint64_t entryoff;
- bfd_uint64_t stacksize;
+ uint64_t entryoff;
+ uint64_t stacksize;
}
bfd_mach_o_main_command;
typedef struct bfd_mach_o_note_command
{
char data_owner[16];
- bfd_uint64_t offset;
- bfd_uint64_t size;
+ uint64_t offset;
+ uint64_t size;
}
bfd_mach_o_note_command;
#define NO_GET ((bfd_vma (*) (const void *)) swap_abort)
#define NO_PUT ((void (*) (bfd_vma, void *)) swap_abort)
#define NO_GETS ((bfd_signed_vma (*) (const void *)) swap_abort)
-#define NO_GET64 ((bfd_uint64_t (*) (const void *)) swap_abort)
-#define NO_PUT64 ((void (*) (bfd_uint64_t, void *)) swap_abort)
-#define NO_GETS64 ((bfd_int64_t (*) (const void *)) swap_abort)
+#define NO_GET64 ((uint64_t (*) (const void *)) swap_abort)
+#define NO_PUT64 ((void (*) (uint64_t, void *)) swap_abort)
+#define NO_GETS64 ((int64_t (*) (const void *)) swap_abort)
const bfd_target core_netbsd_vec =
{
#define NO_GET ((bfd_vma (*) (const void *)) swap_abort)
#define NO_PUT ((void (*) (bfd_vma, void *)) swap_abort)
#define NO_GETS ((bfd_signed_vma (*) (const void *)) swap_abort)
-#define NO_GET64 ((bfd_uint64_t (*) (const void *)) swap_abort)
-#define NO_PUT64 ((void (*) (bfd_uint64_t, void *)) swap_abort)
-#define NO_GETS64 ((bfd_int64_t (*) (const void *)) swap_abort)
+#define NO_GET64 ((uint64_t (*) (const void *)) swap_abort)
+#define NO_PUT64 ((void (*) (uint64_t, void *)) swap_abort)
+#define NO_GETS64 ((int64_t (*) (const void *)) swap_abort)
const bfd_target core_osf_vec =
{
#define NO_GET ((bfd_vma (*) (const void *)) swap_abort)
#define NO_PUT ((void (*) (bfd_vma, void *)) swap_abort)
#define NO_GETS ((bfd_signed_vma (*) (const void *)) swap_abort)
-#define NO_GET64 ((bfd_uint64_t (*) (const void *)) swap_abort)
-#define NO_PUT64 ((void (*) (bfd_uint64_t, void *)) swap_abort)
-#define NO_GETS64 ((bfd_int64_t (*) (const void *)) swap_abort)
+#define NO_GET64 ((uint64_t (*) (const void *)) swap_abort)
+#define NO_PUT64 ((void (*) (uint64_t, void *)) swap_abort)
+#define NO_GETS64 ((int64_t (*) (const void *)) swap_abort)
const bfd_target core_ptrace_vec =
{
#define NO_GET ((bfd_vma (*) (const void *)) swap_abort)
#define NO_PUT ((void (*) (bfd_vma, void *)) swap_abort)
#define NO_GETS ((bfd_signed_vma (*) (const void *)) swap_abort)
-#define NO_GET64 ((bfd_uint64_t (*) (const void *)) swap_abort)
-#define NO_PUT64 ((void (*) (bfd_uint64_t, void *)) swap_abort)
-#define NO_GETS64 ((bfd_int64_t (*) (const void *)) swap_abort)
+#define NO_GET64 ((uint64_t (*) (const void *)) swap_abort)
+#define NO_PUT64 ((void (*) (uint64_t, void *)) swap_abort)
+#define NO_GETS64 ((int64_t (*) (const void *)) swap_abort)
const bfd_target core_sco5_vec =
{
. {* Entries for byte swapping for data. These are different from the
. other entry points, since they don't take a BFD as the first argument.
. Certain other handlers could do the same. *}
-. bfd_uint64_t (*bfd_getx64) (const void *);
-. bfd_int64_t (*bfd_getx_signed_64) (const void *);
-. void (*bfd_putx64) (bfd_uint64_t, void *);
+. uint64_t (*bfd_getx64) (const void *);
+. int64_t (*bfd_getx_signed_64) (const void *);
+. void (*bfd_putx64) (uint64_t, void *);
. bfd_vma (*bfd_getx32) (const void *);
. bfd_signed_vma (*bfd_getx_signed_32) (const void *);
. void (*bfd_putx32) (bfd_vma, void *);
. void (*bfd_putx16) (bfd_vma, void *);
.
. {* Byte swapping for the headers. *}
-. bfd_uint64_t (*bfd_h_getx64) (const void *);
-. bfd_int64_t (*bfd_h_getx_signed_64) (const void *);
-. void (*bfd_h_putx64) (bfd_uint64_t, void *);
+. uint64_t (*bfd_h_getx64) (const void *);
+. int64_t (*bfd_h_getx_signed_64) (const void *);
+. void (*bfd_h_putx64) (uint64_t, void *);
. bfd_vma (*bfd_h_getx32) (const void *);
. bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
. void (*bfd_h_putx32) (bfd_vma, void *);
#define NO_GET ((bfd_vma (*) (const void *)) swap_abort)
#define NO_PUT ((void (*) (bfd_vma, void *)) swap_abort)
#define NO_GETS ((bfd_signed_vma (*) (const void *)) swap_abort)
-#define NO_GET64 ((bfd_uint64_t (*) (const void *)) swap_abort)
-#define NO_PUT64 ((void (*) (bfd_uint64_t, void *)) swap_abort)
-#define NO_GETS64 ((bfd_int64_t (*) (const void *)) swap_abort)
+#define NO_GET64 ((uint64_t (*) (const void *)) swap_abort)
+#define NO_PUT64 ((void (*) (uint64_t, void *)) swap_abort)
+#define NO_GETS64 ((int64_t (*) (const void *)) swap_abort)
const bfd_target core_trad_vec =
{
struct vms_eisd *eisd;
unsigned int rec_size;
unsigned int size;
- bfd_uint64_t vaddr;
+ uint64_t vaddr;
unsigned int flags;
unsigned int vbn;
char *name = NULL;
padding = "016";
}
- const char * length = "l";
- if (print_width == 64)
- {
-#if BFD_HOST_64BIT_LONG
- ;
-#elif BFD_HOST_64BIT_LONG_LONG
-#ifndef __MSVCRT__
- length = "ll";
-#else
- length = "I64";
-#endif
-#endif
- }
-
const char * radix = NULL;
switch (print_radix)
{
- case 8: radix = "o"; break;
- case 10: radix = "d"; break;
- case 16: radix = "x"; break;
+ case 8: radix = PRIo64; break;
+ case 10: radix = PRId64; break;
+ case 16: radix = PRIx64; break;
}
- return concat ("%", padding, length, radix, NULL);
+ return concat ("%", padding, radix, NULL);
}
static void
switch (print_width)
{
case 32:
- printf (print_format_string, (unsigned long) val);
- break;
-
case 64:
-#if BFD_HOST_64BIT_LONG || BFD_HOST_64BIT_LONG_LONG
- printf (print_format_string, val);
-#else
- /* We have a 64 bit value to print, but the host is only 32 bit. */
- if (print_radix == 16)
- bfd_fprintf_vma (abfd, stdout, val);
- else
- {
- char buf[30];
- char *s;
-
- s = buf + sizeof buf;
- *--s = '\0';
- while (val > 0)
- {
- *--s = (val % print_radix) + '0';
- val /= print_radix;
- }
- while ((buf + sizeof buf - 1) - s < 16)
- *--s = '0';
- printf ("%s", s);
- }
-#endif
+ printf (print_format_string, (uint64_t) val);
break;
default:
printf ("-");
}
-/* Print a bfd_uint64_t, using a platform independent style. */
-
-static void
-printf_uint64 (bfd_uint64_t v)
-{
- printf ("0x%08lx%08lx",
- (unsigned long)((v >> 16) >> 16), (unsigned long)(v & 0xffffffffUL));
-}
-
static const char *
bfd_mach_o_get_name_or_null (const bfd_mach_o_xlat_name *table,
unsigned long val)
}
case BFD_MACH_O_LC_MAIN:
{
- bfd_mach_o_main_command *entry = &cmd->command.main;
- printf (" entry offset: ");
- printf_uint64 (entry->entryoff);
- printf ("\n"
- " stack size: ");
- printf_uint64 (entry->stacksize);
- printf ("\n");
- break;
+ bfd_mach_o_main_command *entry = &cmd->command.main;
+ printf (" entry offset: %#016" PRIx64 "\n"
+ " stack size: %#016" PRIx64 "\n",
+ entry->entryoff, entry->stacksize);
+ break;
}
case BFD_MACH_O_LC_NOTE:
{
- bfd_mach_o_note_command *note = &cmd->command.note;
- printf (" data owner: %.16s\n", note->data_owner);
- printf (" offset: ");
- printf_uint64 (note->offset);
- printf ("\n"
- " size: ");
- printf_uint64 (note->size);
- printf ("\n");
- break;
+ bfd_mach_o_note_command *note = &cmd->command.note;
+ printf (" data owner: %.16s\n"
+ " offset: %#016" PRIx64 "\n"
+ " size: %#016" PRIx64 "\n",
+ note->data_owner, note->offset, note->size);
+ break;
}
case BFD_MACH_O_LC_BUILD_VERSION:
dump_build_version (abfd, cmd);
{
e = (struct mach_o_compact_unwind_64 *) p;
- putchar (' ');
- printf_uint64 (bfd_get_64 (abfd, e->start));
- printf (" %08lx", (unsigned long)bfd_get_32 (abfd, e->length));
- putchar (' ');
- printf_uint64 (bfd_get_64 (abfd, e->personality));
- putchar (' ');
- printf_uint64 (bfd_get_64 (abfd, e->lsda));
- putchar ('\n');
+ printf (" %#016" PRIx64 " %#08x %#016" PRIx64 " %#016" PRIx64 "\n",
+ (uint64_t) bfd_get_64 (abfd, e->start),
+ (unsigned int) bfd_get_32 (abfd, e->length),
+ (uint64_t) bfd_get_64 (abfd, e->personality),
+ (uint64_t) bfd_get_64 (abfd, e->lsda));
printf (" encoding: ");
dump_unwind_encoding (mdata, bfd_get_32 (abfd, e->encoding));
static void
print_vma (bfd_vma vma, char *buf, bool unsignedp, bool hexp)
{
- if (sizeof (vma) <= sizeof (unsigned long))
- {
- if (hexp)
- sprintf (buf, "0x%lx", (unsigned long) vma);
- else if (unsignedp)
- sprintf (buf, "%lu", (unsigned long) vma);
- else
- sprintf (buf, "%ld", (long) vma);
- }
-#if BFD_HOST_64BIT_LONG_LONG
- else if (sizeof (vma) <= sizeof (unsigned long long))
- {
-#ifndef __MSVCRT__
- if (hexp)
- sprintf (buf, "0x%llx", (unsigned long long) vma);
- else if (unsignedp)
- sprintf (buf, "%llu", (unsigned long long) vma);
- else
- sprintf (buf, "%lld", (long long) vma);
-#else
- if (hexp)
- sprintf (buf, "0x%I64x", (unsigned long long) vma);
- else if (unsignedp)
- sprintf (buf, "%I64u", (unsigned long long) vma);
- else
- sprintf (buf, "%I64d", (long long) vma);
-#endif
- }
-#endif
+ if (hexp)
+ sprintf (buf, "%#" PRIx64, (uint64_t) vma);
+ else if (unsignedp)
+ sprintf (buf, "%" PRIu64, (uint64_t) vma);
else
- {
- buf[0] = '0';
- buf[1] = 'x';
- sprintf_vma (buf + 2, vma);
- }
+ sprintf (buf, "%" PRId64, (int64_t) vma);
}
\f
/* Start a new compilation unit. */
/* Display a VMS time in a human readable format. */
static void
-print_vms_time (bfd_int64_t vmstime)
+print_vms_time (int64_t vmstime)
{
struct tm *tm = NULL;
time_t unxtime;
/* FIXME: Generate an error if descsz > 8 ? */
printf ("0x%016" BFD_VMA_FMT "x\n",
- (bfd_vma) byte_get ((unsigned char *)pnote->descdata, 8));
+ (bfd_vma) byte_get ((unsigned char *) pnote->descdata, 8));
break;
case NT_VMS_LINKTIME:
goto desc_size_fail;
/* FIXME: Generate an error if descsz > 8 ? */
- print_vms_time
- ((bfd_int64_t) byte_get ((unsigned char *)pnote->descdata, 8));
+ print_vms_time (byte_get ((unsigned char *) pnote->descdata, 8));
printf ("\n");
break;
goto desc_size_fail;
/* FIXME: Generate an error if descsz > 8 ? */
- print_vms_time
- ((bfd_int64_t) byte_get ((unsigned char *)pnote->descdata, 8));
+ print_vms_time (byte_get ((unsigned char *) pnote->descdata, 8));
printf ("\n");
break;
goto desc_size_fail;
printf (_(" Major id: %u, minor id: %u\n"),
- (unsigned) byte_get ((unsigned char *)pnote->descdata, 4),
- (unsigned) byte_get ((unsigned char *)pnote->descdata + 4, 4));
+ (unsigned) byte_get ((unsigned char *) pnote->descdata, 4),
+ (unsigned) byte_get ((unsigned char *) pnote->descdata + 4, 4));
printf (_(" Last modified : "));
- print_vms_time
- ((bfd_int64_t) byte_get ((unsigned char *)pnote->descdata + 8, 8));
+ print_vms_time (byte_get ((unsigned char *) pnote->descdata + 8, 8));
printf (_("\n Link flags : "));
printf ("0x%016" BFD_VMA_FMT "x\n",
- (bfd_vma) byte_get ((unsigned char *)pnote->descdata + 16, 8));
+ (bfd_vma) byte_get ((unsigned char *) pnote->descdata + 16, 8));
printf (_(" Header flags: 0x%08x\n"),
- (unsigned) byte_get ((unsigned char *)pnote->descdata + 24, 4));
+ (unsigned) byte_get ((unsigned char *) pnote->descdata + 24, 4));
printf (_(" Image id : %.*s\n"), maxlen - 32, pnote->descdata + 32);
break;
#endif
imm1 = inst.operands[1].imm;
imm2 = (inst.operands[1].regisimm ? inst.operands[1].reg
: inst.relocs[0].exp.X_unsigned ? 0
- : ((bfd_int64_t) inst.operands[1].imm) >> 32);
+ : (int64_t) inst.operands[1].imm >> 32);
if (target_big_endian)
{
imm1 = imm2;
return FAIL;
}
-#if defined BFD_HOST_64_BIT
/* Returns TRUE if double precision value V may be cast
to single precision without loss of accuracy. */
static bool
-is_double_a_single (bfd_uint64_t v)
+is_double_a_single (uint64_t v)
{
int exp = (v >> 52) & 0x7FF;
- bfd_uint64_t mantissa = v & 0xFFFFFFFFFFFFFULL;
+ uint64_t mantissa = v & 0xFFFFFFFFFFFFFULL;
return ((exp == 0 || exp == 0x7FF
|| (exp >= 1023 - 126 && exp <= 1023 + 127))
(ignoring the least significant bits in exponent and mantissa). */
static int
-double_to_single (bfd_uint64_t v)
+double_to_single (uint64_t v)
{
unsigned int sign = (v >> 63) & 1;
int exp = (v >> 52) & 0x7FF;
- bfd_uint64_t mantissa = v & 0xFFFFFFFFFFFFFULL;
+ uint64_t mantissa = v & 0xFFFFFFFFFFFFFULL;
if (exp == 0x7FF)
exp = 0xFF;
mantissa >>= 29;
return (sign << 31) | (exp << 23) | mantissa;
}
-#endif /* BFD_HOST_64_BIT */
enum lit_type
{
if (inst.relocs[0].exp.X_op == O_constant
|| inst.relocs[0].exp.X_op == O_big)
{
-#if defined BFD_HOST_64_BIT
- bfd_uint64_t v;
-#else
- valueT v;
-#endif
+ uint64_t v;
if (inst.relocs[0].exp.X_op == O_big)
{
LITTLENUM_TYPE w[X_PRECISION];
else
l = generic_bignum;
-#if defined BFD_HOST_64_BIT
v = l[3] & LITTLENUM_MASK;
v <<= LITTLENUM_NUMBER_OF_BITS;
v |= l[2] & LITTLENUM_MASK;
v |= l[1] & LITTLENUM_MASK;
v <<= LITTLENUM_NUMBER_OF_BITS;
v |= l[0] & LITTLENUM_MASK;
-#else
- v = l[1] & LITTLENUM_MASK;
- v <<= LITTLENUM_NUMBER_OF_BITS;
- v |= l[0] & LITTLENUM_MASK;
-#endif
}
else
v = inst.relocs[0].exp.X_add_number;
? inst.operands[1].reg
: inst.relocs[0].exp.X_unsigned
? 0
- : ((bfd_int64_t)((int) immlo)) >> 32;
+ : (int64_t) (int) immlo >> 32;
int cmode = neon_cmode_for_move_imm (immlo, immhi, false, &immbits,
&op, 64, NT_invtype);
discrepancy between the output produced by an assembler built for
a 32-bit-only host and the output produced from a 64-bit host, but
this cannot be helped. */
-#if defined BFD_HOST_64_BIT
else if (!inst.operands[1].issingle
&& ARM_CPU_HAS_FEATURE (cpu_variant, fpu_vfp_ext_v3))
{
return true;
}
}
-#endif
}
}
unsigned int mach_flag = 0;
unsigned int arch_flag = 0;
unsigned int other_flag = 0;
-BFD_HOST_U_64_BIT isa_flag = 0;
+uint64_t isa_flag = 0;
unsigned int dsp_flag = 0;
typedef struct stack_size_entry
const char *name;
/* How many operands : if operands == 5, all of 1,2,3,4 are ok. */
long oprnd_num;
- BFD_HOST_U_64_BIT isa_flag;
+ uint64_t isa_flag;
/* Do the work. */
void (*handle_func)(void);
};
{
const char unique;
unsigned int arch_flag;
- bfd_uint64_t isa_flag;
+ uint64_t isa_flag;
};
struct csky_cpu_version
{
int r;
int p;
- bfd_uint64_t isa_flag;
+ uint64_t isa_flag;
};
#define CSKY_FEATURE_MAX 10
{
const char *name;
unsigned int arch_flag;
- bfd_uint64_t isa_flag;
+ uint64_t isa_flag;
struct csky_cpu_feature features[CSKY_FEATURE_MAX];
struct csky_cpu_version ver[CSKY_CPU_REVERISON_MAX];
};
#ifndef TE_SOLARIS
/* Bitmask of instruction types seen so far, used to populate the
GNU attributes section with hwcap information. */
-static bfd_uint64_t hwcap_seen;
+static uint64_t hwcap_seen;
#endif
-static bfd_uint64_t hwcap_allowed;
+static uint64_t hwcap_allowed;
static int architecture_requested;
static int warn_on_bump;
|| opcode_arch > max_architecture)
max_architecture = opcode_arch;
- /* The allowed hardware capabilities are the implied by the
- opcodes arch plus any extra capabilities defined in the GAS
- arch. */
- hwcap_allowed
- = (hwcap_allowed
- | (((bfd_uint64_t) sparc_opcode_archs[opcode_arch].hwcaps2) << 32)
- | (((bfd_uint64_t) sa->hwcap2_allowed) << 32)
- | sparc_opcode_archs[opcode_arch].hwcaps
- | sa->hwcap_allowed);
+ /* The allowed hardware capabilities are the implied by the
+ opcodes arch plus any extra capabilities defined in the GAS
+ arch. */
+ hwcap_allowed
+ = (hwcap_allowed
+ | ((uint64_t) sparc_opcode_archs[opcode_arch].hwcaps2 << 32)
+ | ((uint64_t) sa->hwcap2_allowed << 32)
+ | sparc_opcode_archs[opcode_arch].hwcaps
+ | sa->hwcap_allowed);
architecture_requested = 1;
}
break;
}
static const char *
-get_hwcap_name (bfd_uint64_t mask)
+get_hwcap_name (uint64_t mask)
{
if (mask & HWCAP_MUL32)
return "mul32";
msg_str = sasi->name;
}
- bfd_uint64_t hwcaps
- = (((bfd_uint64_t) insn->hwcaps2) << 32) | insn->hwcaps;
+ uint64_t hwcaps = ((uint64_t) insn->hwcaps2 << 32) | insn->hwcaps;
#ifndef TE_SOLARIS
if (hwcaps)
}
current_architecture = needed_architecture;
hwcap_allowed
- = (hwcap_allowed
- | hwcaps
- | (((bfd_uint64_t) sparc_opcode_archs[current_architecture].hwcaps2) << 32)
- | sparc_opcode_archs[current_architecture].hwcaps);
+ = (hwcap_allowed
+ | hwcaps
+ | ((uint64_t) sparc_opcode_archs[current_architecture].hwcaps2 << 32)
+ | sparc_opcode_archs[current_architecture].hwcaps);
}
/* Conflict. */
/* ??? This seems to be a bit fragile. What if the next entry in
static void
check_illegal_reg_writes (void)
{
- BFD_HOST_U_64_BIT all_regs_written = 0;
+ uint64_t all_regs_written = 0;
int j;
for (j = 0; j < current_bundle_index; j++)
{
const struct tilegx_instruction *instr = ¤t_bundle[j];
int k;
- BFD_HOST_U_64_BIT regs =
- ((BFD_HOST_U_64_BIT)1) << instr->opcode->implicitly_written_register;
- BFD_HOST_U_64_BIT conflict;
+ uint64_t regs =
+ (uint64_t) 1 << instr->opcode->implicitly_written_register;
+ uint64_t conflict;
for (k = 0; k < instr->opcode->num_operands; k++)
{
if (operand->is_dest_reg)
{
int regno = instr->operand_values[k].X_add_number;
- BFD_HOST_U_64_BIT mask = ((BFD_HOST_U_64_BIT)1) << regno;
+ uint64_t mask = (uint64_t) 1 << regno;
- if ((mask & ( (((BFD_HOST_U_64_BIT)1) << TREG_IDN1)
- | (((BFD_HOST_U_64_BIT)1) << TREG_UDN1)
- | (((BFD_HOST_U_64_BIT)1) << TREG_UDN2)
- | (((BFD_HOST_U_64_BIT)1) << TREG_UDN3))) != 0
+ if ((mask & ( ((uint64_t) 1 << TREG_IDN1)
+ | ((uint64_t) 1 << TREG_UDN1)
+ | ((uint64_t) 1 << TREG_UDN2)
+ | ((uint64_t) 1 << TREG_UDN3))) != 0
&& !allow_suspicious_bundles)
{
as_bad (_("Writes to register '%s' are not allowed."),
}
/* Writing to the zero register doesn't count. */
- regs &= ~(((BFD_HOST_U_64_BIT)1) << TREG_ZERO);
+ regs &= ~((uint64_t) 1 << TREG_ZERO);
conflict = all_regs_written & regs;
if (conflict != 0 && !allow_suspicious_bundles)
static void
check_illegal_reg_writes (void)
{
- BFD_HOST_U_64_BIT all_regs_written = 0;
+ uint64_t all_regs_written = 0;
int j;
for (j = 0; j < current_bundle_index; j++)
{
const struct tilepro_instruction *instr = ¤t_bundle[j];
int k;
- BFD_HOST_U_64_BIT regs =
- ((BFD_HOST_U_64_BIT)1) << instr->opcode->implicitly_written_register;
- BFD_HOST_U_64_BIT conflict;
+ uint64_t regs =
+ (uint64_t) 1 << instr->opcode->implicitly_written_register;
+ uint64_t conflict;
for (k = 0; k < instr->opcode->num_operands; k++)
{
if (operand->is_dest_reg)
{
int regno = instr->operand_values[k].X_add_number;
- BFD_HOST_U_64_BIT mask = ((BFD_HOST_U_64_BIT)1) << regno;
+ uint64_t mask = (uint64_t) 1 << regno;
- if ((mask & ( (((BFD_HOST_U_64_BIT)1) << TREG_IDN1)
- | (((BFD_HOST_U_64_BIT)1) << TREG_UDN1)
- | (((BFD_HOST_U_64_BIT)1) << TREG_UDN2)
- | (((BFD_HOST_U_64_BIT)1) << TREG_UDN3))) != 0
+ if ((mask & ( ((uint64_t) 1 << TREG_IDN1)
+ | ((uint64_t) 1 << TREG_UDN1)
+ | ((uint64_t) 1 << TREG_UDN2)
+ | ((uint64_t) 1 << TREG_UDN3))) != 0
&& !allow_suspicious_bundles)
{
as_bad (_("Writes to register '%s' are not allowed."),
}
/* Writing to the zero register doesn't count. */
- regs &= ~(((BFD_HOST_U_64_BIT)1) << TREG_ZERO);
+ regs &= ~((uint64_t) 1 << TREG_ZERO);
conflict = all_regs_written & regs;
if (conflict != 0 && !allow_suspicious_bundles)
#define EXP_MIN -0x10000
#define EXP_MAX 0x10000
static int
-str_to_broken_float (bool *signP, bfd_uint64_t *mantissaP, int *expP)
+str_to_broken_float (bool *signP, uint64_t *mantissaP, int *expP)
{
char *p;
bool sign;
- bfd_uint64_t mantissa = 0;
+ uint64_t mantissa = 0;
int exponent = 0;
int i;
static const char *
str_to_zeda32(char *litP, int *sizeP)
{
- bfd_uint64_t mantissa;
+ uint64_t mantissa;
bool sign;
int exponent;
unsigned i;
static const char *
str_to_float48(char *litP, int *sizeP)
{
- bfd_uint64_t mantissa;
+ uint64_t mantissa;
bool sign;
int exponent;
unsigned i;
return 0;
}
-bfd_uint64_t
+uint64_t
vms_dwarf2_file_time_name (const char *filename, const char *dirname)
{
long long cdt;
#define TE_VMS
#include "obj-format.h"
-extern bfd_uint64_t vms_dwarf2_file_time_name (const char *, const char *);
+extern uint64_t vms_dwarf2_file_time_name (const char *, const char *);
extern long vms_dwarf2_file_size_name (const char *, const char *);
extern char *vms_dwarf2_file_name (const char *, const char *);
/* Copied from bfd_put_bits. */
static void
-put_bits (bfd_uint64_t data, gdb::byte_vector &buf, int bits, bfd_boolean big_p)
+put_bits (uint64_t data, gdb::byte_vector &buf, int bits, bfd_boolean big_p)
{
int i;
int bytes;
CORE_ADDR instbuf_start;
unsigned int instbuf_size;
int status;
- bfd_uint64_t bundle;
+ uint64_t bundle;
struct tilegx_decoded_instruction
decoded[TILEGX_MAX_INSTRUCTIONS_PER_BUNDLE];
int num_insns;
static enum gmon_ptr_size gmon_get_ptr_size (void);
static enum gmon_ptr_signedness gmon_get_ptr_signedness (void);
-#ifdef BFD_HOST_U_64_BIT
-static int gmon_io_read_64 (FILE *, BFD_HOST_U_64_BIT *);
-static int gmon_io_write_64 (FILE *, BFD_HOST_U_64_BIT);
-#endif
+static int gmon_io_read_64 (FILE *, uint64_t *);
+static int gmon_io_write_64 (FILE *, uint64_t);
static int gmon_read_raw_arc
(FILE *, bfd_vma *, bfd_vma *, unsigned long *);
static int gmon_write_raw_arc
return 0;
}
-#ifdef BFD_HOST_U_64_BIT
static int
-gmon_io_read_64 (FILE *ifp, BFD_HOST_U_64_BIT *valp)
+gmon_io_read_64 (FILE *ifp, uint64_t *valp)
{
char buf[8];
*valp = bfd_get_64 (core_bfd, buf);
return 0;
}
-#endif
int
gmon_io_read_vma (FILE *ifp, bfd_vma *valp)
{
unsigned int val32;
-#ifdef BFD_HOST_U_64_BIT
- BFD_HOST_U_64_BIT val64;
-#endif
+ uint64_t val64;
switch (gmon_get_ptr_size ())
{
if (gmon_io_read_32 (ifp, &val32))
return 1;
if (gmon_get_ptr_signedness () == ptr_signed)
- *valp = (int) val32;
+ *valp = (int) val32;
else
- *valp = val32;
+ *valp = val32;
break;
-#ifdef BFD_HOST_U_64_BIT
case ptr_64bit:
if (gmon_io_read_64 (ifp, &val64))
return 1;
-#ifdef BFD_HOST_64_BIT
if (gmon_get_ptr_signedness () == ptr_signed)
- *valp = (BFD_HOST_64_BIT) val64;
+ *valp = (int64_t) val64;
else
-#endif
- *valp = val64;
+ *valp = val64;
break;
-#endif
}
return 0;
}
return 0;
}
-#ifdef BFD_HOST_U_64_BIT
static int
-gmon_io_write_64 (FILE *ofp, BFD_HOST_U_64_BIT val)
+gmon_io_write_64 (FILE *ofp, uint64_t val)
{
char buf[8];
return 1;
return 0;
}
-#endif
int
gmon_io_write_vma (FILE *ofp, bfd_vma val)
return 1;
break;
-#ifdef BFD_HOST_U_64_BIT
case ptr_64bit:
- if (gmon_io_write_64 (ofp, (BFD_HOST_U_64_BIT) val))
+ if (gmon_io_write_64 (ofp, (uint64_t) val))
return 1;
break;
-#endif
}
return 0;
}
static int
gmon_read_raw_arc (FILE *ifp, bfd_vma *fpc, bfd_vma *spc, unsigned long *cnt)
{
-#ifdef BFD_HOST_U_64_BIT
- BFD_HOST_U_64_BIT cnt64;
-#endif
+ uint64_t cnt64;
unsigned int cnt32;
if (gmon_io_read_vma (ifp, fpc)
*cnt = cnt32;
break;
-#ifdef BFD_HOST_U_64_BIT
case ptr_64bit:
if (gmon_io_read_64 (ifp, &cnt64))
return 1;
*cnt = cnt64;
break;
-#endif
default:
return 1;
return 1;
break;
-#ifdef BFD_HOST_U_64_BIT
case ptr_64bit:
- if (gmon_io_write_64 (ofp, (BFD_HOST_U_64_BIT) cnt))
+ if (gmon_io_write_64 (ofp, (uint64_t) cnt))
return 1;
break;
-#endif
}
return 0;
}
#define SHF_NFP_INIT 0x80000000
#define SHF_NFP_INIT2 0x40000000
#define SHF_NFP_SCS(shf) (((shf) >> 32) & 0xFF)
-#define SHF_NFP_SET_SCS(v) (((BFD_HOST_U_64_BIT)((v) & 0xFF)) << 32)
+#define SHF_NFP_SET_SCS(v) ((uint64_t) ((v) & 0xFF) << 32)
/* NFP Section Info
For PROGBITS and NOBITS sections:
#include "dis-asm.h"
/* The following bitmasks control instruction set architecture. */
-#define CSKYV1_ISA_E1 ((bfd_uint64_t)1 << 0)
-#define CSKYV2_ISA_E1 ((bfd_uint64_t)1 << 1)
-#define CSKYV2_ISA_1E2 ((bfd_uint64_t)1 << 2)
-#define CSKYV2_ISA_2E3 ((bfd_uint64_t)1 << 3)
-#define CSKYV2_ISA_3E7 ((bfd_uint64_t)1 << 4)
-#define CSKYV2_ISA_7E10 ((bfd_uint64_t)1 << 5)
-#define CSKYV2_ISA_3E3R1 ((bfd_uint64_t)1 << 6)
-#define CSKYV2_ISA_3E3R2 ((bfd_uint64_t)1 << 7)
-#define CSKYV2_ISA_10E60 ((bfd_uint64_t)1 << 8)
-#define CSKYV2_ISA_3E3R3 ((bfd_uint64_t)1 << 9)
-
-#define CSKY_ISA_TRUST ((bfd_uint64_t)1 << 11)
-#define CSKY_ISA_CACHE ((bfd_uint64_t)1 << 12)
-#define CSKY_ISA_NVIC ((bfd_uint64_t)1 << 13)
-#define CSKY_ISA_CP ((bfd_uint64_t)1 << 14)
-#define CSKY_ISA_MP ((bfd_uint64_t)1 << 15)
-#define CSKY_ISA_MP_1E2 ((bfd_uint64_t)1 << 16)
-#define CSKY_ISA_JAVA ((bfd_uint64_t)1 << 17)
-#define CSKY_ISA_MAC ((bfd_uint64_t)1 << 18)
-#define CSKY_ISA_MAC_DSP ((bfd_uint64_t)1 << 19)
+#define CSKYV1_ISA_E1 ((uint64_t) 1 << 0)
+#define CSKYV2_ISA_E1 ((uint64_t) 1 << 1)
+#define CSKYV2_ISA_1E2 ((uint64_t) 1 << 2)
+#define CSKYV2_ISA_2E3 ((uint64_t) 1 << 3)
+#define CSKYV2_ISA_3E7 ((uint64_t) 1 << 4)
+#define CSKYV2_ISA_7E10 ((uint64_t) 1 << 5)
+#define CSKYV2_ISA_3E3R1 ((uint64_t) 1 << 6)
+#define CSKYV2_ISA_3E3R2 ((uint64_t) 1 << 7)
+#define CSKYV2_ISA_10E60 ((uint64_t) 1 << 8)
+#define CSKYV2_ISA_3E3R3 ((uint64_t) 1 << 9)
+
+#define CSKY_ISA_TRUST ((uint64_t) 1 << 11)
+#define CSKY_ISA_CACHE ((uint64_t) 1 << 12)
+#define CSKY_ISA_NVIC ((uint64_t) 1 << 13)
+#define CSKY_ISA_CP ((uint64_t) 1 << 14)
+#define CSKY_ISA_MP ((uint64_t) 1 << 15)
+#define CSKY_ISA_MP_1E2 ((uint64_t) 1 << 16)
+#define CSKY_ISA_JAVA ((uint64_t) 1 << 17)
+#define CSKY_ISA_MAC ((uint64_t) 1 << 18)
+#define CSKY_ISA_MAC_DSP ((uint64_t) 1 << 19)
/* Base ISA for csky v1 and v2. */
-#define CSKY_ISA_DSP ((bfd_uint64_t)1 << 20)
-#define CSKY_ISA_DSP_1E2 ((bfd_uint64_t)1 << 21)
-#define CSKY_ISA_DSP_ENHANCE ((bfd_uint64_t)1 << 22)
-#define CSKY_ISA_DSPE60 ((bfd_uint64_t)1 << 23)
+#define CSKY_ISA_DSP ((uint64_t) 1 << 20)
+#define CSKY_ISA_DSP_1E2 ((uint64_t) 1 << 21)
+#define CSKY_ISA_DSP_ENHANCE ((uint64_t) 1 << 22)
+#define CSKY_ISA_DSPE60 ((uint64_t) 1 << 23)
/* Base float instruction (803f & 810f). */
-#define CSKY_ISA_FLOAT_E1 ((bfd_uint64_t)1 << 25)
+#define CSKY_ISA_FLOAT_E1 ((uint64_t) 1 << 25)
/* M_FLOAT support (810f). */
-#define CSKY_ISA_FLOAT_1E2 ((bfd_uint64_t)1 << 26)
+#define CSKY_ISA_FLOAT_1E2 ((uint64_t) 1 << 26)
/* 803 support (803f). */
-#define CSKY_ISA_FLOAT_1E3 ((bfd_uint64_t)1 << 27)
+#define CSKY_ISA_FLOAT_1E3 ((uint64_t) 1 << 27)
/* 807 support (803f & 807f). */
-#define CSKY_ISA_FLOAT_3E4 ((bfd_uint64_t)1 << 28)
+#define CSKY_ISA_FLOAT_3E4 ((uint64_t) 1 << 28)
/* 860 support. */
-#define CSKY_ISA_FLOAT_7E60 ((bfd_uint64_t)1 << 36)
+#define CSKY_ISA_FLOAT_7E60 ((uint64_t) 1 << 36)
/* Vector DSP support. */
-#define CSKY_ISA_VDSP ((bfd_uint64_t)1 << 29)
-#define CSKY_ISA_VDSP_2 ((bfd_uint64_t)1 << 30)
+#define CSKY_ISA_VDSP ((uint64_t) 1 << 29)
+#define CSKY_ISA_VDSP_2 ((uint64_t) 1 << 30)
/* The following bitmasks control cpu architecture for CSKY. */
#define CSKY_ABI_V1 (1 << 28)
extern "C" {
#endif
-typedef BFD_HOST_U_64_BIT ia64_insn;
+typedef uint64_t ia64_insn;
enum ia64_insn_type
{
disassemble_info *info;
/* Opcode information. */
struct csky_opcode_info const *opinfo;
- BFD_HOST_U_64_BIT isa;
+ uint64_t isa;
/* The value of operand to show. */
int value;
/* Whether to look up/print a symbol name. */
/* Encodings for 32-bit opcodes. */
struct csky_opcode_info op32[OP_TABLE_NUM];
/* Instruction set flag. */
- BFD_HOST_U_64_BIT isa_flag16;
- BFD_HOST_U_64_BIT isa_flag32;
+ uint64_t isa_flag16;
+ uint64_t isa_flag32;
/* Whether this insn needs relocation, 0: no, !=0: yes. */
signed int reloc16;
signed int reloc32;
const struct ia64_operand *odesc;
const struct ia64_opcode *idesc;
const char *err, *str, *tname;
- BFD_HOST_U_64_BIT value;
+ uint64_t value;
bfd_byte bundle[16];
enum ia64_unit unit;
char regname[16];