I have built openssl-0.9.8k and am trying to link libcrypto.a statically with 
my project. I think libcrypto.a contains contains non-relocatable functions
For example, consider the following:
#include <openssl/des.h>
void foo(void) {
            DES_encrypt3(NULL, NULL, NULL, NULL);
            AES_encrypt(NULL, NULL);
}

$ gcc -fPIC -o libfoo.so -shared foo.c /usr/lib/libcrypto.a
$ eu-findtextrel libfoo.so 
the file containing the function 'DES_encrypt3' is not compiled with -fpic/-fPIC
the file containing the function 'DES_decrypt3' is not compiled with -fpic/-fPIC
the file containing the function 'DES_ncbc_encrypt' is not compiled with 
-fpic/-fPIC
the file containing the function 'DES_ede3_cbc_encrypt' is not compiled with 
-fpic/-fPIC

This does not happen on 64bit system and eu-findtextrel reports on text 
relocations. I think this is the default behavior on 32 bit systems. 

Can someone point me to why building static libs on 32 bit system with fPIC is 
a bad idea?
Also, if I want to build the static lib with fPIC, how do I go about it? All 
the .o files are built with fPIC.


      
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to