Compiling Linux hsdis (uintptr_t, dlsym undefined; wrong ELF class)
Edward Lee
edilee at gmail.com
Wed Dec 10 12:11:18 PST 2008
I was trying to compile hsdis on Linux 2.6.18-53.el5 x86_64 and ran
into a few issues.
The first couple was fixed by a patch [1] to address various things
being undefined:
hsdis.c:50: error: expected specifier-qualifier-list before 'uintptr_t'
hsdis-demo.c:(.text+0x96): undefined reference to `dlsym'
hsdis-demo.c:(.text+0xcc): undefined reference to `dlopen'
hsdis-demo.c:(.text+0x1fa): undefined reference to `dlerror'
The next issue was that the disassembler couldn't use hsdis-i386.so. I
found out with +WizardMode that the problem was "wrong ELF class:
ELFCLASS64". So I had to recompile both binutils and hsdis with the
-m32 option.
bin/linux/hsdis-i386.so: ELF 64-bit LSB shared object, Intel 80386,
version 1 (SYSV), not stripped
.. instead of ..
bin/linux/hsdis-i386.so: ELF 32-bit LSB shared object, Intel 80386,
version 1 (SYSV), not stripped
I've updated the original patch [1] to have changes to Makefile and
README about using -m32.
Ed
[1] http://groups.google.com/group/jvm-languages/msg/4b7b6f19ab719cb7
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hsdis.m32.patch
Type: application/octet-stream
Size: 1366 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/hotspot-dev/attachments/20081210/cb07733d/attachment.obj
More information about the hotspot-dev
mailing list