[PATCH] objdump relocation fixes for ARM disassembly

Nick Clifton nickc@redhat.com
Tue Mar 1 15:17:00 GMT 2005


Hi Stig,

> 2005-02-22  Stig Petter Olsroed  <stigpo@users.sourceforge.net>
> 
>     * objdump.c (disassemble_bytes): Fixed relocation check for
>     DISASSEMBLER_NEEDS_RELOCS platforms to properly trigger the
>     INSN_HAS_RELOC flag.  Set the current relocation entry in
>     objdump_disasm_info to allow printing the proper symbol.
>     (objdump_print_addr): Use the relocation entry in
>     objdump_disasm_info to lookup the correct symbol for
>     DISASSEMBLER_NEEDS_RELOCS platforms.

Well this is a good idea - but it does have a couple of problems:

   1.  The new 'relocs' field of the aux structure is not initialised in 
disassemble_data().

   2.  The revised test inside DISASSEMBLER_NEEDS_INFO will not work 
with relocs whose address is part way through an instruction.  eg on 
VLIW architectures.

   3.  The patch does not adjust the GAS testsuite files to take account 
of the new behaviour of the disassembler.

So I have amended your patch (as attached) and checked it in with the 
following ChangeLog entries.

Cheers
   Nick

binutils/ChangeLog
2005-03-01  Stig Petter Olsroed  <stigpo@users.sourceforge.net>
	    Nick Clifton  <nickc@redhat.com>

	* objdump.c: Fix coding for DISASSEMBLER_NEEDS_RELOC:
	(struct objdump_disasm_info): Add 'reloc' field.
	(disassemble_bytes): Fix check for when an insn has a reloc
	associated with it.  Improve comment explaining why the use of
	octets is wrong.  Set the 'reloc' field in objdump_disasm_info
	structure.
	(objdump_print_addr): Use new 'reloc' field to lookup the correct
	address for the symbol associated with the current instruction's
	relocation.
	(disassemble_info): Initialise 'reloc' field.


gas/testsuite/ChangeLog
2005-03-01  Stig Petter Olsroed  <stigpo@users.sourceforge.net>
	    Nick Clifton  <nickc@redhat.com>

	* gas/arm/inst.d: Allow for ARM ports which decode the reloc
	associated with branches and so show the exact symbolic destination
	address rather than an offset from the start of the section.
	* gas/arm/pic.d: Likewise.
	
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: arm-objdump.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20050301/2b0cb793/attachment.ksh>


More information about the Binutils mailing list