Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see the compilation platform of a static library file

Tags:

c

unix

macos

I had a static library file. How can I see whether it is compiled in i386 or in arm platform. Thanks.

like image 891
seanxiaoxiao Avatar asked Feb 13 '12 13:02

seanxiaoxiao


People also ask

Is static library compiled?

In computer science, a static library or statically-linked library is a set of routines, external functions and variables which are resolved in a caller at compile-time and copied into a target application by a compiler, linker, or binder, producing an object file and a stand-alone executable.

What is the format of a static library?

A static library, e.g. libfoo. a is not an executable of any kind. It is simply an indexed archive in unix ar format of other files which happen to be ELF object files.

What command S can be used to list the symbols stored in a static library?

If we want to see the contents of our library, we can use the ar option -t . We can also see the symbols in our library, using the command nm , which lists each symbol's symbol value, symbol type, and symbol name from object files.

What is in a static library?

A static library is a programming concept in which shared libraries with special functionalities, classes or resources are linked to external applications or components, facilitating the creation of stand-alone and executable files.


1 Answers

objdump is your friend ;)

$ objdump -f lib/lib.a
like image 170
yves Baumes Avatar answered Oct 26 '22 22:10

yves Baumes