2010-09-18

Useful tools for the problem 'undefined reference to..'

ldd: prints the shared libraries required by each program or shared library specified on the command line.
[example]
>ldd /usr/lib/libACE.*
    librt.so.1 => /lib/librt.so.1 (0x4819f000)
    libdl.so.2 => /lib/libdl.so.2 (0x481ae000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x481ba000)
    libm.so.6 => /lib/libm.so.6 (0x48295000)
    libc.so.6 => /lib/libc.so.6 (0x48342000)
    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x48469000)
    libpthread.so.0 => /lib/libpthread.so.0 (0x4847d000)
    /lib/ld-linux.so.3 (0x40071000)

nm: list symbols from object files
[example]
>nm -C -u libwx_baseu-2.8.so

readelf: Displays information about ELF files.
[example]
>readelf -s /lib/libdl.so.2                                             

Symbol table '.dynsym' contains 39 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 00000830     0 SECTION LOCAL  DEFAULT   10
     2: 00000000   200 FUNC    GLOBAL DEFAULT  UND strerror@GLIBC_2.4 (4)
....

No comments:

Post a Comment