public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
* [binutils-gdb] x86: drop (explicit) BFD64 dependency from disassembler
@ 2023-04-21 10:11 Jan Beulich
  0 siblings, 0 replies; only message in thread
From: Jan Beulich @ 2023-04-21 10:11 UTC (permalink / raw)
  To: bfd-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=32c8e7265a55ab4cf14fa255115a81134c62fb16

commit 32c8e7265a55ab4cf14fa255115a81134c62fb16
Author: Jan Beulich <jbeulich@suse.com>
Date:   Fri Apr 21 12:10:23 2023 +0200

    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:
---
 opcodes/i386-dis.c | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

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))

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-04-21 10:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-21 10:11 [binutils-gdb] x86: drop (explicit) BFD64 dependency from disassembler Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).