This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: add -retain-symbols-file support to gold
- From: Ian Lance Taylor <iant at google dot com>
- To: csilvers at google dot com (Craig Silverstein)
- Cc: binutils at sourceware dot org
- Date: Wed, 16 Sep 2009 09:49:47 -0700
- Subject: Re: PATCH: add -retain-symbols-file support to gold
- References: <20090915201127.DED8B18E2BD@meta.mtv.corp.google.com>
csilvers@google.com (Craig Silverstein) writes:
> * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
> * options.cc: Include <cerrno> and <fstream>.
> (General_options::finalize): Parse -retain-symbols-file tag.
> * options.h: New flag.
> (General_options): New method should_retain_symbol, new
> variable symbols_to_retain.
> * symtab.cc (Symbol_table::sized_finalize_symbol): Test
> should_retain_symbol map.
> * testsuite/Makefile.am (retain_symbols_file_test): New test.
> * testsuite/Makefile.in: Regenerate.
> * testsuite/retain_symbols_file_test.sh: New file.
> +# Test -retain-symbols-file.
> +check_SCRIPTS += retain_symbols_file_test.sh
> +MOSTLYCLEANFILES += retain_symbols_file_test retain_symbols_file_test.in \
> + retain_symbols_file_test.out
> +retain_symbols_file_test.so: basic_pic_test.o
> + echo 'main' >> retain_symbols_file_test.in
> + echo 't1' >> retain_symbols_file_test.in
> + echo '_ZN4t16bC1Ev' >> retain_symbols_file_test.in
> + echo '_ZNK4t20a3getEv' >> retain_symbols_file_test.in
> + echo '_Z3t18v' >> retain_symbols_file_test.in
> + echo '__tcf_0' >> retain_symbols_file_test.in
> + $(CXXLINK) -Bgcctestdir/ -shared -Wl,-retain-symbols-file,retain_symbols_file_test.in basic_pic_test.o
> +retain_symbols_file_test.out: retain_symbols_file_test.so
> + $(TEST_NM) -C retain_symbols_file_test.so > $@
The retain_symbols_file_test.so target should depend upon gcctestdir/ld.
I think the first line writing to retain_symbols_file_test.in should use
> rather than >>.
> +# retain_symbols_file_test.sh -- a test case for -retain-symbols-file
> +
> +# Copyright 2009 Free Software Foundation, Inc.
> +# Written by Cary Coutant <ccoutant@google.com>.
Wrong author?
OK with those changes.
Thanks.
Ian