# LD_DEBUG=1 libdll_test libs: load_object: attempt load of libm.so.2 debug: find_file:1151: name=libm.so.2 libpath=:/opt/X11R6/lib:/usr/local/lib:/usr/local/lib/tcl8.4:/opt/root/lib::/opt/root/cint/lib rpath=NULL debug: searchpath:1095: name=libm.so.2 path= amode=4 bufsize=1025 debug: searchpath:1095: name=libm.so.2 path=:/opt/X11R6/lib:/usr/local/lib:/usr/local/lib/tcl8.4:/opt/root/lib::/opt/root/cint/lib amode=4 bufsize=1025 debug: searchpath:1119: trying libm.so.2 debug: searchpath:1130:libm.so.2: failed (No such file or directory) debug: searchpath:1119: trying /opt/X11R6/lib/libm.so.2 debug: searchpath:1130:/opt/X11R6/lib/libm.so.2: failed (No such file or directory) debug: searchpath:1119: trying /usr/local/lib/libm.so.2 debug: searchpath:1130:/usr/local/lib/libm.so.2: failed (No such file or directory) debug: searchpath:1119: trying /usr/local/lib/tcl8.4/libm.so.2 debug: searchpath:1130:/usr/local/lib/tcl8.4/libm.so.2: failed (No such file or directory) debug: searchpath:1119: trying /opt/root/lib/libm.so.2 debug: searchpath:1130:/opt/root/lib/libm.so.2: failed (No such file or directory) debug: searchpath:1119: trying libm.so.2 debug: searchpath:1130:libm.so.2: failed (No such file or directory) debug: searchpath:1119: trying /opt/root/cint/lib/libm.so.2 debug: searchpath:1130:/opt/root/cint/lib/libm.so.2: failed (No such file or directory) debug: searchpath:1095: name=libm.so.2 path=/proc/boot:/lib:/usr/lib:/lib/dll:/opt/lib amode=4 bufsize=1025 debug: searchpath:1119: trying /proc/boot/libm.so.2 debug: searchpath:1130:/proc/boot/libm.so.2: failed (No such file or directory) debug: searchpath:1119: trying /lib/libm.so.2 debug: searchpath:1124:/lib/libm.so.2: success libs: /lib/libm.so.2: found; real path:/lib/libm.so.2 libs: load_elf32: loaded lib at addr b8200000(text) b822de7c(data) libs: object libm.so.2 loaded; real soname: libm.so.2 loaded from: /lib/libm.so.2 debug: Added to link map debug: Added libm.so.2 to link map debug: Added libc.so.3 to link map Resolution scope for Executable->libdll_test: Executable->libdll_test libm.so.2->/lib/libm.so.2 libc.so.3->/usr/lib/ldqnx.so.2 libs: init: libc.so.3 obj->refcount: 1 libs: init: libm.so.2 obj->refcount: 1 debug: Looking up symbol atexit debug: Symbol atexit bound to definition in libc.so.3 List dump. Name: debug: Startup objects list (DSO) Object addr 0x0x8055000 Refcount: 1 Flags: 0x40e247 INITFINIRESOLVEDJMPRELSDONEEXECUTABLEINITARRAYFINIARRAYPREINITGLOBAL Name: Rpath: Text: 0x0x8048000 Text size: 1707 (0x6ab) Text rel: 0 (0x0) Data offset: 5804 (0x16ac) Data size: 276 (0x114) Data rel: 0 (0x0) Scope: 0x0xb037dca8 Object addr 0x0x8055400 Refcount: 1 Flags: 0x402043 INITRESOLVEDJMPRELSDONEINITARRAYGLOBAL Name: libm.so.2 Rpath: Text: 0x0xb8200000 Text size: 183908 (0x2ce64) Text rel: 3089104896 (0xb8200000) Data offset: 188028 (0x2de7c) Data size: 17252 (0x4364) Data rel: 3089104896 (0xb8200000) Scope: 0x0xb037dca8 Object addr 0x0x8055800 Refcount: 1 Flags: 0x402043 INITRESOLVEDJMPRELSDONEINITARRAYGLOBAL Name: libc.so.3 Rpath: Text: 0x0xb0300000 Text size: 497576 (0x797a8) Text rel: 2955935744 (0xb0300000) Data offset: 501696 (0x7a7c0) Data size: 16044 (0x3eac) Data rel: 2955935744 (0xb0300000) Scope: 0x0xb037dca8 List dump. Name: debug: All objects list (DAO) Object addr 0x0x8055000 Refcount: 1 Flags: 0x40e247 INITFINIRESOLVEDJMPRELSDONEEXECUTABLEINITARRAYFINIARRAYPREINITGLOBAL Name: Rpath: Text: 0x0x8048000 Text size: 1707 (0x6ab) Text rel: 0 (0x0) Data offset: 5804 (0x16ac) Data size: 276 (0x114) Data rel: 0 (0x0) Scope: 0x0xb037dca8 Object addr 0x0x8055400 Refcount: 1 Flags: 0x402043 INITRESOLVEDJMPRELSDONEINITARRAYGLOBAL Name: libm.so.2 Rpath: Text: 0x0xb8200000 Text size: 183908 (0x2ce64) Text rel: 3089104896 (0xb8200000) Data offset: 188028 (0x2de7c) Data size: 17252 (0x4364) Data rel: 3089104896 (0xb8200000) Scope: 0x0xb037dca8 Object addr 0x0x8055800 Refcount: 1 Flags: 0x402043 INITRESOLVEDJMPRELSDONEINITARRAYGLOBAL Name: libc.so.3 Rpath: Text: 0x0xb0300000 Text size: 497576 (0x797a8) Text rel: 2955935744 (0xb0300000) Data offset: 501696 (0x7a7c0) Data size: 16044 (0x3eac) Data rel: 2955935744 (0xb0300000) Scope: 0x0xb037dca8 debug: Looking up symbol _init_libc debug: Symbol _init_libc bound to definition in libc.so.3 debug: Looking up symbol _preinit_array debug: Symbol _preinit_array bound to definition in libc.so.3 debug: Looking up symbol atexit debug: Symbol atexit bound to definition in libc.so.3 debug: Looking up symbol _fini_array debug: Symbol _fini_array bound to definition in libc.so.3 debug: Looking up symbol _init_array debug: Symbol _init_array bound to definition in libc.so.3 debug: Looking up symbol dlopen debug: Symbol dlopen bound to definition in libc.so.3 debug: Looking up symbol __get_errno_ptr debug: Symbol __get_errno_ptr bound to definition in libc.so.3 debug: Looking up symbol getenv debug: Symbol getenv bound to definition in libc.so.3 debug: Looking up symbol _findenv debug: Symbol _findenv bound to definition in libc.so.3 debug: Looking up symbol strncmp debug: Symbol strncmp bound to definition in libc.so.3 libs: dlopen("dll.so",2) Mode: NOW libs: Neither RTLD_GROUP nor RTLD_WORLD specified, assuming RTLD_GROUP | RTLD_WORLD libs: load_object: attempt load of dll.so debug: find_file:1151: name=dll.so libpath=:/opt/X11R6/lib:/usr/local/lib:/usr/local/lib/tcl8.4:/opt/root/lib::/opt/root/cint/lib rpath=NULL debug: searchpath:1095: name=dll.so path= amode=4 bufsize=1025 debug: searchpath:1095: name=dll.so path=:/opt/X11R6/lib:/usr/local/lib:/usr/local/lib/tcl8.4:/opt/root/lib::/opt/root/cint/lib amode=4 bufsize=1025 debug: Looking up symbol strlen debug: Symbol strlen bound to definition in libc.so.3 debug: Looking up symbol strcpy debug: Symbol strcpy bound to definition in libc.so.3 debug: searchpath:1119: trying dll.so debug: Looking up symbol eaccess debug: Symbol eaccess bound to definition in libc.so.3 debug: Looking up symbol _connect debug: Symbol _connect bound to definition in libc.so.3 debug: Looking up symbol _connect_entry debug: Symbol _connect_entry bound to definition in libc.so.3 debug: Looking up symbol _connect_ctrl debug: Symbol _connect_ctrl bound to definition in libc.so.3 debug: Looking up symbol __stackavail debug: Symbol __stackavail bound to definition in libc.so.3 debug: Looking up symbol ConnectAttach debug: Symbol ConnectAttach bound to definition in libc.so.3 debug: Looking up symbol ConnectDetach_r debug: Symbol ConnectDetach_r bound to definition in libc.so.3 debug: Looking up symbol memcpy debug: Symbol memcpy bound to definition in libc.so.3 debug: Looking up symbol memmove debug: Symbol memmove bound to definition in libc.so.3 debug: Looking up symbol ConnectClientInfo debug: Symbol ConnectClientInfo bound to definition in libc.so.3 debug: Looking up symbol close debug: Symbol close bound to definition in libc.so.3 debug: Looking up symbol MsgSend debug: Symbol MsgSend bound to definition in libc.so.3 debug: searchpath:1124:dll.so: success debug: Looking up symbol __sopen debug: Symbol __sopen bound to definition in libc.so.3 debug: Looking up symbol _vopen debug: Symbol _vopen bound to definition in libc.so.3 debug: Looking up symbol ConnectFlags_r debug: Symbol ConnectFlags_r bound to definition in libc.so.3 debug: Looking up symbol pathconf debug: Symbol pathconf bound to definition in libc.so.3 debug: Looking up symbol _connect_combine debug: Symbol _connect_combine bound to definition in libc.so.3 debug: Looking up symbol ConnectDetach debug: Symbol ConnectDetach bound to definition in libc.so.3 debug: Looking up symbol realpath debug: Symbol realpath bound to definition in libc.so.3 debug: Looking up symbol _fullpath debug: Symbol _fullpath bound to definition in libc.so.3 libs: dll.so: found; real path:/opt/tcc-0.9.25/tests/dll.so debug: Looking up symbol fstat debug: Symbol fstat bound to definition in libc.so.3 debug: Looking up symbol __stat_check debug: Symbol __stat_check bound to definition in libc.so.3 debug: Looking up symbol read debug: Symbol read bound to definition in libc.so.3 debug: Looking up symbol lseek debug: Symbol lseek bound to definition in libc.so.3 debug: Looking up symbol lseek64 debug: Symbol lseek64 bound to definition in libc.so.3 debug: Looking up symbol msync debug: Symbol msync bound to definition in libc.so.3 libs: load_elf32: loaded lib at addr b8233000(text) b82344b8(data) debug: Looking up symbol time debug: Symbol time bound to definition in libc.so.3 debug: Looking up symbol _syspage_time debug: Symbol _syspage_time bound to definition in libc.so.3 debug: Looking up symbol __udivdi3 debug: Symbol __udivdi3 bound to definition in libc.so.3 libs: object dll.so loaded; real soname: dll.so loaded from: /opt/tcc-0.9.25/tests/dll.so debug: Looking up symbol strcmp debug: Symbol strcmp bound to definition in libc.so.3 debug: Added dll.so to link map Resolution scope for dll.so->/opt/tcc-0.9.25/tests/dll.so: Executable->libdll_test dll.so->/opt/tcc-0.9.25/tests/dll.so libm.so.2->/lib/libm.so.2 libc.so.3->/usr/lib/ldqnx.so.2 r_map: Base address: 0x0x8048000 Soname: Next: 0x0x8055400 Prev: 0x0x0 Matching soname: Time lib was loaded: 1312297658 Path: libdll_test -------------------- Base address: 0x0xb8200000 Soname: libm.so.2 Next: 0x0x8055800 Prev: 0x0x8055000 Matching soname: Time lib was loaded: 1312297658 Path: /lib/libm.so.2 -------------------- Base address: 0x0xb0300000 Soname: libc.so.3 Next: 0x0x8055c00 Prev: 0x0x8055400 Matching soname: Time lib was loaded: 1312297658 Path: /usr/lib/ldqnx.so.2 -------------------- Base address: 0x0xb8233000 Soname: dll.so Next: 0x0x0 Prev: 0x0x8055800 Matching soname: Time lib was loaded: 1312297658 Path: /opt/tcc-0.9.25/tests/dll.so -------------------- List dump. Name: debug: All objects list (DAO) Object addr 0x0x8055000 Refcount: 2 Flags: 0x40e247 INITFINIRESOLVEDJMPRELSDONEEXECUTABLEINITARRAYFINIARRAYPREINITGLOBAL Name: Rpath: Text: 0x0x8048000 Text size: 1707 (0x6ab) Text rel: 0 (0x0) Data offset: 5804 (0x16ac) Data size: 276 (0x114) Data rel: 0 (0x0) Scope: 0x0xb037dca8 Object addr 0x0x8055400 Refcount: 2 Flags: 0x402043 INITRESOLVEDJMPRELSDONEINITARRAYGLOBAL Name: libm.so.2 Rpath: Text: 0x0xb8200000 Text size: 183908 (0x2ce64) Text rel: 3089104896 (0xb8200000) Data offset: 188028 (0x2de7c) Data size: 17252 (0x4364) Data rel: 3089104896 (0xb8200000) Scope: 0x0xb037dca8 Object addr 0x0x8055800 Refcount: 2 Flags: 0x402043 INITRESOLVEDJMPRELSDONEINITARRAYGLOBAL Name: libc.so.3 Rpath: Text: 0x0xb0300000 Text size: 497576 (0x797a8) Text rel: 2955935744 (0xb0300000) Data offset: 501696 (0x7a7c0) Data size: 16044 (0x3eac) Data rel: 2955935744 (0xb0300000) Scope: 0x0xb037dca8 Object addr 0x0x8055c00 Refcount: 1 Flags: 0x100 NOSONAME Name: dll.so Rpath: Text: 0x0xb8233000 Text size: 1205 (0x4b5) Text rel: 3089313792 (0xb8233000) Data offset: 5304 (0x14b8) Data size: 232 (0xe8) Data rel: 3089313792 (0xb8233000) Scope: 0x0x8053200 debug: Looking up symbol __cxa_finalize debug: Symbol __cxa_finalize bound to definition in libc.so.3 libs: init: dll.so obj->refcount: 1 debug: Looking up symbol atomic_clr debug: Symbol atomic_clr bound to definition in libc.so.3 debug: Looking up symbol dlsym debug: Symbol dlsym bound to definition in libc.so.3 debug: Looking up symbol foo debug: Symbol foo bound to definition in dll.so reloc: dlsym(0x8053200,foo) real_handle:0x8053200=0xb8233398 debug: Looking up symbol puts debug: Symbol puts bound to definition in libc.so.3 debug: Looking up symbol _Lockfilelock debug: Symbol _Lockfilelock bound to definition in libc.so.3 debug: Looking up symbol _Mtxini debug: Symbol _Mtxini bound to definition in libc.so.3 debug: Looking up symbol pthread_mutex_init debug: Symbol pthread_mutex_init bound to definition in libc.so.3 debug: Looking up symbol SyncTypeCreate_r debug: Symbol SyncTypeCreate_r bound to definition in libc.so.3 debug: Looking up symbol _Mtxlock debug: Symbol _Mtxlock bound to definition in libc.so.3 debug: Looking up symbol _Mtxunlock debug: Symbol _Mtxunlock bound to definition in libc.so.3 debug: Looking up symbol fputs debug: Symbol fputs bound to definition in libc.so.3 debug: Looking up symbol _Fwprep debug: Symbol _Fwprep bound to definition in libc.so.3 debug: Looking up symbol _Fbuf debug: Symbol _Fbuf bound to definition in libc.so.3 debug: Looking up symbol fileno debug: Symbol fileno bound to definition in libc.so.3 debug: Looking up symbol isatty debug: Symbol isatty bound to definition in libc.so.3 debug: Looking up symbol _devctl debug: Symbol _devctl bound to definition in libc.so.3 debug: Looking up symbol strrchr debug: Symbol strrchr bound to definition in libc.so.3 debug: Looking up symbol _Unlockfilelock debug: Symbol _Unlockfilelock bound to definition in libc.so.3 debug: Looking up symbol fputc debug: Symbol fputc bound to definition in libc.so.3 debug: Looking up symbol fflush debug: Symbol fflush bound to definition in libc.so.3 debug: Looking up symbol write debug: Symbol write bound to definition in libc.so.3 ------------------------- Hello World! ------------------------- debug: Looking up symbol fib debug: Symbol fib bound to definition in dll.so debug: Looking up symbol printf debug: Symbol printf bound to definition in libc.so.3 debug: Looking up symbol _Printf debug: Symbol _Printf bound to definition in libc.so.3 debug: Looking up symbol _Mbtowc debug: Symbol _Mbtowc bound to definition in libc.so.3 debug: Looking up symbol _Mbtowcx debug: Symbol _Mbtowcx bound to definition in libc.so.3 debug: Looking up symbol fwrite debug: Symbol fwrite bound to definition in libc.so.3 debug: Looking up symbol memchr debug: Symbol memchr bound to definition in libc.so.3 debug: Looking up symbol strchr debug: Symbol strchr bound to definition in libc.so.3 debug: Looking up symbol _Putfld debug: Symbol _Putfld bound to definition in libc.so.3 debug: Looking up symbol _Litob debug: Symbol _Litob bound to definition in libc.so.3 debug: Looking up symbol __umoddi3 debug: Symbol __umoddi3 bound to definition in libc.so.3 debug: Looking up symbol __divdi3 debug: Symbol __divdi3 bound to definition in libm.so.2 debug: Looking up symbol _Puttxt debug: Symbol _Puttxt bound to definition in libc.so.3 ---------------------------------------- fib(32) = 2178309 ---------------------------------------- debug: Looking up symbol add debug: Symbol add bound to definition in dll.so ----------------------------- add(32, 64) = 96 ----------------------------- debug: Looking up symbol exit debug: Symbol exit bound to definition in libc.so.3 debug: Looking up symbol _cleanup debug: Symbol _cleanup bound to definition in libc.so.3 debug: Looking up symbol __cxa_finalize debug: Symbol __cxa_finalize bound to definition in libc.so.3 debug: Looking up symbol __cxa_finalize debug: Symbol __cxa_finalize bound to definition in libc.so.3 libs: fini: libm.so.2 obj->refcount: 2 libs: fini: libc.so.3 obj->refcount: 2 debug: Looking up symbol __cxa_finalize debug: Symbol __cxa_finalize bound to definition in libc.so.3 libs: fini: dll.so obj->refcount: 1 statistics: Number of bootstrap resolved symbols: 67 statistics: Number of resolved symbols (without bootstrap): 105 statistics: Number of relative relocations: 775 statistics: Number of relative relocations exe only: 0 statistics: Number of relative relocations libc only: 674 debug: Looking up symbol fsync debug: Symbol fsync bound to definition in libc.so.3 debug: Looking up symbol _exit debug: Symbol _exit bound to definition in libc.so.3 debug: Looking up symbol __exit debug: Symbol __exit bound to definition in libc.so.3 debug: Looking up symbol ThreadDestroy debug: Symbol ThreadDestroy bound to definition in libc.so.3