x86 leal quirk

Ulrich Drepper drepper@redhat.com
Mon Sep 23 16:36:00 GMT 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Richard Henderson wrote:
> 	leal    %gs:j@NTPOFF, %eax
> 
> I guess I can see how it kinda makes sense, encoding-wise,
> but it'd be nice if it at least gave a warning, since it
> doesn't really do what you expect it to do.

I understand completely where you come from, having been bitten by the
same bug.

But where would you stop?

      .byte 0x65
      leal    j@NTPOFF, %eax


What is the assembler supposed to do with that?  Or even something as
sick as

      jne     1f
      .byte 0x65
1:    leal    j@NTPOFF, %eax


And while we're at it

      leal    %ds:j@NTPOFF, %eax

(or %cs or %es).  There is no guarantee that those segments have a zero
offset.

- -- 
- ---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE9j5ag2ijCOnn/RHQRAlGoAKDEe55gEWw0cunGW5ZKVIiNPsSNqwCgiLxZ
s/enO6+VAvc/BiKdnbhrnkQ=
=N7CB
-----END PGP SIGNATURE-----



More information about the Binutils mailing list