Discussion:
Linking error on Soalris x86 and sparc using fips capable openssl 1.0.1h
Mrunal Nerpawar
2014-09-12 09:33:39 UTC
Permalink
Hi All,

While fips build on soalris, I am getting variour errors:

Sun-Intel:

FIPSLD_CC=gcc FIPSLD_LINK=g++
/unixhome/upg/Unix/SunOS/i386/OpenSource/ssl-1.0.1h/bin/fipsld -fPIC
-shared -g -O2 -o libImpl.so.10.0.0 -lcrypto
Text relocation remains referenced
against symbol offset in file
fips_openssl_cpuid_setup 0x1
/unixhome/upg/Unix/SunOS/i386/OpenSource/ssl-1.0.1h/bin/../lib/fipscanister.o
ld: fatal: relocations remain against allocatable but non-writable sections
collect2: ld returned 1 exit status

after searching on net came to know that the option -fPIC should be used to
fix this error and is used to build fipscanister.o as well as for the
project where this is being used.
Also read about using -Wl, -Bsymbolic, this removes above error, but fails
for many other symbols.
Any idea why the symbols are not being relocated?


Sun-sparc:

For the above same linking on sparc, I got following error:
4280524028:error:25066067:DSO support routines:DLFCN_LOAD:could not load
the shared
library:dso_dlfcn.c:187:filename(./objs/SunOS-5.10-sparc-32/libImpl.so.10.0.0):
ld.so.1: fips_premain_dso: fatal: relocation error: file
./objs/SunOS-5.10-sparc-32/libImpl.so.10.0.0: symbol
_ZNSt8__detail15_List_node_base7_M_hookEPS0_: referenced symbol not found
4280524028:error:25070067:DSO support routines:DSO_load:could not load the
shared library:dso_lib.c:244:
make: *** [objs/SunOS-5.10-sparc-32/libImpl.so.10.0.0] Error 1

Any help would be much appreciated.

Regards,
Mrunal
Gaiseric Vandal
2014-09-12 15:50:28 UTC
Permalink
I hate compiling stuff on Solaris 10. The gcc version in /usr/sfw/bin is
so old. And it uses the Solaris linker in /usr/ccs/bin if if you use
/usr/sfw/bin/gmake instead of /usr/ccs/bin/make. Sometimes I can
work around issues by renaming /usr/ccs/bin/ld and creating a symlink
ld-> /usr/sfw/bin/gld.


Sometimes that works. Sometimes it doesn't.. I don't know about
openssl, but for some other things I had to rebuild recently I had to
rebuild gcc and other gnu tools (make, ld etc) first,and them recompile
the software I wanted to update.


