From: Jan Beulich Date: Fri, 21 Apr 2023 10:10:23 +0000 (+0200) Subject: x86: drop (explicit) BFD64 dependency from disassembler X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=32c8e7265a55ab4cf14fa255115a81134c62fb16;p=binutils-gdb.git x86: drop (explicit) BFD64 dependency from disassembler get64() is unreachable when !BFD64 (due to a check relatively early in print_insn()). Let's avoid the associated #ifdef-ary (or else we should extend it to remove more dead code). --- diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index d6bff51e6e6..46ba01fe093 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -12361,9 +12361,8 @@ OP_G (instr_info *ins, int bytemode, int sizeflag) return true; } -#ifdef BFD64 static bool -get64 (instr_info *ins, bfd_vma *res) +get64 (instr_info *ins, uint64_t *res) { unsigned int a; unsigned int b; @@ -12378,17 +12377,9 @@ get64 (instr_info *ins, bfd_vma *res) b |= (*ins->codep++ & 0xff) << 8; b |= (*ins->codep++ & 0xff) << 16; b |= (*ins->codep++ & 0xffu) << 24; - *res = a + ((bfd_vma) b << 32); + *res = a + ((uint64_t) b << 32); return true; } -#else -static bool -get64 (instr_info *ins ATTRIBUTE_UNUSED, bfd_vma *res ATTRIBUTE_UNUSED) -{ - abort (); - return false; -} -#endif static bool get32 (instr_info *ins, bfd_signed_vma *res) @@ -12603,7 +12594,7 @@ OP_I (instr_info *ins, int bytemode, int sizeflag) static bool OP_I64 (instr_info *ins, int bytemode, int sizeflag) { - bfd_vma op; + uint64_t op; if (bytemode != v_mode || ins->address_mode != mode_64bit || !(ins->rex & REX_W)) @@ -12817,7 +12808,7 @@ OP_OFF (instr_info *ins, int bytemode, int sizeflag) static bool OP_OFF64 (instr_info *ins, int bytemode, int sizeflag) { - bfd_vma off; + uint64_t off; if (ins->address_mode != mode_64bit || (ins->prefixes & PREFIX_ADDR))