This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] ARM: objdump produces incorrect disassembly on multiple inputs

On 4/7/2011 7:27 AM, Paul Brook wrote:
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.
Wouldn't it be better to use info->private_data ?
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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]