ld --exclude-libs

BERTRAND Joël joel.bertrand@systella.fr
Thu Sep 29 07:53:00 GMT 2016


	Hello,

	I'm trying to use --exclude-libs without any success. Only 
--eclude-libs ALL works as expected. I suppose I have done a mistake but 
I'm unable to fix it.

	More exactly, I have to remove from an static executable all OpenSSL 
symboles. Thus, I have written :

g++ -g -O2 -malign-double -mieee-fp -Wall -funsigned-char -g 
-Wl,--export-dynamic 
-Wl,--exclude-libs,../tools/openssl-1.1.0b/libcrypto.a:../tools/openssl-1.1.0b/libssl.a 
-o rpl <all .o> <all .a>

	Last command invoques ld and creates rpl executable, but this 
executable contains all symbols contained in both libcrypto.a and libssl.a :
schroedinger:[~/cvs/build/src] > readelf --syms -D rpl | grep SSL
  1348 334: 0000000000825070    43 FUNC    GLOBAL DEFAULT  14 OPENSSL_sk_set
  1444 413: 000000000083fb80   161 FUNC    GLOBAL DEFAULT  14 
OPENSSL_showfatal
  1457 429: 00000000008908c0   476 FUNC    GLOBAL DEFAULT  14 
OPENSSL_utf82uni
  1555 506: 0000000000890aa0   572 FUNC    GLOBAL DEFAULT  14 
OPENSSL_uni2utf8
  1956 852: 00000000008528a0     7 FUNC    GLOBAL DEFAULT  14 
OPENSSL_LH_error
  2057 934: 0000000000824da0   180 FUNC    GLOBAL DEFAULT  14 OPENSSL_sk_dup
  2283 1154: 0000000000852090   116 FUNC    GLOBAL DEFAULT  14 
OPENSSL_LH_strhash
  2569 1377: 0000000001e5d874     4 OBJECT  GLOBAL DEFAULT  30 
OPENSSL_NONPIC_relocated
...

	Where is my mistake ?

	Best regards,

	JB



More information about the Binutils mailing list