[Openmcl-devel] Elf symbols doesn't work on linuxx86-64.

Gary Byers gb at clozure.com
Mon Oct 13 11:40:31 UTC 2008


There seem to be a few different packages which provide incompatible
versions of libelf.  On a Fedora 9 system, I have

[src/ccl-dev] gb at rinpoche> ls -l /usr/lib64/libelf*
-rwxr-xr-x 1 root root 82680 2008-05-12 19:30 /usr/lib64/libelf-0.135.so
lrwxrwxrwx 1 root root    11 2008-09-15 20:06 /usr/lib64/libelf.so -> libelf.so.1
lrwxrwxrwx 1 root root    15 2008-09-15 20:02 /usr/lib64/libelf.so.1 -> libelf-0.135.so

e.g, the real underlying library has a version number of "0.135".

On an Ubuntu 8.0.4 system,

lrwxrwxrwx 1 root root    15 2008-08-14 17:25 /usr/lib64/libelf.so.0 -> libelf.so.0.8.6
lrwxrwxrwx 1 root root    15 2008-08-14 17:25 /usr/lib64/libelf.so.0.8 -> libelf.so.0.8.6
-rw-r--r-- 1 root root 91376 2007-10-02 13:52 /usr/lib64/libelf.so.0.8.6

the real library is apparently at version 0.8.6 (e.g., a totally different
libelf.)  Note that I did not have either "libelf-dev" or "libelfg0-dev"
installed and there ws no symbolic link named "libelf.so"

On Ubuntu (I assume that Debian is probably similar), a slightly older
version (0.131) of the same flavor of libelf that the lisp expects)
is available as part of the "libelf1" package, and the header files
and libraries are available as "libelf-dev".  After doing:


shell> sudo apt-get install libelf-dev

I had both the "0.8.6" flavor and the 0.13* flavor installed, with the
symbolic link pointing to the 0.131 version.  (I assume that "libelf-dev"
and "libelf-dev" can't coexist.)

-rw-r--r-- 1 root root  76048 2008-01-03 06:26 /usr/lib/libelf-0.131.so
-rw-r--r-- 1 root root 250888 2008-01-03 06:26 /usr/lib/libelf.a
lrwxrwxrwx 1 root root     11 2008-10-13 05:23 /usr/lib/libelf.so -> libelf.so.1
lrwxrwxrwx 1 root root     15 2008-08-14 17:25 /usr/lib/libelf.so.0 -> libelf.so.0.8.6
lrwxrwxrwx 1 root root     15 2008-08-14 17:25 /usr/lib/libelf.so.0.8 -> libelf.so.0.8.6
-rw-r--r-- 1 root root  91376 2007-10-02 13:52 /usr/lib/libelf.so.0.8.6
lrwxrwxrwx 1 root root     15 2008-10-13 05:23 /usr/lib/libelf.so.1 -> libelf-0.131.so

and then:

[src/ccl-dev] gb at koan> ccl64
Welcome to Clozure Common Lisp Version 1.3-dev-r11012M-trunk  (LinuxX8664)!
? (software-type)
"Linux"  ; Not very interesting ...
? (run-program "cat" '("/etc/issue") :output t)
Ubuntu 8.04.1 \n \l

#<EXTERNAL-PROCESS (cat /etc/issue)[21235] (EXITED : 0) #x300040DFA07D>
? (require "ELF")
"ELF"
("ELF")
? (ccl::write-elf-symbols-to-file "home:elf-symbols64")
"home:elf-symbols64"
? (quit)

[src/ccl-dev] gb at koan> readelf -W -s ~/elf-symbols64 | head

Symbol table '.symtab' contains 12020 entries:
    Num:    Value          Size Type    Bind   Vis      Ndx Name
      0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND
      1: 00003000400009ff    57 FUNC    GLOBAL DEFAULT    1 <Compiled-function.%FIXNUM-TO-BIGNUM-SET.0x3000400009FF>
      2: 0000300040000aaf   105 FUNC    GLOBAL DEFAULT    1 <Compiled-function.%MULTIPLY-AND-ADD4.0x300040000AAF>
      3: 0000300040000b8f    81 FUNC    GLOBAL DEFAULT    1 <Compiled-function.%MULTIPLY-AND-ADD3.0x300040000B8F>
      4: 0000300040000c4f    65 FUNC    GLOBAL DEFAULT    1 <Compiled-function.%FLOOR.0x300040000C4F>
      5: 0000300040000cff    57 FUNC    GLOBAL DEFAULT    1 <Compiled-function.%MULTIPLY.0x300040000CFF>
      6: 0000300040000daf    33 FUNC    GLOBAL DEFAULT    1 <Compiled-function.%SET-BIGNUM-LENGTH.0x300040000DAF>

I assume that the other 12013 symbols are there, too.

On Sat, 11 Oct 2008, David Brown wrote:

> Following the instructions from the manual for getting symbols with oprofile:
>
> Welcome to Clozure Common Lisp Version 1.3-dev-r11053M-trunk  (LinuxX8664)!
> ? (require "ELF")
> "ELF"
> ("ELF")
> ? (ccl::write-elf-symbols-to-file "home:elf-symbols")
>> Error: Can't initialize libelf object for "home:elf-symbols": Request error: invalid ELF_C_* argument
>> While executing: CCL::CREATE-ELF-OBJECT, in process listener(1).
>
> $ ls -l /usr/lib64/libelf.so*
>  0 lrwxrwxrwx 1 root root    15 2008-10-11 10:04 /usr/lib64/libelf.so -> libelf.so.0.8.4*
>  0 lrwxrwxrwx 1 root root    15 2008-10-11 10:04 /usr/lib64/libelf.so.0 -> libelf.so.0.8.4*
> 88 -rwxr-xr-x 1 root root 89392 2008-10-11 10:04 /usr/lib64/libelf.so.0.8.4*
>
> Thanks,
> David
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>
>



More information about the Openmcl-devel mailing list