Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is shared object compiled for 32bit or 64bit machine?

Is there a command in Linux that we can run on a compiled shared object(.so) in /usr/lib and know whether it is compiled for 64 bit or 32 bit system? (I mean to know ELF class, like ELFCLASS32)

like image 882
codey modey Avatar asked Jan 11 '23 11:01

codey modey


1 Answers

You can use the file command. E.g.:

[myuser@mycomputer]$ file /usr/lib/libcurl.so.4.1.1 
/usr/lib/libcurl.so.4.1.1: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped
like image 161
Mureinik Avatar answered Jan 16 '23 17:01

Mureinik