[SATLUG] Creating a binary.....
esanchezvela.satlug at gmail.com
Wed Mar 7 20:34:36 CST 2012
On Tue, Mar 6, 2012 at 3:10 PM, Bruce Dubbs <bruce.dubbs at gmail.com> wrote:
> Enrique Sanchez wrote:
>> You don't understand what a dynamic library is. The -lcrypto and -lssl
> switches say to link with the appropriate library
> lrwxrwxrwx 18 Oct 14 /usr/lib/libcrypto.so -> libcrypto.so.1.0.0
> -r-xr-xr-x 2015595 Oct 14 /usr/lib/libcrypto.so.1.0.0
> lrwxrwxrwx 15 Oct 14 /usr/lib/libssl.so -> libssl.so.1.0.0
> -r-xr-xr-x 415747 Oct 14 /usr/lib/libssl.so.1.0.0
> To link into a new version, you just change the library and the loader
> does the rest. You do not have to relink the application.
> If you have both a .so and a .a library, the liker uses the .so dynamic
> library by default.
> -- Bruce
You have a point here, my poor understanding of dynamic linking was that
the compiler instead of generating a big executable would only create an
executable without the required libraries in the file and whenever the
library was needed the OS or loader would load from the .so file found in
the library search path, for example, on a RH 5.2, I got libcrypto.so.4, on
a RH 5.6, I have libcrypto.so.6 and I bet that there is at least 1 server
with libcrypto.so.8 out there.
In short, what I am trying to accomplish is to create an executable using
ld, anyone knows whether this is possible or not?
thank you in advance,
btw..this has hit the curiosity field now, I've solved my problem using a
statically linked binary.
More information about the SATLUG