[PATCH v2 0/2] arm, objdump: Make objdump use bfd's machine detection to drive disassembly

Andre Vieira andre.simoesdiasvieira@arm.com
Thu Oct 31 17:02:47 GMT 2024


This patch series makes objdump use build attributes or notes if present to
determine the architecture to disassembly for. This is a deviation from the
existing behaviour where it would attempt to disassemble for all known
A-profile instructions, which would lead to inaccuracies with earlier
architectures and even wrong assembly when disassembling an Armv8.1-M Mainline
object file/binary.

The first patch does the bulk of the work and the second cleans up the 26-bit
instruction disassembly to warn developers of obsolote behaviour.

Tested series on gas for arm-none-eabi, arm-wince and arm-vxworks

Differences in v2 from v1:
* Changed behaviour of the BX instruction disassembly for Armv4 in light of the
  v4bx, because the approach in v1 of using the relocation to assume an
  instruction is likely to be a BX would not work for linked binaries and
  showed a failure in the linker testsuite due to a bx being diassembled as a
  MSR.
* Changes to affected testcases by the v4bx change workaround.



Andre Vieira (2)
  arm, objdump: Make objdump use bfd's machine detection to drive disassembly
  arm, objdump: print obsolote warning for 26-bit set in instructions

Andre Vieira (2):
  arm, objdump: Make objdump use bfd's machine detection to drive
    disassembly
  arm, objdump: print obsolote warning when 26-bit set in instructions

 gas/testsuite/gas/arm/armv1.d         |  8 +--
 gas/testsuite/gas/arm/inst.d          | 32 ++++++------
 gas/testsuite/gas/arm/nops.d          |  1 +
 gas/testsuite/gas/arm/pinsn.d         | 24 ---------
 gas/testsuite/gas/arm/pinsn.s         | 16 ------
 gas/testsuite/gas/arm/unpredictable.d |  1 +
 gas/testsuite/gas/arm/v4bx.d          |  2 +-
 gas/testsuite/gas/arm/wince_inst.d    | 32 ++++++------
 include/opcode/arm.h                  |  4 +-
 ld/testsuite/ld-arm/armv4-bx.d        |  4 +-
 opcodes/arm-dis.c                     | 70 ++++++++++++++-------------
 11 files changed, 80 insertions(+), 114 deletions(-)
 delete mode 100644 gas/testsuite/gas/arm/pinsn.d
 delete mode 100644 gas/testsuite/gas/arm/pinsn.s

-- 
2.25.1



More information about the Binutils mailing list