I have a .a file from which I want to get architecture information. Running file myFile.a
results in file.a: current ar archive
. How can I get more information on what architecture the file contains?
相关问题
- Is shmid returned by shmget() unique across proces
- how to get running process information in java?
- Error building gcc 4.8.3 from source: libstdc++.so
- Why should we check WIFEXITED after wait in order
- Null-terminated string, opening file for reading
http://linux.die.net/man/1/ar
extract the object files from the archive and inspect them with file(1), nm(1), etc.
Use
It will Who the architecture it build for. Other functions like otool or file doesn't give the exact answer and sometimes it to verbose to get the correct information.
I would suggest using objdump instead of lipo. objdump provides detailed information than lipo.
objdump
is another option:You can also skip the
ar
command and use readelf, via something like:readelf -h <archive>.a | grep 'Class\|File\|Machine'
In case it's relevant, here's the other information that you can get from
readelf -h
. I just trimmed the above withgrep
, obviously:That output is for one of the object files in
libxslt.a
, but it gives the same information for each file.