This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
ld --exclude-libs
- From: BERTRAND Joël <joel dot bertrand at systella dot fr>
- To: binutils at sourceware dot org
- Date: Thu, 29 Sep 2016 09:53:43 +0200
- Subject: ld --exclude-libs
- Authentication-results: sourceware.org; auth=none
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