This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: patches enable thumb disassembler to correctly dump thumb
- To: tdel at windriver dot com
- Subject: Re: patches enable thumb disassembler to correctly dump thumb
- From: Nick Clifton <nickc at cygnus dot com>
- Date: Thu, 27 Jan 2000 11:56:48 -0800
- CC: binutils at sourceware dot cygnus dot com
Hi Thomas,
: The inability of the arm/thumb disassembler to detect labels that
: were generated in ".code 16" (.thumb) mode -IF- labels were not
: specifically tagged using ".thumb_func" caused objdump to produce
: an incorrect disassembly dump listing. (Objdump would incorrectly
: use ARM mode for THUMB instructions - see testcase at end).
Thanks for submitting this patch. There is only one problem with it -
the changes to bfd/elf32-arm.h to treat an ARM_STT_16BIT symbol as if
it were an ARM_STT_TFUNC symbol. Since the code in this cases is
dealing with relocations for function calls, the ARM_STT_16BIT symbols
should be ignored, not treated as functions.
With this in mind, I have edited your patch slightly and checked it
in.
Cheers
Nick
: ======================================================================
: 2000-01-18 Thomas de Lellis <tdel@windriver.com>
:
: * config/tc-arm.c (armadjust_symtab): If the assembler
: is in '.code 16' (.thumb) mode but the label seen
: in was not declared '.thumb_func' set the ST_INFO type
: to the STT_ARM_16BIT mode. We detect this flag
: in the disassembler to allow objdump to correctly
: disassemble thumb instructions under labels that
: aren't '.thumb_func' labels.
:
: ======================================================================
: 2000-01-24 Thomas de Lellis <tdel@wrs.com>
:
: * elf32-arm.h (bfd_elf32_arm_process_before_allocation)
: Add STT_ARM_16BIT where ever STT_ARM_TFUNC used.
:
: * elf32-arm.h (elf32_arm_final_link_relocate)
: Add STT_ARM_16BIT where ever STT_ARM_TFUNC used.
:
: * elf32-arm.h (elf32_arm_find_nearest_line)
: Add STT_ARM_16BIT where ever STT_ARM_TFUNC used.
:
: * elf32-arm.h (elf32_arm_get_symbol_type)
: If STT_ARM_16BIT mode and not object type
: we return the STT_ARM_16ARM flag. This is
: because not everthing in a .code 16 block is
: an executed instruction.
:
: ======================================================================
: 2000-01-24 Thomas de Lellis <tdel@windriver.com>
:
: * arm-dis.c (printf_insn_big_arm): Detect STT_ARM_16BIT
: flag. Instructs disassembler to correctly disassemble
: thumb instructions which don't reside under labels
: that have specifically been tagged '.thumb_func' in
: gas.
:
: * arm-dis.c (printf_insn_little_arm): Ditto.
:
: ======================================================================
: 2000-01-24 Thomas de Lellis <tdel@windriver.com>
:
: * arm.h: Define STT_ARM_16BIT flag. Denotes
: label was defined in '.code 16' (.thumb) block
: but was not declared '.thumb_func'. Used mainly
: by opcodes/arm-dis.c to instruct disassembler to
: correctly disassemble thumb instructions under
: non-.thumb_func labels. Note: STT_HIPROC was
: redefined for this. (Maybe reuse STT_LOOS instead?)
:
: ======================================================================