This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Question on ld and --exclude-libs
- From: Jeffrey Walton <noloader at gmail dot com>
- To: binutils at sourceware dot org
- Date: Tue, 13 Sep 2011 01:26:52 -0400
- Subject: Question on ld and --exclude-libs
- Reply-to: noloader at gmail dot com
Hi All,
I hope this is the last question. Thanks for bearing with me.
>From ld/ChangeLog-0203, it appears --exclude-libs first appeared
(Smith's 05/2002 comments).
In ld/ChangeLog-2004, it appears --exclude-libs was tuned (and the PE
target was removed) (Jacobowitz's 10/2004 comments).
Conservatively, I believe that makes --exclude-libs available in Binutils 2.12.
I'm trying to hide as many symbols as possible
(http://gcc.gnu.org/wiki/Visibility), and I'm using --exclude-libs,ALL
as part of the procedure:
GNU_LD212_OR_LATER = $(shell $(LD) -v 2>&1 \
| $(EGREP) -i -c "^gnu ld version (2.1[2-9]|[2-9][0-9])")
...
ifneq ($(GNU_LD212_OR_LATER),0)
LDFLAGS += -Wl,--exclude-libs,ALL
endif
FreeBSD 8.2 results:
$ ld --version
GNU ld version 2.15 [FreeBSD] 2004-05-23
$ gmake
g++ -g2 -ggdb -O0 <SNIP Objects> -L/usr/local/lib -L/usr/lib
-Wl,-z,nodlopen -Wl,--exclude-libs,ALL -Wl,-z,relro -Wl,-z,now -shared
-lcryptopp
/usr/bin/ld: unrecognized option '--exclude-libs'
/usr/bin/ld: use the --help option for usage information
Question: FreeBSD's ld is 2.15, so it should contain --exclude-libs.
Can anyone pinpoint where I went wrong? Or should I focus on using
--exclude_libs with -fvisibility (since that's what I am using it
for), and target a Binutils from the GCC 4.0 era (to side step the
FreeBSD issue).
Thanks in advance,
Jeff