its hugely frustrating that oracle no longer provides updated builds of
common opensource tools for Solaris 10. And installing blastwave
doubles the amount of disk space and possible path conflicts.
Post by Mrunal Nerpawar
Hi All,
FIPSLD_CC=gcc FIPSLD_LINK=g++
/unixhome/upg/Unix/SunOS/i386/OpenSource/ssl-1.0.1h/bin/fipsld -fPIC
-shared -g -O2 -o libImpl.so.10.0.0 -lcrypto
Text relocation remains referenced
against symbol offset in file
fips_openssl_cpuid_setup 0x1
/unixhome/upg/Unix/SunOS/i386/OpenSource/ssl-1.0.1h/bin/../lib/fipscanister.o
ld: fatal: relocations remain against allocatable but non-writable sections
collect2: ld returned 1 exit status
after searching on net came to know that the option -fPIC should be
used to fix this error and is used to build fipscanister.o as well as
for the project where this is being used.
Also read about using -Wl, -Bsymbolic, this removes above error, but
fails for many other symbols.
Any idea why the symbols are not being relocated?
4280524028:error:25066067:DSO support routines:DLFCN_LOAD:could not
load the shared
ld.so.1: fips_premain_dso: fatal: relocation error: file
./objs/SunOS-5.10-sparc-32/libImpl.so.10.0.0: symbol
_ZNSt8__detail15_List_node_base7_M_hookEPS0_: referenced symbol not found
4280524028:error:25070067:DSO support routines:DSO_load:could not load
make: *** [objs/SunOS-5.10-sparc-32/libImpl.so.10.0.0] Error 1
Any help would be much appreciated.
Regards,
Mrunal
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users-MCmKBN63+***@public.gmane.org
Automated List Manager majordomo-MCmKBN63+***@public.gmane.org
Andy Polyakov
2014-09-14 19:10:10 UTC
Permalink
Post by Mrunal Nerpawar
FIPSLD_CC=gcc FIPSLD_LINK=g++
/unixhome/upg/Unix/SunOS/i386/OpenSource/ssl-1.0.1h/bin/fipsld -fPIC
-shared -g -O2 -o libImpl.so.10.0.0 -lcrypto
Text relocation remains referenced
against symbol offset in file
fips_openssl_cpuid_setup 0x1
/unixhome/upg/Unix/SunOS/i386/OpenSource/ssl-1.0.1h/bin/../lib/fipscanister.o
ld: fatal: relocations remain against allocatable but non-writable sections
collect2: ld returned 1 exit status
after searching on net came to know that the option -fPIC should be used
to fix this error and is used to build fipscanister.o as well as for the
project where this is being used.
FIPS module version 2 is compiled with -fPIC unconditionally. So
question is what is that about. I mean why did you need to do something?
Post by Mrunal Nerpawar
Also read about using -Wl, -Bsymbolic, this removes above error, but
fails for many other symbols.
Such as? Essentially -Bsymbolic is a must for FIPS code.
Post by Mrunal Nerpawar
4280524028:error:25066067:DSO support routines:DLFCN_LOAD:could not load
the shared
ld.so.1: fips_premain_dso: fatal: relocation error: file
./objs/SunOS-5.10-sparc-32/libImpl.so.10.0.0: symbol
_ZNSt8__detail15_List_node_base7_M_hookEPS0_: referenced symbol not found
4280524028:error:25070067:DSO support routines:DSO_load:could not load
make: *** [objs/SunOS-5.10-sparc-32/libImpl.so.10.0.0] Error 1
Looks like something for you to figure out, as the symbol in question
can't be from FIPS module. It seems to be something from libstdc++, so
question is if libImpl.so was linked with it and if so, why it can't be
found at that moment.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List openssl-***@openssl.org
Automated List Manager ***@openssl.org
Mrunal Nerpawar
2014-09-17 06:18:51 UTC
Permalink
Thanks all for the help.

I could resolve both the errors:

Sun-Intel : using -Wl, -Bsymbolic and resolving few other linking errors.
Sun-sparc : Re-building libstdc++ all the errors gone away.

Thanks again Andy for pointing it out.

Regards,
Mrunal
Post by Mrunal Nerpawar
Post by Mrunal Nerpawar
FIPSLD_CC=gcc FIPSLD_LINK=g++
/unixhome/upg/Unix/SunOS/i386/OpenSource/ssl-1.0.1h/bin/fipsld -fPIC
-shared -g -O2 -o libImpl.so.10.0.0 -lcrypto
Text relocation remains referenced
against symbol offset in file
fips_openssl_cpuid_setup 0x1
/unixhome/upg/Unix/SunOS/i386/OpenSource/ssl-1.0.1h/bin/../lib/fipscanister.o
Post by Mrunal Nerpawar
ld: fatal: relocations remain against allocatable but non-writable
sections
Post by Mrunal Nerpawar
collect2: ld returned 1 exit status
after searching on net came to know that the option -fPIC should be used
to fix this error and is used to build fipscanister.o as well as for the
project where this is being used.
FIPS module version 2 is compiled with -fPIC unconditionally. So
question is what is that about. I mean why did you need to do something?
Post by Mrunal Nerpawar
Also read about using -Wl, -Bsymbolic, this removes above error, but
fails for many other symbols.
Such as? Essentially -Bsymbolic is a must for FIPS code.
Post by Mrunal Nerpawar
4280524028:error:25066067:DSO support routines:DLFCN_LOAD:could not load
the shared
ld.so.1: fips_premain_dso: fatal: relocation error: file
./objs/SunOS-5.10-sparc-32/libImpl.so.10.0.0: symbol
_ZNSt8__detail15_List_node_base7_M_hookEPS0_: referenced symbol not found
4280524028:error:25070067:DSO support routines:DSO_load:could not load
make: *** [objs/SunOS-5.10-sparc-32/libImpl.so.10.0.0] Error 1
Looks like something for you to figure out, as the symbol in question
can't be from FIPS module. It seems to be something from libstdc++, so
question is if libImpl.so was linked with it and if so, why it can't be
found at that moment.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Loading...