From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1062) id 273DE3AA88B2; Fri, 27 May 2022 12:39:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 273DE3AA88B2 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Alan Modra To: bfd-cvs@sourceware.org, gdb-cvs@sourceware.org Subject: [binutils-gdb] Remove use of bfd_uint64_t and similar X-Act-Checkin: binutils-gdb X-Git-Author: Alan Modra X-Git-Refname: refs/heads/master X-Git-Oldrev: aa9b5dbc0f30855aa23034cbd78a1f2025cb9fa9 X-Git-Newrev: 0e3c1eebb22e0ade28b619fb41f42d66ed6fb145 Message-Id: <20220527123925.273DE3AA88B2@sourceware.org> Date: Fri, 27 May 2022 12:39:25 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2022 12:39:25 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D0e3c1eebb22e= 0ade28b619fb41f42d66ed6fb145 commit 0e3c1eebb22e0ade28b619fb41f42d66ed6fb145 Author: Alan Modra Date: Fri May 27 12:37:21 2022 +0930 Remove use of bfd_uint64_t and similar =20 Requiring C99 means that uses of bfd_uint64_t can be replaced with uint64_t, and similarly for bfd_int64_t, BFD_HOST_U_64_BIT, and BFD_HOST_64_BIT. This patch does that, removes #ifdef BFD_HOST_* and tidies a few places that print 64-bit values. Diff: --- bfd/aix386-core.c | 6 ++-- bfd/bfd-in.h | 24 +++++++------- bfd/bfd-in2.h | 36 ++++++++++----------- bfd/coff-rs6000.c | 10 ++---- bfd/coff-x86_64.c | 2 +- bfd/cpu-ia64-opc.c | 22 ++++++------- bfd/dwarf2.c | 83 ++++++++++++++++++++++++---------------------= ---- bfd/elf32-score.c | 16 +++++----- bfd/elf64-ia64-vms.c | 8 ++--- bfd/elflink.c | 16 ++-------- bfd/elfxx-ia64.c | 6 +--- bfd/hppabsd-core.c | 6 ++-- bfd/hpux-core.c | 6 ++-- bfd/irix-core.c | 6 ++-- bfd/libbfd.c | 65 +++++++++++--------------------------- bfd/mach-o.c | 2 +- bfd/mach-o.h | 8 ++--- bfd/netbsd-core.c | 6 ++-- bfd/osf-core.c | 6 ++-- bfd/ptrace-core.c | 6 ++-- bfd/sco5-core.c | 6 ++-- bfd/targets.c | 12 +++---- bfd/trad-core.c | 6 ++-- bfd/vms-alpha.c | 2 +- binutils/nm.c | 49 +++-------------------------- binutils/od-macho.c | 50 ++++++++++------------------- binutils/prdbg.c | 39 +++-------------------- binutils/readelf.c | 21 ++++++------- gas/config/tc-arm.c | 28 +++++------------ gas/config/tc-csky.c | 10 +++--- gas/config/tc-sparc.c | 35 ++++++++++----------- gas/config/tc-tilegx.c | 20 ++++++------ gas/config/tc-tilepro.c | 20 ++++++------ gas/config/tc-z80.c | 8 ++--- gas/config/te-vms.c | 2 +- gas/config/te-vms.h | 2 +- gdb/findcmd.c | 2 +- gdb/tilegx-tdep.c | 2 +- gprof/gmon_io.c | 44 +++++++------------------- include/elf/nfp.h | 2 +- include/opcode/csky.h | 62 ++++++++++++++++++------------------ include/opcode/ia64.h | 2 +- opcodes/csky-dis.c | 2 +- opcodes/csky-opc.h | 4 +-- opcodes/ia64-dis.c | 2 +- 45 files changed, 297 insertions(+), 475 deletions(-) diff --git a/bfd/aix386-core.c b/bfd/aix386-core.c index 3443e49ed46..977a6bd1fb4 100644 --- a/bfd/aix386-core.c +++ b/bfd/aix386-core.c @@ -220,9 +220,9 @@ swap_abort (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) =20 const bfd_target core_aix386_vec =3D { diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h index a1c4bf139fc..09c5728e944 100644 --- a/bfd/bfd-in.h +++ b/bfd/bfd-in.h @@ -116,10 +116,10 @@ typedef struct bfd bfd; #error No 64 bit integer type available #endif /* ! defined (BFD_HOST_64_BIT) */ =20 -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; =20 #if BFD_HOST_64BIT_LONG #define BFD_VMA_FMT "l" @@ -447,10 +447,10 @@ extern bool bfd_record_phdr =20 /* Byte swapping routines. */ =20 -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 *); @@ -459,8 +459,8 @@ bfd_vma bfd_getb16 (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 *); @@ -470,8 +470,8 @@ void bfd_putl16 (bfd_vma, void *); =20 /* Byte swapping routines which take size and endiannes as arguments. */ =20 -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); =20 =20 /* mmap hacks */ diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 50e26fc691d..d50885e76cf 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -123,10 +123,10 @@ typedef struct bfd bfd; #error No 64 bit integer type available #endif /* ! defined (BFD_HOST_64_BIT) */ =20 -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; =20 #if BFD_HOST_64BIT_LONG #define BFD_VMA_FMT "l" @@ -454,10 +454,10 @@ extern bool bfd_record_phdr =20 /* Byte swapping routines. */ =20 -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 *); @@ -466,8 +466,8 @@ bfd_vma bfd_getb16 (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 *); @@ -477,8 +477,8 @@ void bfd_putl16 (bfd_vma, void *); =20 /* Byte swapping routines which take size and endiannes as arguments. */ =20 -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); =20 =20 /* mmap hacks */ @@ -7416,9 +7416,9 @@ typedef struct bfd_target /* 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 *); @@ -7427,9 +7427,9 @@ typedef struct bfd_target void (*bfd_putx16) (bfd_vma, void *); =20 /* 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 *); diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index 8819187ab42..48ce5c0516b 100644 --- a/bfd/coff-rs6000.c +++ b/bfd/coff-rs6000.c @@ -1890,18 +1890,12 @@ xcoff_write_armap_old (bfd *abfd, unsigned int elen= gth ATTRIBUTE_UNUSED, } =20 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) =20 #define PRINT12(d, v) \ diff --git a/bfd/coff-x86_64.c b/bfd/coff-x86_64.c index e8e16d3ce4b..cf339c93215 100644 --- a/bfd/coff-x86_64.c +++ b/bfd/coff-x86_64.c @@ -201,7 +201,7 @@ coff_amd64_reloc (bfd *abfd, =20 case 4: { - bfd_uint64_t x =3D bfd_get_64 (abfd, addr); + uint64_t x =3D bfd_get_64 (abfd, addr); DOIT (x); bfd_put_64 (abfd, x, addr); } diff --git a/bfd/cpu-ia64-opc.c b/bfd/cpu-ia64-opc.c index e2b5c2694b6..01e3c3f476a 100644 --- a/bfd/cpu-ia64-opc.c +++ b/bfd/cpu-ia64-opc.c @@ -99,14 +99,14 @@ ins_immu (const struct ia64_operand *self, ia64_insn va= lue, ia64_insn *code) static const char* ext_immu (const struct ia64_operand *self, ia64_insn code, ia64_insn *valu= ep) { - BFD_HOST_U_64_BIT value =3D 0; + uint64_t value =3D 0; int i, bits =3D 0, total =3D 0; =20 for (i =3D 0; i < NELEMS (self->field) && self->field[i].bits; ++i) { bits =3D self->field[i].bits; value |=3D ((code >> self->field[i].shift) - & ((((BFD_HOST_U_64_BIT) 1) << bits) - 1)) << total; + & (((uint64_t) 1 << bits) - 1)) << total; total +=3D bits; } *valuep =3D value; @@ -161,7 +161,7 @@ static const char* ins_imms_scaled (const struct ia64_operand *self, ia64_insn value, ia64_insn *code, int scale) { - BFD_HOST_64_BIT svalue =3D value, sign_bit =3D 0; + int64_t svalue =3D value, sign_bit =3D 0; ia64_insn new_insn =3D 0; int i; =20 @@ -186,17 +186,17 @@ ext_imms_scaled (const struct ia64_operand *self, ia6= 4_insn code, ia64_insn *valuep, int scale) { int i, bits =3D 0, total =3D 0; - BFD_HOST_U_64_BIT val =3D 0, sign; + uint64_t val =3D 0, sign; =20 for (i =3D 0; i < NELEMS (self->field) && self->field[i].bits; ++i) { bits =3D self->field[i].bits; val |=3D ((code >> self->field[i].shift) - & ((((BFD_HOST_U_64_BIT) 1) << bits) - 1)) << total; + & (((uint64_t) 1 << bits) - 1)) << total; total +=3D bits; } /* sign extend: */ - sign =3D (BFD_HOST_U_64_BIT) 1 << (total - 1); + sign =3D (uint64_t) 1 << (total - 1); val =3D (val ^ sign) - sign; =20 *valuep =3D val << scale; @@ -312,7 +312,7 @@ static const char* ins_cnt (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) { --value; - if (value >=3D ((BFD_HOST_U_64_BIT) 1) << self->field[0].bits) + if (value >=3D (uint64_t) 1 << self->field[0].bits) return "count out of range"; =20 *code |=3D value << self->field[0].shift; @@ -323,7 +323,7 @@ static const char* ext_cnt (const struct ia64_operand *self, ia64_insn code, ia64_insn *value= p) { *valuep =3D ((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; } =20 @@ -421,8 +421,8 @@ ext_strd5b (const struct ia64_operand *self, ia64_insn = code, static const char* ins_inc3 (const struct ia64_operand *self, ia64_insn value, ia64_insn *cod= e) { - BFD_HOST_64_BIT val =3D value; - BFD_HOST_U_64_BIT sign =3D 0; + int64_t val =3D value; + uint64_t sign =3D 0; =20 if (val < 0) { @@ -444,7 +444,7 @@ ins_inc3 (const struct ia64_operand *self, ia64_insn va= lue, ia64_insn *code) static const char* ext_inc3 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valu= ep) { - BFD_HOST_64_BIT val; + int64_t val; int negate; =20 val =3D (code >> self->field[0].shift) & 0x7; diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index 45e286754e4..6a728fc38b0 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -63,8 +63,8 @@ struct attribute { char *str; struct dwarf_block *blk; - bfd_uint64_t val; - bfd_int64_t sval; + uint64_t val; + int64_t sval; } u; }; @@ -632,12 +632,12 @@ lookup_info_hash_table (struct info_hash_table *hash_= table, const char *key) the located section does not contain at least OFFSET bytes. */ =20 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 =3D sec->uncompressed_name; bfd_byte *contents =3D *section_buffer; @@ -848,7 +848,7 @@ read_indirect_string (struct comp_unit *unit, bfd_byte **ptr, bfd_byte *buf_end) { - bfd_uint64_t offset; + uint64_t offset; struct dwarf2_debug *stash =3D unit->stash; struct dwarf2_debug_file *file =3D unit->file; char *str; @@ -882,7 +882,7 @@ read_indirect_line_string (struct comp_unit *unit, bfd_byte **ptr, bfd_byte *buf_end) { - bfd_uint64_t offset; + uint64_t offset; struct dwarf2_debug *stash =3D unit->stash; struct dwarf2_debug_file *file =3D unit->file; char *str; @@ -919,7 +919,7 @@ read_alt_indirect_string (struct comp_unit *unit, bfd_byte **ptr, bfd_byte *buf_end) { - bfd_uint64_t offset; + uint64_t offset; struct dwarf2_debug *stash =3D unit->stash; char *str; =20 @@ -975,8 +975,7 @@ read_alt_indirect_string (struct comp_unit *unit, or NULL upon failure. */ =20 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 =3D unit->stash; =20 @@ -1012,7 +1011,7 @@ read_alt_indirect_ref (struct comp_unit * unit, return stash->alt.dwarf_info_buffer + offset; } =20 -static bfd_uint64_t +static uint64_t read_address (struct comp_unit *unit, bfd_byte **ptr, bfd_byte *buf_end) { bfd_byte *buf =3D *ptr; @@ -1131,7 +1130,7 @@ del_abbrev (void *p) in a hash table. */ =20 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; @@ -1356,8 +1355,7 @@ is_addrx_form (enum dwarf_form form) /* 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 =3D unit->stash; struct dwarf2_debug_file *file =3D unit->file; @@ -1383,8 +1381,7 @@ read_indexed_address (bfd_uint64_t idx, /* 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 =3D unit->stash; struct dwarf2_debug_file *file =3D unit->file; @@ -1717,39 +1714,39 @@ struct line_info_table 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; }; =20 struct lookup_funcinfo { /* Function information corresponding to this lookup table entry. */ - struct funcinfo * funcinfo; + struct funcinfo *funcinfo; =20 /* The lowest address for this specific function. */ - bfd_vma low_addr; + bfd_vma low_addr; =20 /* The highest address of this function before the lookup table is sorte= d. 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; }; @@ -1759,7 +1756,7 @@ struct varinfo /* 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. */ @@ -3335,7 +3332,7 @@ find_abstract_instance (struct comp_unit *unit, bfd_byte *info_ptr_end; unsigned int abbrev_number, i; struct abbrev_info *abbrev; - bfd_uint64_t die_ref =3D attr_ptr->u.val; + uint64_t die_ref =3D attr_ptr->u.val; struct attribute attr; const char *name =3D NULL; =20 @@ -3549,7 +3546,7 @@ find_abstract_instance (struct comp_unit *unit, =20 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; @@ -3594,7 +3591,7 @@ read_ranges (struct comp_unit *unit, struct arange *a= range, =20 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; @@ -3675,7 +3672,7 @@ read_rnglists (struct comp_unit *unit, struct arange = *arange, =20 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 <=3D 4) return read_ranges (unit, arange, trie_root, offset); @@ -3684,7 +3681,7 @@ read_rangelist (struct comp_unit *unit, struct arange= *arange, } =20 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 !=3D NULL; table =3D table->prev_func) if (table->unit_offset =3D=3D offset) @@ -3693,7 +3690,7 @@ lookup_func_by_offset (bfd_uint64_t offset, struct fu= ncinfo * table) } =20 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) { @@ -3775,7 +3772,7 @@ scan_unit_for_symbols (struct comp_unit *unit) struct abbrev_info *abbrev; struct funcinfo *func; struct varinfo *var; - bfd_uint64_t current_offset; + uint64_t current_offset; =20 /* PR 17512: file: 9f405d9d. */ if (info_ptr >=3D info_ptr_end) @@ -3909,7 +3906,7 @@ scan_unit_for_symbols (struct comp_unit *unit) bfd_vma low_pc =3D 0; bfd_vma high_pc =3D 0; bool high_pc_relative =3D false; - bfd_uint64_t current_offset; + uint64_t current_offset; =20 /* PR 17512: file: 9f405d9d. */ if (info_ptr >=3D info_ptr_end) @@ -4259,7 +4256,7 @@ parse_comp_unit (struct dwarf2_debug *stash, { struct comp_unit* unit; unsigned int version; - bfd_uint64_t abbrev_offset =3D 0; + uint64_t abbrev_offset =3D 0; /* Initialize it just to avoid a GCC false warning. */ unsigned int addr_size =3D -1; struct abbrev_info** abbrevs; diff --git a/bfd/elf32-score.c b/bfd/elf32-score.c index c868707347c..5bc78d523ea 100644 --- a/bfd/elf32-score.c +++ b/bfd/elf32-score.c @@ -230,14 +230,14 @@ static bfd_vma score3_bfd_getl48 (const void *p) { const bfd_byte *addr =3D p; - bfd_uint64_t v; - - v =3D (bfd_uint64_t) addr[4]; - v |=3D (bfd_uint64_t) addr[5] << 8; - v |=3D (bfd_uint64_t) addr[2] << 16; - v |=3D (bfd_uint64_t) addr[3] << 24; - v |=3D (bfd_uint64_t) addr[0] << 32; - v |=3D (bfd_uint64_t) addr[1] << 40; + uint64_t v; + + v =3D (uint64_t) addr[4]; + v |=3D (uint64_t) addr[5] << 8; + v |=3D (uint64_t) addr[2] << 16; + v |=3D (uint64_t) addr[3] << 24; + v |=3D (uint64_t) addr[0] << 32; + v |=3D (uint64_t) addr[1] << 40; return v; } =20 diff --git a/bfd/elf64-ia64-vms.c b/bfd/elf64-ia64-vms.c index 59cc6b6fe85..4d8f98550a3 100644 --- a/bfd/elf64-ia64-vms.c +++ b/bfd/elf64-ia64-vms.c @@ -179,7 +179,7 @@ struct elf64_ia64_vms_obj_tdata struct elf_obj_tdata root; =20 /* Ident for shared library. */ - bfd_uint64_t ident; + uint64_t ident; =20 /* Used only during link: offset in the .fixups section for this bfd. */ bfd_vma fixups_off; @@ -2791,7 +2791,7 @@ elf64_ia64_size_dynamic_sections (bfd *output_bfd ATT= RIBUTE_UNUSED, 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; =20 @@ -4720,7 +4720,7 @@ elf64_vms_close_and_cleanup (bfd *abfd) if ((isize & 7) !=3D 0) { int ishort =3D 8 - (isize & 7); - bfd_uint64_t pad =3D 0; + uint64_t pad =3D 0; =20 bfd_seek (abfd, isize, SEEK_SET); bfd_bwrite (&pad, ishort, abfd); @@ -4853,7 +4853,7 @@ elf64_vms_link_add_object_symbols (bfd *abfd, struct = bfd_link_info *info) bed->s->swap_dyn_in (abfd, extdyn, &dyn); if (dyn.d_tag =3D=3D DT_IA_64_VMS_IDENT) { - bfd_uint64_t tagv =3D dyn.d_un.d_val; + uint64_t tagv =3D dyn.d_un.d_val; elf_ia64_vms_ident (abfd) =3D tagv; break; } diff --git a/bfd/elflink.c b/bfd/elflink.c index 96eb36aa5bf..fc3a335c72d 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -6354,15 +6354,11 @@ compute_bucket_count (struct bfd_link_info *info AT= TRIBUTE_UNUSED, size_t best_size =3D 0; unsigned long int i; =20 - /* 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 =3D ~((BFD_HOST_U_64_BIT) 0); + uint64_t best_chlen =3D ~((uint64_t) 0); bfd *dynobj =3D elf_hash_table (info)->dynobj; size_t dynsymcount =3D elf_hash_table (info)->dynsymcount; const struct elf_backend_data *bed =3D get_elf_backend_data (dynobj); @@ -6399,7 +6395,7 @@ compute_bucket_count (struct bfd_link_info *info ATTR= IBUTE_UNUSED, for (i =3D 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; =20 @@ -6464,11 +6460,7 @@ compute_bucket_count (struct bfd_link_info *info ATT= RIBUTE_UNUSED, 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 =3D 0; elf_buckets[i] !=3D 0; i++) { best_size =3D elf_buckets[i]; @@ -9354,7 +9346,6 @@ ext32b_r_offset (const void *p) return aval; } =20 -#ifdef BFD_HOST_64_BIT static bfd_vma ext64l_r_offset (const void *p) { @@ -9398,7 +9389,6 @@ ext64b_r_offset (const void *p) | (uint64_t) a->c[7]); return aval; } -#endif =20 /* When performing a relocatable link, the input relocations are preserved. But, if they reference global symbols, the indices @@ -9502,13 +9492,11 @@ elf_link_adjust_relocs (bfd *abfd, } else { -#ifdef BFD_HOST_64_BIT if (abfd->xvec->header_byteorder =3D=3D BFD_ENDIAN_LITTLE) ext_r_off =3D ext64l_r_offset; else if (abfd->xvec->header_byteorder =3D=3D BFD_ENDIAN_BIG) ext_r_off =3D ext64b_r_offset; else -#endif abort (); } =20 diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index c126adf6890..a108324ca39 100644 --- a/bfd/elfxx-ia64.c +++ b/bfd/elfxx-ia64.c @@ -555,11 +555,7 @@ ia64_elf_install_value (bfd_byte *hit_addr, bfd_vma v,= unsigned int r_type) enum ia64_opnd opnd; const char *err; size_t size =3D 8; -#ifdef BFD_HOST_U_64_BIT - BFD_HOST_U_64_BIT val =3D (BFD_HOST_U_64_BIT) v; -#else - bfd_vma val =3D v; -#endif + uint64_t val =3D v; =20 opnd =3D IA64_OPND_NIL; switch (r_type) diff --git a/bfd/hppabsd-core.c b/bfd/hppabsd-core.c index acfa5f69a95..d87af955838 100644 --- a/bfd/hppabsd-core.c +++ b/bfd/hppabsd-core.c @@ -213,9 +213,9 @@ swap_abort (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) =20 const bfd_target core_hppabsd_vec =3D { diff --git a/bfd/hpux-core.c b/bfd/hpux-core.c index 4f03b84909a..654532c6bb9 100644 --- a/bfd/hpux-core.c +++ b/bfd/hpux-core.c @@ -362,9 +362,9 @@ swap_abort (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) =20 const bfd_target core_hpux_vec =3D { diff --git a/bfd/irix-core.c b/bfd/irix-core.c index 694fe2e2e07..b12aef9ce8b 100644 --- a/bfd/irix-core.c +++ b/bfd/irix-core.c @@ -275,9 +275,9 @@ swap_abort(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) =20 const bfd_target core_irix_vec =3D { diff --git a/bfd/libbfd.c b/bfd/libbfd.c index 2781671ddba..d33f3416206 100644 --- a/bfd/libbfd.c +++ b/bfd/libbfd.c @@ -617,7 +617,7 @@ DESCRIPTION #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)) =20 bfd_vma bfd_getb16 (const void *p) @@ -757,12 +757,11 @@ bfd_getl_signed_32 (const void *p) return COERCE32 (v); } =20 -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 =3D (const bfd_byte *) p; - bfd_uint64_t v; + uint64_t v; =20 v =3D addr[0]; v <<=3D 8; v |=3D addr[1]; v <<=3D 8; @@ -774,18 +773,13 @@ bfd_getb64 (const void *p ATTRIBUTE_UNUSED) v |=3D addr[7]; =20 return v; -#else - BFD_FAIL(); - return 0; -#endif } =20 -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 =3D (const bfd_byte *) p; - bfd_uint64_t v; + uint64_t v; =20 v =3D addr[7]; v <<=3D 8; v |=3D addr[6]; v <<=3D 8; @@ -797,19 +791,13 @@ bfd_getl64 (const void *p ATTRIBUTE_UNUSED) v |=3D addr[0]; =20 return v; -#else - BFD_FAIL(); - return 0; -#endif - } =20 -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 =3D (const bfd_byte *) p; - bfd_uint64_t v; + uint64_t v; =20 v =3D addr[0]; v <<=3D 8; v |=3D addr[1]; v <<=3D 8; @@ -821,18 +809,13 @@ bfd_getb_signed_64 (const void *p ATTRIBUTE_UNUSED) v |=3D addr[7]; =20 return COERCE64 (v); -#else - BFD_FAIL(); - return 0; -#endif } =20 -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 =3D (const bfd_byte *) p; - bfd_uint64_t v; + uint64_t v; =20 v =3D addr[7]; v <<=3D 8; v |=3D addr[6]; v <<=3D 8; @@ -844,10 +827,6 @@ bfd_getl_signed_64 (const void *p ATTRIBUTE_UNUSED) v |=3D addr[0]; =20 return COERCE64 (v); -#else - BFD_FAIL(); - return 0; -#endif } =20 void @@ -871,9 +850,8 @@ bfd_putl32 (bfd_vma data, void *p) } =20 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 =3D (bfd_byte *) p; addr[0] =3D (data >> (7*8)) & 0xff; addr[1] =3D (data >> (6*8)) & 0xff; @@ -883,15 +861,11 @@ bfd_putb64 (bfd_uint64_t data ATTRIBUTE_UNUSED, void = *p ATTRIBUTE_UNUSED) addr[5] =3D (data >> (2*8)) & 0xff; addr[6] =3D (data >> (1*8)) & 0xff; addr[7] =3D (data >> (0*8)) & 0xff; -#else - BFD_FAIL(); -#endif } =20 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 =3D (bfd_byte *) p; addr[7] =3D (data >> (7*8)) & 0xff; addr[6] =3D (data >> (6*8)) & 0xff; @@ -901,13 +875,10 @@ bfd_putl64 (bfd_uint64_t data ATTRIBUTE_UNUSED, void = *p ATTRIBUTE_UNUSED) addr[2] =3D (data >> (2*8)) & 0xff; addr[1] =3D (data >> (1*8)) & 0xff; addr[0] =3D (data >> (0*8)) & 0xff; -#else - BFD_FAIL(); -#endif } =20 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 =3D (bfd_byte *) p; int i; @@ -926,11 +897,11 @@ bfd_put_bits (bfd_uint64_t data, void *p, int bits, b= ool big_p) } } =20 -bfd_uint64_t +uint64_t bfd_get_bits (const void *p, int bits, bool big_p) { const bfd_byte *addr =3D (const bfd_byte *) p; - bfd_uint64_t data; + uint64_t data; int i; int bytes; =20 diff --git a/bfd/mach-o.c b/bfd/mach-o.c index e32b7873cef..9f3f1f13e4e 100644 --- a/bfd/mach-o.c +++ b/bfd/mach-o.c @@ -4773,7 +4773,7 @@ bfd_mach_o_read_source_version (bfd *abfd, bfd_mach_o= _load_command *command) { bfd_mach_o_source_version_command *cmd =3D &command->command.source_vers= ion; struct mach_o_source_version_command_external raw; - bfd_uint64_t ver; + uint64_t ver; =20 if (command->len < sizeof (raw) + 8) return false; diff --git a/bfd/mach-o.h b/bfd/mach-o.h index 5a068d8d970..f7418ad8d40 100644 --- a/bfd/mach-o.h +++ b/bfd/mach-o.h @@ -545,8 +545,8 @@ bfd_mach_o_encryption_info_command; =20 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; =20 @@ -563,8 +563,8 @@ bfd_mach_o_source_version_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; =20 diff --git a/bfd/netbsd-core.c b/bfd/netbsd-core.c index cb215937da6..ffc8e50842c 100644 --- a/bfd/netbsd-core.c +++ b/bfd/netbsd-core.c @@ -257,9 +257,9 @@ swap_abort (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) =20 const bfd_target core_netbsd_vec =3D { diff --git a/bfd/osf-core.c b/bfd/osf-core.c index 09a04a07624..04434b2045c 100644 --- a/bfd/osf-core.c +++ b/bfd/osf-core.c @@ -169,9 +169,9 @@ swap_abort (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) =20 const bfd_target core_osf_vec =3D { diff --git a/bfd/ptrace-core.c b/bfd/ptrace-core.c index 3d077d21200..c4afffbfb95 100644 --- a/bfd/ptrace-core.c +++ b/bfd/ptrace-core.c @@ -160,9 +160,9 @@ swap_abort (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) =20 const bfd_target core_ptrace_vec =3D { diff --git a/bfd/sco5-core.c b/bfd/sco5-core.c index d1f80c9079f..7807ac86a65 100644 --- a/bfd/sco5-core.c +++ b/bfd/sco5-core.c @@ -340,9 +340,9 @@ swap_abort (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) =20 const bfd_target core_sco5_vec =3D { diff --git a/bfd/targets.c b/bfd/targets.c index 05dd8236d91..f44b5c67724 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -226,9 +226,9 @@ DESCRIPTION . {* Entries for byte swapping for data. These are different from the . other entry points, since they don't take a BFD as the first argumen= t. . 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 *); @@ -237,9 +237,9 @@ DESCRIPTION . 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 *); diff --git a/bfd/trad-core.c b/bfd/trad-core.c index 92a279b6a72..8e9ee0d6667 100644 --- a/bfd/trad-core.c +++ b/bfd/trad-core.c @@ -249,9 +249,9 @@ swap_abort (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) =20 const bfd_target core_trad_vec =3D { diff --git a/bfd/vms-alpha.c b/bfd/vms-alpha.c index 1129c98f0e2..fd0762811df 100644 --- a/bfd/vms-alpha.c +++ b/bfd/vms-alpha.c @@ -522,7 +522,7 @@ _bfd_vms_slurp_eisd (bfd *abfd, unsigned int offset) 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 =3D NULL; diff --git a/binutils/nm.c b/binutils/nm.c index 60e4d850885..539c5688425 100644 --- a/binutils/nm.c +++ b/binutils/nm.c @@ -1557,29 +1557,15 @@ get_print_format (void) padding =3D "016"; } =20 - const char * length =3D "l"; - if (print_width =3D=3D 64) - { -#if BFD_HOST_64BIT_LONG - ; -#elif BFD_HOST_64BIT_LONG_LONG -#ifndef __MSVCRT__ - length =3D "ll"; -#else - length =3D "I64"; -#endif -#endif - } - const char * radix =3D NULL; switch (print_radix) { - case 8: radix =3D "o"; break; - case 10: radix =3D "d"; break; - case 16: radix =3D "x"; break; + case 8: radix =3D PRIo64; break; + case 10: radix =3D PRId64; break; + case 16: radix =3D PRIx64; break; } =20 - return concat ("%", padding, length, radix, NULL); + return concat ("%", padding, radix, NULL); } =20 static void @@ -1874,33 +1860,8 @@ print_value (bfd *abfd ATTRIBUTE_UNUSED, bfd_vma val) 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 =3D=3D 16) - bfd_fprintf_vma (abfd, stdout, val); - else - { - char buf[30]; - char *s; - - s =3D buf + sizeof buf; - *--s =3D '\0'; - while (val > 0) - { - *--s =3D (val % print_radix) + '0'; - val /=3D print_radix; - } - while ((buf + sizeof buf - 1) - s < 16) - *--s =3D '0'; - printf ("%s", s); - } -#endif + printf (print_format_string, (uint64_t) val); break; =20 default: diff --git a/binutils/od-macho.c b/binutils/od-macho.c index 56d448ac3bd..e91c87d2acf 100644 --- a/binutils/od-macho.c +++ b/binutils/od-macho.c @@ -283,15 +283,6 @@ bfd_mach_o_print_flags (const bfd_mach_o_xlat_name *ta= ble, printf ("-"); } =20 -/* 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) @@ -1729,26 +1720,20 @@ dump_load_command (bfd *abfd, bfd_mach_o_load_comma= nd *cmd, } case BFD_MACH_O_LC_MAIN: { - bfd_mach_o_main_command *entry =3D &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 =3D &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 =3D &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 =3D &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); @@ -2013,14 +1998,11 @@ dump_obj_compact_unwind (bfd *abfd, { e =3D (struct mach_o_compact_unwind_64 *) p; =20 - 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)); =20 printf (" encoding: "); dump_unwind_encoding (mdata, bfd_get_32 (abfd, e->encoding)); diff --git a/binutils/prdbg.c b/binutils/prdbg.c index d6cbab8578b..c1e41628d26 100644 --- a/binutils/prdbg.c +++ b/binutils/prdbg.c @@ -485,41 +485,12 @@ pop_type (struct pr_handle *info) static void print_vma (bfd_vma vma, char *buf, bool unsignedp, bool hexp) { - if (sizeof (vma) <=3D 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) <=3D 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] =3D '0'; - buf[1] =3D 'x'; - sprintf_vma (buf + 2, vma); - } + sprintf (buf, "%" PRId64, (int64_t) vma); } =0C /* Start a new compilation unit. */ diff --git a/binutils/readelf.c b/binutils/readelf.c index c35bfc12366..4c0a2a34767 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -10729,7 +10729,7 @@ dynamic_section_parisc_val (Elf_Internal_Dyn * entr= y) /* Display a VMS time in a human readable format. */ =20 static void -print_vms_time (bfd_int64_t vmstime) +print_vms_time (int64_t vmstime) { struct tm *tm =3D NULL; time_t unxtime; @@ -20764,7 +20764,7 @@ print_ia64_vms_note (Elf_Internal_Note * pnote) /* FIXME: Generate an error if descsz > 8 ? */ =20 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; =20 case NT_VMS_LINKTIME: @@ -20773,8 +20773,7 @@ print_ia64_vms_note (Elf_Internal_Note * pnote) goto desc_size_fail; /* FIXME: Generate an error if descsz > 8 ? */ =20 - 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; =20 @@ -20784,8 +20783,7 @@ print_ia64_vms_note (Elf_Internal_Note * pnote) goto desc_size_fail; /* FIXME: Generate an error if descsz > 8 ? */ =20 - 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; =20 @@ -20794,16 +20792,15 @@ print_ia64_vms_note (Elf_Internal_Note * pnote) goto desc_size_fail; =20 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 diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 1721097cfca..2e6d175482e 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -3565,7 +3565,7 @@ add_to_lit_pool (unsigned int nbytes) imm1 =3D inst.operands[1].imm; imm2 =3D (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 =3D imm2; @@ -8819,15 +8819,14 @@ neon_cmode_for_move_imm (unsigned immlo, unsigned i= mmhi, int float_p, return FAIL; } =20 -#if defined BFD_HOST_64_BIT /* Returns TRUE if double precision value V may be cast to single precision without loss of accuracy. */ =20 static bool -is_double_a_single (bfd_uint64_t v) +is_double_a_single (uint64_t v) { int exp =3D (v >> 52) & 0x7FF; - bfd_uint64_t mantissa =3D v & 0xFFFFFFFFFFFFFULL; + uint64_t mantissa =3D v & 0xFFFFFFFFFFFFFULL; =20 return ((exp =3D=3D 0 || exp =3D=3D 0x7FF || (exp >=3D 1023 - 126 && exp <=3D 1023 + 127)) @@ -8838,11 +8837,11 @@ is_double_a_single (bfd_uint64_t v) (ignoring the least significant bits in exponent and mantissa). */ =20 static int -double_to_single (bfd_uint64_t v) +double_to_single (uint64_t v) { unsigned int sign =3D (v >> 63) & 1; int exp =3D (v >> 52) & 0x7FF; - bfd_uint64_t mantissa =3D v & 0xFFFFFFFFFFFFFULL; + uint64_t mantissa =3D v & 0xFFFFFFFFFFFFFULL; =20 if (exp =3D=3D 0x7FF) exp =3D 0xFF; @@ -8865,7 +8864,6 @@ double_to_single (bfd_uint64_t v) mantissa >>=3D 29; return (sign << 31) | (exp << 23) | mantissa; } -#endif /* BFD_HOST_64_BIT */ =20 enum lit_type { @@ -8914,11 +8912,7 @@ move_or_literal_pool (int i, enum lit_type t, bool m= ode_3) if (inst.relocs[0].exp.X_op =3D=3D O_constant || inst.relocs[0].exp.X_op =3D=3D 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 =3D=3D O_big) { LITTLENUM_TYPE w[X_PRECISION]; @@ -8933,7 +8927,6 @@ move_or_literal_pool (int i, enum lit_type t, bool mo= de_3) else l =3D generic_bignum; =20 -#if defined BFD_HOST_64_BIT v =3D l[3] & LITTLENUM_MASK; v <<=3D LITTLENUM_NUMBER_OF_BITS; v |=3D l[2] & LITTLENUM_MASK; @@ -8941,11 +8934,6 @@ move_or_literal_pool (int i, enum lit_type t, bool m= ode_3) v |=3D l[1] & LITTLENUM_MASK; v <<=3D LITTLENUM_NUMBER_OF_BITS; v |=3D l[0] & LITTLENUM_MASK; -#else - v =3D l[1] & LITTLENUM_MASK; - v <<=3D LITTLENUM_NUMBER_OF_BITS; - v |=3D l[0] & LITTLENUM_MASK; -#endif } else v =3D inst.relocs[0].exp.X_add_number; @@ -9041,7 +9029,7 @@ move_or_literal_pool (int i, enum lit_type t, bool mo= de_3) ? inst.operands[1].reg : inst.relocs[0].exp.X_unsigned ? 0 - : ((bfd_int64_t)((int) immlo)) >> 32; + : (int64_t) (int) immlo >> 32; int cmode =3D neon_cmode_for_move_imm (immlo, immhi, false, &immbit= s, &op, 64, NT_invtype); =20 @@ -9090,7 +9078,6 @@ move_or_literal_pool (int i, enum lit_type t, bool mo= de_3) 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)) { @@ -9103,7 +9090,6 @@ move_or_literal_pool (int i, enum lit_type t, bool mo= de_3) return true; } } -#endif } } =20 diff --git a/gas/config/tc-csky.c b/gas/config/tc-csky.c index 2371eeb747e..5b824d89af0 100644 --- a/gas/config/tc-csky.c +++ b/gas/config/tc-csky.c @@ -215,7 +215,7 @@ enum unsigned int mach_flag =3D 0; unsigned int arch_flag =3D 0; unsigned int other_flag =3D 0; -BFD_HOST_U_64_BIT isa_flag =3D 0; +uint64_t isa_flag =3D 0; unsigned int dsp_flag =3D 0; =20 typedef struct stack_size_entry @@ -245,7 +245,7 @@ struct csky_macro_info const char *name; /* How many operands : if operands =3D=3D 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); }; @@ -591,14 +591,14 @@ struct csky_cpu_feature { const char unique; unsigned int arch_flag; - bfd_uint64_t isa_flag; + uint64_t isa_flag; }; =20 struct csky_cpu_version { int r; int p; - bfd_uint64_t isa_flag; + uint64_t isa_flag; }; =20 #define CSKY_FEATURE_MAX 10 @@ -608,7 +608,7 @@ struct csky_cpu_info { 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]; }; diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c index 222223f3549..4e443b1d28d 100644 --- a/gas/config/tc-sparc.c +++ b/gas/config/tc-sparc.c @@ -75,10 +75,10 @@ static enum { MM_TSO, MM_PSO, MM_RMO } sparc_memory_mod= el =3D MM_RMO; #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 =20 -static bfd_uint64_t hwcap_allowed; +static uint64_t hwcap_allowed; =20 static int architecture_requested; static int warn_on_bump; @@ -498,15 +498,15 @@ md_parse_option (int c, const char *arg) || opcode_arch > max_architecture) max_architecture =3D opcode_arch; =20 - /* The allowed hardware capabilities are the implied by the - opcodes arch plus any extra capabilities defined in the GAS - arch. */ - hwcap_allowed - =3D (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 + =3D (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 =3D 1; } break; @@ -1607,7 +1607,7 @@ md_assemble (char *str) } =20 static const char * -get_hwcap_name (bfd_uint64_t mask) +get_hwcap_name (uint64_t mask) { if (mask & HWCAP_MUL32) return "mul32"; @@ -3171,8 +3171,7 @@ sparc_ip (char *str, const struct sparc_opcode **pins= n) msg_str =3D sasi->name; } =20 - bfd_uint64_t hwcaps - =3D (((bfd_uint64_t) insn->hwcaps2) << 32) | insn->hwcaps; + uint64_t hwcaps =3D ((uint64_t) insn->hwcaps2 << 32) | insn->hwcaps; =20 #ifndef TE_SOLARIS if (hwcaps) @@ -3211,10 +3210,10 @@ sparc_ip (char *str, const struct sparc_opcode **pi= nsn) } current_architecture =3D needed_architecture; hwcap_allowed - =3D (hwcap_allowed - | hwcaps - | (((bfd_uint64_t) sparc_opcode_archs[current_architect= ure].hwcaps2) << 32) - | sparc_opcode_archs[current_architecture].hwcaps); + =3D (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 diff --git a/gas/config/tc-tilegx.c b/gas/config/tc-tilegx.c index b627b7080e5..4fcc38c9034 100644 --- a/gas/config/tc-tilegx.c +++ b/gas/config/tc-tilegx.c @@ -789,16 +789,16 @@ emit_tilegx_instruction (tilegx_bundle_bits bits, static void check_illegal_reg_writes (void) { - BFD_HOST_U_64_BIT all_regs_written =3D 0; + uint64_t all_regs_written =3D 0; int j; =20 for (j =3D 0; j < current_bundle_index; j++) { const struct tilegx_instruction *instr =3D ¤t_bundle[j]; int k; - BFD_HOST_U_64_BIT regs =3D - ((BFD_HOST_U_64_BIT)1) << instr->opcode->implicitly_written_register; - BFD_HOST_U_64_BIT conflict; + uint64_t regs =3D + (uint64_t) 1 << instr->opcode->implicitly_written_register; + uint64_t conflict; =20 for (k =3D 0; k < instr->opcode->num_operands; k++) { @@ -808,12 +808,12 @@ check_illegal_reg_writes (void) if (operand->is_dest_reg) { int regno =3D instr->operand_values[k].X_add_number; - BFD_HOST_U_64_BIT mask =3D ((BFD_HOST_U_64_BIT)1) << regno; + uint64_t mask =3D (uint64_t) 1 << regno; =20 - 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))) !=3D 0 + if ((mask & ( ((uint64_t) 1 << TREG_IDN1) + | ((uint64_t) 1 << TREG_UDN1) + | ((uint64_t) 1 << TREG_UDN2) + | ((uint64_t) 1 << TREG_UDN3))) !=3D 0 && !allow_suspicious_bundles) { as_bad (_("Writes to register '%s' are not allowed."), @@ -825,7 +825,7 @@ check_illegal_reg_writes (void) } =20 /* Writing to the zero register doesn't count. */ - regs &=3D ~(((BFD_HOST_U_64_BIT)1) << TREG_ZERO); + regs &=3D ~((uint64_t) 1 << TREG_ZERO); =20 conflict =3D all_regs_written & regs; if (conflict !=3D 0 && !allow_suspicious_bundles) diff --git a/gas/config/tc-tilepro.c b/gas/config/tc-tilepro.c index af0be422f98..ca092d77a4b 100644 --- a/gas/config/tc-tilepro.c +++ b/gas/config/tc-tilepro.c @@ -677,16 +677,16 @@ emit_tilepro_instruction (tilepro_bundle_bits bits, static void check_illegal_reg_writes (void) { - BFD_HOST_U_64_BIT all_regs_written =3D 0; + uint64_t all_regs_written =3D 0; int j; =20 for (j =3D 0; j < current_bundle_index; j++) { const struct tilepro_instruction *instr =3D ¤t_bundle[j]; int k; - BFD_HOST_U_64_BIT regs =3D - ((BFD_HOST_U_64_BIT)1) << instr->opcode->implicitly_written_register; - BFD_HOST_U_64_BIT conflict; + uint64_t regs =3D + (uint64_t) 1 << instr->opcode->implicitly_written_register; + uint64_t conflict; =20 for (k =3D 0; k < instr->opcode->num_operands; k++) { @@ -696,12 +696,12 @@ check_illegal_reg_writes (void) if (operand->is_dest_reg) { int regno =3D instr->operand_values[k].X_add_number; - BFD_HOST_U_64_BIT mask =3D ((BFD_HOST_U_64_BIT)1) << regno; + uint64_t mask =3D (uint64_t) 1 << regno; =20 - 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))) !=3D 0 + if ((mask & ( ((uint64_t) 1 << TREG_IDN1) + | ((uint64_t) 1 << TREG_UDN1) + | ((uint64_t) 1 << TREG_UDN2) + | ((uint64_t) 1 << TREG_UDN3))) !=3D 0 && !allow_suspicious_bundles) { as_bad (_("Writes to register '%s' are not allowed."), @@ -713,7 +713,7 @@ check_illegal_reg_writes (void) } =20 /* Writing to the zero register doesn't count. */ - regs &=3D ~(((BFD_HOST_U_64_BIT)1) << TREG_ZERO); + regs &=3D ~((uint64_t) 1 << TREG_ZERO); =20 conflict =3D all_regs_written & regs; if (conflict !=3D 0 && !allow_suspicious_bundles) diff --git a/gas/config/tc-z80.c b/gas/config/tc-z80.c index 81fbfe3b0ae..714e704e24a 100644 --- a/gas/config/tc-z80.c +++ b/gas/config/tc-z80.c @@ -3910,11 +3910,11 @@ z80_tc_label_is_local (const char *name) #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 =3D 0; + uint64_t mantissa =3D 0; int exponent =3D 0; int i; =20 @@ -4029,7 +4029,7 @@ str_to_broken_float (bool *signP, bfd_uint64_t *manti= ssaP, int *expP) static const char * str_to_zeda32(char *litP, int *sizeP) { - bfd_uint64_t mantissa; + uint64_t mantissa; bool sign; int exponent; unsigned i; @@ -4088,7 +4088,7 @@ str_to_zeda32(char *litP, int *sizeP) static const char * str_to_float48(char *litP, int *sizeP) { - bfd_uint64_t mantissa; + uint64_t mantissa; bool sign; int exponent; unsigned i; diff --git a/gas/config/te-vms.c b/gas/config/te-vms.c index 015c95867f0..6661a3b6a72 100644 --- a/gas/config/te-vms.c +++ b/gas/config/te-vms.c @@ -339,7 +339,7 @@ vms_file_stats_name (const char *dirname, return 0; } =20 -bfd_uint64_t +uint64_t vms_dwarf2_file_time_name (const char *filename, const char *dirname) { long long cdt; diff --git a/gas/config/te-vms.h b/gas/config/te-vms.h index ffe7f5e8f37..08f218502de 100644 --- a/gas/config/te-vms.h +++ b/gas/config/te-vms.h @@ -20,7 +20,7 @@ #define TE_VMS #include "obj-format.h" =20 -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 *); =20 diff --git a/gdb/findcmd.c b/gdb/findcmd.c index ff13f22e970..ed2cea7b74d 100644 --- a/gdb/findcmd.c +++ b/gdb/findcmd.c @@ -30,7 +30,7 @@ /* Copied from bfd_put_bits. */ =20 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; diff --git a/gdb/tilegx-tdep.c b/gdb/tilegx-tdep.c index 7930db72779..9668aa80b53 100644 --- a/gdb/tilegx-tdep.c +++ b/gdb/tilegx-tdep.c @@ -375,7 +375,7 @@ tilegx_analyze_prologue (struct gdbarch* gdbarch, 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; diff --git a/gprof/gmon_io.c b/gprof/gmon_io.c index c613809d396..2b4dd26375b 100644 --- a/gprof/gmon_io.c +++ b/gprof/gmon_io.c @@ -48,10 +48,8 @@ enum gmon_ptr_signedness { static enum gmon_ptr_size gmon_get_ptr_size (void); static enum gmon_ptr_signedness gmon_get_ptr_signedness (void); =20 -#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 @@ -109,9 +107,8 @@ gmon_io_read_32 (FILE *ifp, unsigned int *valp) return 0; } =20 -#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]; =20 @@ -120,15 +117,12 @@ gmon_io_read_64 (FILE *ifp, BFD_HOST_U_64_BIT *valp) *valp =3D bfd_get_64 (core_bfd, buf); return 0; } -#endif =20 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; =20 switch (gmon_get_ptr_size ()) { @@ -136,23 +130,19 @@ gmon_io_read_vma (FILE *ifp, bfd_vma *valp) if (gmon_io_read_32 (ifp, &val32)) return 1; if (gmon_get_ptr_signedness () =3D=3D ptr_signed) - *valp =3D (int) val32; + *valp =3D (int) val32; else - *valp =3D val32; + *valp =3D val32; break; =20 -#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 () =3D=3D ptr_signed) - *valp =3D (BFD_HOST_64_BIT) val64; + *valp =3D (int64_t) val64; else -#endif - *valp =3D val64; + *valp =3D val64; break; -#endif } return 0; } @@ -176,9 +166,8 @@ gmon_io_write_32 (FILE *ofp, unsigned int val) return 0; } =20 -#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]; =20 @@ -187,7 +176,6 @@ gmon_io_write_64 (FILE *ofp, BFD_HOST_U_64_BIT val) return 1; return 0; } -#endif =20 int gmon_io_write_vma (FILE *ofp, bfd_vma val) @@ -200,12 +188,10 @@ gmon_io_write_vma (FILE *ofp, bfd_vma val) return 1; break; =20 -#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; } @@ -232,9 +218,7 @@ gmon_io_write (FILE *ofp, char *buf, size_t n) static int gmon_read_raw_arc (FILE *ifp, bfd_vma *fpc, bfd_vma *spc, unsigned long *c= nt) { -#ifdef BFD_HOST_U_64_BIT - BFD_HOST_U_64_BIT cnt64; -#endif + uint64_t cnt64; unsigned int cnt32; =20 if (gmon_io_read_vma (ifp, fpc) @@ -249,13 +233,11 @@ gmon_read_raw_arc (FILE *ifp, bfd_vma *fpc, bfd_vma *= spc, unsigned long *cnt) *cnt =3D cnt32; break; =20 -#ifdef BFD_HOST_U_64_BIT case ptr_64bit: if (gmon_io_read_64 (ifp, &cnt64)) return 1; *cnt =3D cnt64; break; -#endif =20 default: return 1; @@ -278,12 +260,10 @@ gmon_write_raw_arc (FILE *ofp, bfd_vma fpc, bfd_vma s= pc, unsigned long cnt) return 1; break; =20 -#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; } diff --git a/include/elf/nfp.h b/include/elf/nfp.h index 5a06051196c..c89cefff27b 100644 --- a/include/elf/nfp.h +++ b/include/elf/nfp.h @@ -102,7 +102,7 @@ extern "C" #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) =20 /* NFP Section Info For PROGBITS and NOBITS sections: diff --git a/include/opcode/csky.h b/include/opcode/csky.h index ed00bfd7cd6..faecba11611 100644 --- a/include/opcode/csky.h +++ b/include/opcode/csky.h @@ -22,46 +22,46 @@ #include "dis-asm.h" =20 /* 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) =20 /* 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) =20 /* 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) =20 /* The following bitmasks control cpu architecture for CSKY. */ #define CSKY_ABI_V1 (1 << 28) diff --git a/include/opcode/ia64.h b/include/opcode/ia64.h index fbdd8f14e65..42a6812c3f8 100644 --- a/include/opcode/ia64.h +++ b/include/opcode/ia64.h @@ -29,7 +29,7 @@ extern "C" { #endif =20 -typedef BFD_HOST_U_64_BIT ia64_insn; +typedef uint64_t ia64_insn; =20 enum ia64_insn_type { diff --git a/opcodes/csky-dis.c b/opcodes/csky-dis.c index b7c833623e5..99103ff57b5 100644 --- a/opcodes/csky-dis.c +++ b/opcodes/csky-dis.c @@ -49,7 +49,7 @@ struct csky_dis_info 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. */ diff --git a/opcodes/csky-opc.h b/opcodes/csky-opc.h index b65efe19d9f..d2db90ede95 100644 --- a/opcodes/csky-opc.h +++ b/opcodes/csky-opc.h @@ -271,8 +271,8 @@ struct csky_opcode /* 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, !=3D0: yes. */ signed int reloc16; signed int reloc32; diff --git a/opcodes/ia64-dis.c b/opcodes/ia64-dis.c index 5eb37277a5d..e76f40393c6 100644 --- a/opcodes/ia64-dis.c +++ b/opcodes/ia64-dis.c @@ -73,7 +73,7 @@ print_insn_ia64 (bfd_vma memaddr, struct disassemble_info= *info) 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];