This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH] ARM: objdump produces incorrect disassembly on multiple inputs
- From: Paul Carroll <pcarroll at codesourcery dot com>
- To: Paul Brook <paul at codesourcery dot com>
- Cc: binutils at sourceware dot org
- Date: Thu, 07 Apr 2011 11:07:17 -0600
- Subject: Re: [PATCH] ARM: objdump produces incorrect disassembly on multiple inputs
- References: <4D76BA21.email@example.com> <firstname.lastname@example.org>
On 4/7/2011 7:27 AM, Paul Brook wrote:
Wouldn't it be better to use info->private_data ?
The 'objdump' utility will not disassembly instructions correctly when
it processes multiple ARM input files.
This is due to the ARM disassembler using a couple of global symbols to
track symbol entries in a given input file.
This patch adds a call to initialize those 2 values at the start of
processing each ARM input file. This fix is ARM-specific.
As a test, I implemented the fix using 'info->private_data'.
That moves the 3 global variables, used by the ARM disassembler, into
this private structure.
But, the initialization call before starting disassembly is still
necessary since those variables need to be reset back to their initial
values. Otherwise, this issue isn't solved.
And, since the 'info' data structure is not presently available to the
common 'disassembler()' function where I added the initialization call,
that would need to have this additional 'info' argument passed into it,
so it could pass that on to the new ARM initialization call.
There is also a little bit of rearranging of the 'info->private_data'
initialization in the ARM disassembler so it now occurs as part of the
initialization of the variables that are at fault.
Perhaps an alternative would be to use the fix I proposed and make those
3 variables 'static'. I don't think there is any reason any code
outside of the ARM disassembler would want to access those variables.