My First Post      My Facebook Profile      My MeOnShow Profile      W3LC Facebook Page      Learners Consortium Group      Job Portal      Shopping @Yeyhi.com

Pages










Monday, March 11, 2013

Linux - Check Shared Object Compile Version - .SO and .A files - whether 32 bits or 64 bits - Using file and readelf commands


If you wish to check whether a shared object (.so) in Linux is 32 bits or 64 bits, you can use the following commands:
a. file
2. readelf

Lets see their usage one by one:

1. file XXX.so

file command will output the file type of the given file. It will work for .so files.
You must look for the ELF XX-bit in the output.
It tells you whether the file is 32 bits or 64 bits compiled.


2. readelf -h XXX.so

readelf command will output the information about elf files.
Look for the Class: ELFXX .
The XX will tell you whether the file is 32 bit or 64 bit compiled

It is important to note that that the readelf -h works for archive files (.a) as well.

And for the reference of our users, we can use the Dumpbin utility over Windows for similar and more information over the Windows platform.
A separate blog post will capture those details later.

1 comment:

  1. This information is meaningful and magnificent, Which you have shared here about the Linux. I am impressed by the details that you have shared in this post and It reveals how nicely you understand this subject. I am thankful to you for sharing this article here. How to create a file in Linux

    ReplyDelete