- What Is an SO File?
- What to Know
- What Is an SO File?
- How to Open a SO File
- How to Convert SO Files
- Still Can’t Open the File?
- More Information on SO Files
- .SO File Extension
- How to open a SO file
- How to open the files with the extension («.so») [closed]
- 2 Answers 2
- Thread: how to read .so file in ubuntu
- how to read .so file in ubuntu
- Re: how to read .so file in ubuntu
- Re: how to read .so file in ubuntu
- Re: how to read .so file in ubuntu
What Is an SO File?
Tim Fisher has more than 30 years’ of professional technology experience. He’s been writing about tech for more than two decades and serves as the SVP and General Manager of Lifewire.
- File Types
- Apps
- Windows
- MS Office
- Linux
- Google Drive
- Backup & Utilities
- Design
- Cryptocurrency
What to Know
- An SO file is a shared library file used on Android and Linux operating systems.
- Several programs can use the same SO file.
- It’s not meant to be opened manually, but you might have luck doing so with the GCC.
This article explains what SO files are, including why and where they’re used.
What Is an SO File?
A file with the .SO file extension is a shared library file. They contain information that can be used by one or more programs to offload resources so that the application(s) calling the SO file doesn’t have to actually provide the file.
For example, one SO file might contain information and functions on how to quickly search through the whole computer. Several programs can then call upon that file to use that feature in their own respective programs.
However, instead of having to compile it in the program’s own binary code, the SO file serves as an extension that the program just has to call on in order to use its utilities. The SO file can even be updated/replaced later without those programs having to make any changes to their own code.
Shared library files are similar to Dynamic Link Library (DLL) files used in Windows and Mach-O Dynamic Library (DYLIB) files on macOS, except that SO files are found on Linux-based systems and the Android OS.
SO doesn’t just refer to a shared library file. It’s also an abbreviation for server options, service object, system overload, send only, system outage, serial output, and stuck open. However, don’t confuse it with OS, which means operating system.
How to Open a SO File
SO files can technically be opened with the GNU Compiler Collection (GCC), but these types of files aren’t intended to be viewed or used like you might another file type. Instead, they’re just placed in an appropriate folder and used automatically by other programs via Linux’s dynamic link loader.
However, you might be able to treat it as a text file by opening it in a text editor like Leafpad, gedit, KWrite, or Geany if you’re on Linux, or Notepad++ on Windows. It’s unlikely, though, that the text will be in a human-readable format.
How to Convert SO Files
We’re not aware of any programs that can convert SO to DLL for use on Windows, and considering what these files are and what they do, it’s not likely there’s one out there. It’s also not a straightforward task to convert SO to other file formats like JAR or A (a Stat Library file).
You might be able to «convert» SO files to JAR files by just zipping them into an archive file format like .ZIP and then renaming it to .JAR.
Still Can’t Open the File?
An obvious reason for why you can’t open the file is that it’s not really a SO file. It might just share some common letters as that file extension. Similar sounding file extensions don’t necessarily mean that the file formats are similar, nor that they might work with the same programs.
For example, the popular ISO file format looks a lot like it reads «.SO» at the end of the filename, but the two are not related and can’t open with the same programs.
Another example can be seen with SOL files, which are Flash local shared objects used with the now-defunct Adobe Flash.
More Information on SO Files
The name of a shared library file is called a soname. It starts with «lib» at the beginning, followed by a name for the library and then the .SO file extension. Some shared library files also have other numbers appended to the end after «.SO» to indicate a version number.
Here are just a few examples: libdaemon.SO.14, libchromeXvMC.SO.0, libecal-1.2.SO.100, libgdata.SO.2, and libgnome-bluetooth.SO.4.0.1.
The number at the end allows there to be multiple versions of the same file without causing issues with overlapping names. These files are normally stored in /lib/ or /usr/lib/.
On an Android device, SO files are stored within the APK under /lib//. Here, «ABI» can be a folder called armeabi, armeabi-v7a, arm64-v8a, mips, mips64, x86, or x86_64. The SO files within the correct folder that pertains to the device, are what’s used when the apps are installed via the APK file.
Shared library files are sometimes called dynamically linked shared object libraries, shared objects, shared libraries, and shared object libraries.
.SO File Extension
An SO file is a shared library used by programs installed on the Linux and Android operating systems. It contains common program functions and logic that multiple programs require access to. SO files allow programs to access common functions from one shared place in a computer’s system memory, rather than implementing their own versions of the functions. This streamlines the programs’ structure as well as their interaction with users’ operating systems.
Much like Windows .DLL files, SO files are saved in a specific place in a user’s file system and «dynamically linked» to programs at runtime, meaning they are loaded only when needed. When a program needs to perform a common function stored in an SO file, it calls that SO file, relying on the fact that the SO file has a specific name and is stored in a specific location. If the function is linked to other SO files, the program also calls the linked SO files.
SO files often reside in the following Linux directories:
C and C++ programs installed on the Linux and Android operating systems most commonly use SO files. Developers often build SO files using the «gcc» C/C++ compiler included in the GNU Compiler Collection (GCC).
How to open a SO file
SO files are not meant to be opened. Also, in most cases, you should not move or rename an SO file, as programs require SO files to have specific names and reside in specific locations to call them.
Advanced Linux users can use the command nm -D path/to/filename.so.# to view a list of the functions an SO file contains.
How to open the files with the extension («.so») [closed]
How to open the files with the extension («.so») like libphpcpp.so and («ELF») format file in editor for editing?
probably with Hex Editor like Bless but if you change the files that are not meant to be changed, then things can happen
2 Answers 2
.so files are «Shared Libraries» (https://en.wikipedia.org/wiki/Library_(computing)#Shared_libraries), they are binary-files meant to be dynamically linked to an executable and as such are unusable on their own.
A Library is a collection of related functions and reusable resources to be used by software applications. Shared-libraries are linked at runtime (dynamic linking) as opposed to compile-time hence their name.
If you want to open a shared-library file, you would open it like any other binary file — with a hex-editor (also called a binary-editor). There are several hex-editors in the standard repositories such as GHex (https://packages.ubuntu.com/xenial/ghex) or Bless (https://packages.ubuntu.com/xenial/bless). The same can be done for ELF executables.
You can install either of them with the following command(s):
But bear in mind though, shared-objects (.so files) are binary files and therefore aren’t meant to be edited manually; you might be able to edit a few strings or values with a hex-editor but you won’t be able to do much since they are unusable on their own.
Thread: how to read .so file in ubuntu
Spilled the Beans
how to read .so file in ubuntu
hi every one,
I am again face a problem. According your suggestion i can convert a .c file to .so file and tell me in which way i can open that .so file i.e. i want to see what will be the code after creating my .so file. I will be highly obliged if any one can give me more information .so file related.
A Carafe of Ubuntu
Re: how to read .so file in ubuntu
.so file is a shared library. It is not directly usable. It is fed into the linker when linking your programs.
#include #include»foo.h» void foo(void)
#ifndef __foo_h # define __foo_h # ifdef __cplusplus extern "C" < # endif void foo(void); # ifdef __cplusplus ># endif #endif
$ cc -std=c99 -fPIC -c foo.c -o foo.o # preprocess, compile, assemble foo.c to yield object file foo.o $ cc -shared -Wl,-soname,libfoo.so.1 foo.o -o libfoo.so.1.0.0 # link foo.o to yield shared object libfoo.so.1.0.0 $ ln -s libfoo.so.1.0.0 libfoo.so.1 $ ln -s libfoo.so.1 libfoo.so # libfoo.so.1 is needed for run-time linking, libfoo.so is needed for compile-time linking
# cp foo.h /usr/local/include # cp -a libfoo.so* /usr/local/lib # chown root:root /usr/local/lib/libfoo.so* /usr/local/include/foo.h # ldconfig
$ nm /usr/local/lib/libfoo.so | grep ' T '
0000000000000648 T _fini 00000000000004e8 T _init 00000000000005fc T foo
The first 2 are added by the linker, the last one is the one that comes from the object code.
To build an application against this library:
#include // note that foo.h is now a standard header int main(void)
$ cc -std=c99 test.c -lfoo -o test # /usr/local/lib/libfoo.so is used $ ./test # /usr/local/lib/libfoo.so.1 is used
linux-vdso.so.1 => (0x00007fffbc9d9000) libfoo.so.1 => /usr/local/lib/libfoo.so.1 (0x00002b82fa537000) libc.so.6 => /lib/libc.so.6 (0x00002b82fa739000) /lib64/ld-linux-x86-64.so.2 (0x00002b82fa317000)
U __libc_start_main@@GLIBC_2.2.5 U foo
In this place, __libc_start_main@@GLIBC_2.2.5 is a symbol defined by the C library, foo is a symbol defined by our shared library. It is completed by loading /usr/local/lib/libfoo.so.1 at runtime.
Spilled the Beans
Re: how to read .so file in ubuntu
Originally Posted by miklcct
.so file is a shared library. It is not directly usable. It is fed into the linker when linking your programs.
#include #include»foo.h» void foo(void)
#ifndef __foo_h # define __foo_h # ifdef __cplusplus extern "C" < # endif void foo(void); # ifdef __cplusplus ># endif #endif
$ cc -std=c99 -fPIC -c foo.c -o foo.o # preprocess, compile, assemble foo.c to yield object file foo.o $ cc -shared -Wl,-soname,libfoo.so.1 foo.o -o libfoo.so.1.0.0 # link foo.o to yield shared object libfoo.so.1.0.0 $ ln -s libfoo.so.1.0.0 libfoo.so.1 $ ln -s libfoo.so.1 libfoo.so # libfoo.so.1 is needed for run-time linking, libfoo.so is needed for compile-time linking
# cp foo.h /usr/local/include # cp -a libfoo.so* /usr/local/lib # chown root:root /usr/local/lib/libfoo.so* /usr/local/include/foo.h # ldconfig
$ nm /usr/local/lib/libfoo.so | grep ' T '
0000000000000648 T _fini 00000000000004e8 T _init 00000000000005fc T foo
The first 2 are added by the linker, the last one is the one that comes from the object code.
To build an application against this library:
#include // note that foo.h is now a standard header int main(void)
$ cc -std=c99 test.c -lfoo -o test # /usr/local/lib/libfoo.so is used $ ./test # /usr/local/lib/libfoo.so.1 is used
linux-vdso.so.1 => (0x00007fffbc9d9000) libfoo.so.1 => /usr/local/lib/libfoo.so.1 (0x00002b82fa537000) libc.so.6 => /lib/libc.so.6 (0x00002b82fa739000) /lib64/ld-linux-x86-64.so.2 (0x00002b82fa317000)
U __libc_start_main@@GLIBC_2.2.5 U foo
In this place, __libc_start_main@@GLIBC_2.2.5 is a symbol defined by the C library, foo is a symbol defined by our shared library. It is completed by loading /usr/local/lib/libfoo.so.1 at runtime.
Thanks for your help. Since i am new in ubuntu so there arise few questions. These are as follows:
1) In your comments you wrote foo.h. Now my question is whether it is (filename.h) necessary or not.
2) If you know any URL link on .so file related please post here for developing my knowledge on Ubuntu and .so file related.
A Carafe of Ubuntu
Re: how to read .so file in ubuntu
The source codes contain .c and .h files. To convert a .c file to a .so file, the compiler actually performs 4 steps:
- Run cpp to generate .i file from .c file (Preprocessing)
- Run cc1 to generate .s file from .i file (Compiling)
- Run as to generate .o file from .s file (Assembling)
- Run ld to generate .so file from .o file(s) (Linking) (A shared object can contain more than 1 .o files)
The .h file is needed in the cpp stage. When you distribute a binary image of the library, only the .so.a and .so.a.b.c (where .a.b.c is the version number) is needed. When you distribute the development files of the library, the .so and .h files is needed. Normally, .so.a and .so.a.b.c is placed in /usr/lib, for essential libraries (needed for programs in /bin), they are placed in /lib. The .so file is placed in /usr/lib and the .h file is placed in /usr/include. There may be some additional files (like libtool, pkg-config) but they are not relevant to the topic. Local-installed libraries by hand (out of package management) are normally installed in /usr/local/.