[LLVMdev] jump table ?

Simon Burton simon at arrowtheory.com
Thu Jun 29 08:23:32 PDT 2006


On Thu, 29 Jun 2006 13:03:35 +0100
Ralph Corderoy <ralph at inputplus.co.uk> wrote:

> 
> Hi Simon,
> 
> > > objdump's -i option will show you the available file formats, one's
> > > normally `binary' or something similar.
> > 
> > I've had a look at this, and it's not yielding any results so far.
> > Surely objdump expects an elf header, symbol table, etc. ?
> 
> Try
> 
>     objdump -D -b binary -m i386 /etc/passwd

Wow.

OK, this is what I get:

       0:       81 ec 0c 08 00 00       sub    $0x80c,%esp
       6:       8b 84 24 10 08 00 00    mov    0x810(%esp),%eax
       d:       8a 00                   mov    (%eax),%al
       f:       80 f8 80                cmp    $0x80,%al
      12:       0f 82 c5 05 00 00       jb     0x5dd
      18:       e9 00 00 00 00          jmp    0x1d
      1d:       80 f8 c0                cmp    $0xc0,%al
      20:       0f 82 e0 02 00 00       jb     0x306
      26:       80 f8 e0                cmp    $0xe0,%al
      29:       0f 82 70 01 00 00       jb     0x19f
      2f:       80 f8 f0                cmp    $0xf0,%al
      32:       0f 82 b8 00 00 00       jb     0xf0
      38:       80 f8 f8                cmp    $0xf8,%al
      3b:       0f 82 5c 00 00 00       jb     0x9d
      41:       80 f8 fc                cmp    $0xfc,%al
      44:       0f 82 2e 00 00 00       jb     0x78
  ....

Which looks like the big switch statement that it comes from... yuck.

Simon.





More information about the llvm-dev mailing list