While building a particular module, I get the below error:
ld: 0711-317 ERROR: Undefined symbol: .MD5_Init
ld: 0711-317 ERROR: Undefined symbol: .SHA1_Init
ld: 0711-317 ERROR: Undefined symbol: .SHA224_Init
ld: 0711-317 ERROR: Undefined symbol: .SHA256_Init
ld: 0711-317 ERROR: Undefined symbol: .SHA384_Init
ld: 0711-317 ERROR: Undefined symbol: .SHA512_Init
ld: 0711-317 ERROR: Undefined symbol: .SHA1_Update
ld: 0711-317 ERROR: Undefined symbol: .SHA1_Final
ld: 0711-317 ERROR: Undefined symbol: .SHA224_Update
ld: 0711-317 ERROR: Undefined symbol: .SHA224_Final
ld: 0711-317 ERROR: Undefined symbol: .SHA256_Update
ld: 0711-317 ERROR: Undefined symbol: .SHA256_Final
ld: 0711-317 ERROR: Undefined symbol: .SHA384_Update
ld: 0711-317 ERROR: Undefined symbol: .SHA384_Final
ld: 0711-317 ERROR: Undefined symbol: .SHA512_Update
ld: 0711-317 ERROR: Undefined symbol: .SHA512_Final
ld: 0711-317 ERROR: Undefined symbol: .MD5_Update
ld: 0711-317 ERROR: Undefined symbol: .MD5_Final
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make: *** [entity_test] Error 8
I see that these symbols come from openssl's libcrypto.a library:-
$ nm openssl-1.0.2f/libcrypto.so|grep SHA512_Final
.SHA512_Final T 448
SHA512_Final D 3088 24
SHA512_Final d 2976 8
.SHA512_Final U -
I have exported LIBPATH=:$LIBPATH and built with -lcrypto option. However from the dump output, I still do not find the libcrypto.so from openssl being used from ldd output.
ldd lru_test
lru_test needs:
/cb/cb10b/rel/server/lib/libexpat.so
/usr/lib/libpthread.a(shr_xpg5_64.o)
/usr/lib/libiconv.a(shr4_64.o)
/cb/cb10b/rel/server/lib/liblog4cxx.so
/usr/lib/libC.a(shr_64.o)
/usr/lib/libC.a(shr2_64.o)
/usr/lib/libC.a(shr3_64.o)
/usr/lib/libC.a(ansi_64.o)
/usr/lib/libc.a(shr_64.o)
/unix
/usr/lib/libaprutil-1.so
/usr/lib/libapr-1.so
/usr/lib/libC.a(shrcore_64.o)
/usr/lib/libC.a(ansicore_64.o)
/usr/lib/libcrypt.a(shr_64.o)
/usr/lib/libexpat.a(libexpat.so.1)
/usr/lib/libiconv.a(libiconv.so.2)
ar: 0707-109 Member name libiconv.so.2 does not exist.
dump: /tmp/tmpdir22282828/extract/libiconv.so.2: 0654-106 Cannot open the specified file.
/usr/lib/libc.a(shr.o)
/usr/lib/libpthread.a(shr_xpg5.o)
/usr/lib/libcrypt.a(shr.o)
/usr/lib/libpthreads.a(shr_comm.o)
$ dump -H -X32_64 lru_test
lru_test:
***Loader Section***
Loader Header Information
VERSION# #SYMtableENT #RELOCent LENidSTR
0x00000001 0x00000117 0x000023b0 0x00000139
#IMPfilID OFFidSTR LENstrTBL OFFstrTBL
0x0000000a 0x00025560 0x00001d5a 0x00025699
***Import File Strings***
INDEX PATH BASE MEMBER
0 /cb/cb10b/cb/server/lib:/cb/cb10b/rel/server/lib:/opt/IBM/xlmass/8.1.2/lib/aix61:/opt/IBM/xlc/13.1.2/lib:/opt/IBM/xlC/13.1.2/lib:/usr/lib:/lib
1 libexpat.so
2 libpthread.a shr_xpg5_64.o
3 libiconv.a shr4_64.o
4 liblog4cxx.so
5 libC.a shr_64.o
6 libC.a shr2_64.o
7 libC.a shr3_64.o
8 libC.a ansi_64.o
9 libc.a shr_64.o
While the build has passed, the output from ldd still is quite perplexing. 1. Why does libcrypto.so not appear as a dependency in ldd? 2. However, how is the dependency for the symbols listed above being resolved by the linker?
User contributions licensed under CC BY-SA 3.0