This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: add -retain-symbols-file support to gold


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]