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]

PATCH COMMITTED: Use new binutils for gold testing, test strip


I discovered that an older version of binutils strip, pre 2.17, failed
to work correctly on x86_64 binaries linked by gold, due to a
disagreement about the expected page size.  That has been fixed for a
while, but I thought it would be a good idea to add a test that strip
works with gold.

I also patched up the testsuite to use the newly built binutils,
rather than whatever is installed on the system.

Ian


2008-04-07  Ian Lance Taylor  <iant@google.com>

	* configure.ac: Don't test for objdump, c++filt, or readelf.
	* testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
	conditionals.
	(TEST_READELF): New variable.
	(TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
	(check_PROGRAMS): Add two_file_strip_test.
	(two_file_strip_test): New target.
	(check_PROGRAMS): Add two_file_same_shared_strip_test.
	(two_file_same_shared_strip_test_SOURCES): New variable.
	(two_file_same_shared_strip_test_DEPENDENCIES): New variable.
	(two_file_same_shared_strip_test_LDFLAGS): New variable.
	(two_file_same_shared_strip_test_LDADD): New variable.
	(two_file_shared_strip.so): New target.
	(ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
	(ver_test_5.syms, ver_test_7.syms): Likewise.
	(ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
	(strip_test_3.stdout): Use TEST_OBJDUMP.
	* configure, Makefile.in, testsuite/Makefile.in: Rebuild.


Index: configure.ac
===================================================================
RCS file: /cvs/src/src/gold/configure.ac,v
retrieving revision 1.26
diff -u -r1.26 configure.ac
--- configure.ac	28 Mar 2008 22:42:34 -0000	1.26
+++ configure.ac	7 Apr 2008 22:09:45 -0000
@@ -186,10 +186,6 @@
 AM_CONDITIONAL(NATIVE_LINKER,
   test "x$target_alias" = "x" -o "x$host_alias" = "x$target_alias")
 AM_CONDITIONAL(GCC, test "$GCC" = yes)
-AM_CONDITIONAL(OBJDUMP_AND_CPPFILT,
-	[objdump --help >/dev/null && c++filt --help >/dev/null])
-AM_CONDITIONAL(READELF,
-	[readelf --help >/dev/null])
 
 dnl Some architectures do not support taking pointers of functions
 dnl defined in shared libraries except in -fPIC mode.  We need to
Index: testsuite/Makefile.am
===================================================================
RCS file: /cvs/src/src/gold/testsuite/Makefile.am,v
retrieving revision 1.55
diff -u -r1.55 Makefile.am
--- testsuite/Makefile.am	4 Apr 2008 17:24:47 -0000	1.55
+++ testsuite/Makefile.am	7 Apr 2008 22:09:45 -0000
@@ -17,6 +17,11 @@
 	-DLOCALEDIR="\"$(datadir)/locale\"" \
 	@INCINTL@
 
+TEST_READELF = $(top_builddir)/../binutils/readelf
+TEST_OBJDUMP = $(top_builddir)/../binutils/objdump
+TEST_CXXFILT = $(top_builddir)/../binutils/cxxfilt
+TEST_STRIP = $(top_builddir)/../binutils/strip-new
+
 if THREADS
 THREADSLIB = -lpthread
 endif
@@ -277,6 +282,19 @@
 
 endif FN_PTRS_IN_SO_WITHOUT_PIC
 
+check_PROGRAMS += two_file_strip_test
+two_file_strip_test: two_file_test
+	$(TEST_STRIP) -o two_file_strip_test two_file_test
+
+check_PROGRAMS += two_file_same_shared_strip_test
+two_file_same_shared_strip_test_SOURCES = two_file_test_main.cc
+two_file_same_shared_strip_test_DEPENDENCIES = \
+	gcctestdir/ld two_file_shared_strip.so
+two_file_same_shared_strip_test_LDFLAGS = -Bgcctestdir/ -Wl,-R.
+two_file_same_shared_strip_test_LDADD = two_file_shared_strip.so
+two_file_shared_strip.so: two_file_shared.so
+	$(TEST_STRIP) -S -o two_file_shared_strip.so two_file_shared.so
+
 check_PROGRAMS += common_test_1
 common_test_1_SOURCES = common_test_1.c
 common_test_1_DEPENDENCIES = gcctestdir/ld
@@ -568,21 +586,15 @@
 ver_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
 ver_test_2_LDADD = ver_test_4.so ver_test_2.so
 
-if READELF
-
 check_SCRIPTS += ver_test_2.sh
 check_DATA += ver_test_2.syms
 ver_test_2.syms: ver_test_2
-	readelf -s $< >$@ 2>/dev/null
+	$(TEST_READELF) -s $< >$@ 2>/dev/null
 
 check_SCRIPTS += ver_test_4.sh
 check_DATA += ver_test_4.syms
 ver_test_4.syms: ver_test_4.so
-	readelf -s $< >$@ 2>/dev/null
-
-endif
-
-if READELF
+	$(TEST_READELF) -s $< >$@ 2>/dev/null
 
 ver_test_5.so: ver_test_5.o $(srcdir)/ver_test_5.script ver_test_4.so gcctestdir/ld
 	$(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_5.script ver_test_5.o ver_test_4.so
@@ -591,9 +603,7 @@
 check_SCRIPTS += ver_test_5.sh
 check_DATA += ver_test_5.syms
 ver_test_5.syms: ver_test_5.so
-	readelf -s $< >$@ 2>/dev/null
-
-endif
+	$(TEST_READELF) -s $< >$@ 2>/dev/null
 
 check_PROGRAMS += ver_test_6
 ver_test_6_SOURCES = ver_test_6.c
@@ -601,8 +611,6 @@
 ver_test_6_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
 ver_test_6_LDADD = ver_test_2.so
 
-if READELF
-
 ver_test_7.so: ver_test_4.o $(srcdir)/ver_test_4.script ver_test_7.o gcctestdir/ld
 	$(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o ver_test_7.o
 ver_test_7.o: ver_test_7.cc
@@ -610,9 +618,7 @@
 check_SCRIPTS += ver_test_7.sh
 check_DATA += ver_test_7.syms
 ver_test_7.syms: ver_test_7.so
-	readelf -s $< >$@ 2>/dev/null
-
-endif
+	$(TEST_READELF) -s $< >$@ 2>/dev/null
 
 check_PROGRAMS += script_test_1
 script_test_1_SOURCES = script_test_1.cc
@@ -643,14 +649,13 @@
 	rm -f $@
 	$(LN_S) $< $@
 
-if OBJDUMP_AND_CPPFILT
 check_SCRIPTS += ver_matching_test.sh
 check_DATA += ver_matching_test.stdout
 MOSTLYCLEANFILES += ver_matching_test.stdout
 ver_matching_def.so: ver_matching_def.cc gcctestdir/ld
 	$(CXXLINK) -O0 -Bgcctestdir/ -shared $(srcdir)/ver_matching_def.cc -Wl,--version-script=$(srcdir)/version_script.map
 ver_matching_test.stdout: ver_matching_def.so
-	objdump -T ver_matching_def.so | c++filt > ver_matching_test.stdout
+	$(TEST_OBJDUMP) -T ver_matching_def.so | $(TEST_CXXFILT) > ver_matching_test.stdout
 
 check_PROGRAMS += script_test_3
 check_SCRIPTS += script_test_3.sh
@@ -659,8 +664,7 @@
 script_test_3: basic_test.o gcctestdir/ld script_test_3.t
 	$(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_3.t
 script_test_3.stdout: script_test_3
-	objdump -p script_test_3 > script_test_3.stdout
-endif OBJDUMP_AND_CPPFILT
+	$(TEST_OBJDUMP) -p script_test_3 > script_test_3.stdout
 
 endif GCC
 endif NATIVE_LINKER

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