Friday, April 26, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1302  / 2 Years ago, sun, february 13, 2022, 8:47:56

I would like to get a list of libraries requested by Gridwars executable.



I one year ago used ldd but



moi@myComputer:/opt/gridwars/gridwars_lin$ ldd gridwars 
not a dynamic executable


After browsing the Internet, I found



moi@myComputer:/opt/gridwars/gridwars_lin$ readelf -d gridwars 

Dynamic section at offset 0x70014 contains 27 entries:
Tag Type Name/Value
0x00000001 (NEEDED) Shared library: [libX11.so.6]
0x00000001 (NEEDED) Shared library: [libGL.so.1]
0x00000001 (NEEDED) Shared library: [libGLU.so.1]
0x00000001 (NEEDED) Shared library: [libXxf86vm.so.1]
0x00000001 (NEEDED) Shared library: [libstdc++.so.5]
0x00000001 (NEEDED) Shared library: [libm.so.6]
0x00000001 (NEEDED) Shared library: [libpthread.so.0]
0x00000001 (NEEDED) Shared library: [libc.so.6]
0x0000000c (INIT) 0x804a284
0x0000000d (FINI) 0x80b29bd
0x00000004 (HASH) 0x8048168
0x00000005 (STRTAB) 0x8049268
0x00000006 (SYMTAB) 0x8048678
0x0000000a (STRSZ) 2091 (bytes)
0x0000000b (SYMENT) 16 (bytes)
0x00000015 (DEBUG) 0x0
0x00000003 (PLTGOT) 0x80b811c
0x00000002 (PLTRELSZ) 1408 (bytes)
0x00000014 (PLTREL) REL
0x00000017 (JMPREL) 0x8049d04
0x00000011 (REL) 0x8049cd4
0x00000012 (RELSZ) 48 (bytes)
0x00000013 (RELENT) 8 (bytes)
0x6ffffffe (VERNEED) 0x8049c14
0x6fffffff (VERNEEDNUM) 4
0x6ffffff0 (VERSYM) 0x8049a94
0x00000000 (NULL) 0x0


Right I have a list of the requested shared objects. But this still cause me some trouble : I cannot understand two things...



As proposed in comment, we may want to run file utility on the executable.



moi@mycomputer:/opt/gridwars/gridwars_lin$ file gridwars 
gridwars: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.0, stripped



  • How can I check if one ".so" file/shared object is available?


  • Why the hell the gridwars executable is not an executable? I remember the thing to be a executable and even having found a magic command in three letters that list requested shared objects and if there were available.




Thanks for any help.


More From » executable

 Answers
4

After installing the following package,



sudo apt-get install libc6:i386
sudo apt-get install libxxf86vm1:i386
sudo apt-get install libglu1-mesa:i386
sudo apt-get install libstdc++5:i386


You get



moi@somewhere:/opt/gridwars/gridwars_lin$ ldd gridwars 
linux-gate.so.1 => (0xf77b2000)
libX11.so.6 => /usr/lib/i386-linux-gnu/libX11.so.6 (0xf765d000)
libGL.so.1 => /usr/lib/i386-linux-gnu/mesa/libGL.so.1 (0xf7604000)
libGLU.so.1 => /usr/lib/i386-linux-gnu/libGLU.so.1 (0xf757c000)
libXxf86vm.so.1 => /usr/lib/i386-linux-gnu/libXxf86vm.so.1 (0xf7576000)
libstdc++.so.5 => /usr/lib/i386-linux-gnu/libstdc++.so.5 (0xf74bc000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf7479000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf745e000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf72a9000)
libxcb.so.1 => /usr/lib/i386-linux-gnu/libxcb.so.1 (0xf7287000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf7282000)
libglapi.so.0 => /usr/lib/i386-linux-gnu/libglapi.so.0 (0xf726b000)
libXext.so.6 => /usr/lib/i386-linux-gnu/libXext.so.6 (0xf7259000)
libXdamage.so.1 => /usr/lib/i386-linux-gnu/libXdamage.so.1 (0xf7254000)
libXfixes.so.3 => /usr/lib/i386-linux-gnu/libXfixes.so.3 (0xf724d000)
libX11-xcb.so.1 => /usr/lib/i386-linux-gnu/libX11-xcb.so.1 (0xf724a000)
libxcb-glx.so.0 => /usr/lib/i386-linux-gnu/libxcb-glx.so.0 (0xf7232000)
libxcb-dri2.so.0 => /usr/lib/i386-linux-gnu/libxcb-dri2.so.0 (0xf722d000)
libdrm.so.2 => /usr/lib/i386-linux-gnu/libdrm.so.2 (0xf721f000)
libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xf7136000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf7119000)
/lib/ld-linux.so.2 (0xf77b3000)
libXau.so.6 => /usr/lib/i386-linux-gnu/libXau.so.6 (0xf7115000)
libXdmcp.so.6 => /usr/lib/i386-linux-gnu/libXdmcp.so.6 (0xf710e000)


And the game works.


[#28238] Sunday, February 13, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ainbby

Total Points: 184
Total Questions: 115
Total Answers: 112

Location: Colombia
Member since Thu, Sep 29, 2022
2 Years ago
ainbby questions
Thu, Mar 23, 23, 10:26, 1 Year ago
Wed, May 10, 23, 00:10, 1 Year ago
Fri, Apr 15, 22, 10:11, 2 Years ago
;