This is the mail archive of the binutils@sources.redhat.com 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: Fix i386 disassembler with index == 0x4 in SIB (Re: objdump bug-report)


On Thu, Jan 13, 2005 at 04:26:59PM -0800, H. J. Lu wrote:
> If it is an optimization, there shouldn't be a warning.

No, whether we warn or not is an entirely separate matter to whether we
optimize.

> I think it
> may be useful to turn "leal 0xf(%eax,1), %eax" into "8d 44 20 0f"
> Gcc/ld use
> 
> leal foo(%reg), %eax; call ___tls_get_addr; nop
> 
> today for TLS optimization. With the change, we can use
> 
> leal foo(%reg,1), %eax; call ___tls_get_addr;

Hmm.  So that you generate a larger instruction on purpose?  Wanted for
the space needed with some of the tls transformations, I expect.

OK, that is a valid reason to support encoding of the instruction
that way.  You still should warn for scale factors other than 1,
because it's easy to forget the comma in (,%reg,2) where you really
do want the register to be scaled.

> Then it should display
> 
> 8b 04 23                mov    (%ebx,1),%eax

Agreed.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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