This is the mail archive of the 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]

gold patch committed: Add -z notext, use it in testsuite

One of the gold tests fails on Solaris because on Solaris gcc passes -z
text when using -shared.  The GNU linker does not support -z text and
simply ignores it (as is true of all unrecognized -z options).  Gold
does support -z text, which causes it to reject shared libraries with
dynamic relocations in the text segment.  Some of the tests are
specifically testing that that works, and those tests fails.  This patch
adds -z notext, which overrides a -z text appearing earlier on the
command line, and uses it for all tests which might need it.  Committed
to mainline.


2011-07-01  Ian Lance Taylor  <>

	PR gold/12525
	* options.h (class General_options): Support -z notext.
	* testsuite/ ( Use
	( Likewise.
	( Likewise.
	( Likewise.
	( Likewise.
	(alt/ Likewise.
	( Likewise.
	* testsuite/ Rebuild.

Index: options.h
RCS file: /cvs/src/src/gold/options.h,v
retrieving revision 1.162
diff -u -p -r1.162 options.h
--- options.h	1 Jul 2011 22:05:01 -0000	1.162
+++ options.h	2 Jul 2011 00:37:09 -0000
@@ -1170,7 +1170,7 @@ class General_options
 	      N_("Don't mark variables read-only after relocation"));
   DEFINE_bool(text, options::DASH_Z, '\0', false,
 	      N_("Do not permit relocations in read-only segments"),
-	      NULL);
+	      N_("Permit relocations in read-only segments (default)"));
   DEFINE_bool_alias(textoff, text, options::DASH_Z, '\0',
 		    N_("Permit relocations in read-only segments (default)"),
 		    NULL, true);
Index: testsuite/
RCS file: /cvs/src/src/gold/testsuite/,v
retrieving revision 1.169
diff -u -p -r1.169
--- testsuite/	2 Jul 2011 00:19:04 -0000	1.169
+++ testsuite/	2 Jul 2011 00:37:09 -0000
@@ -428,15 +428,15 @@ check_PROGRAMS += two_file_separate_shar
 check_PROGRAMS += two_file_mixed_shared_test
 check_PROGRAMS += two_file_mixed_2_shared_test two_file_test_1.o gcctestdir/ld
-	$(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o
+	$(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o -Wl,-z,notext two_file_test_2.o gcctestdir/ld
 	$(CXXLINK) -Bgcctestdir/ -shared two_file_test_2.o two_file_test_1.o two_file_test_1b.o two_file_test_2.o gcctestdir/ld
-	$(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o two_file_test_2.o
+	$(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o two_file_test_2.o -Wl,-z,notext two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o gcctestdir/ld
-	$(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o
+	$(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o -Wl,-z,notext two_file_test_1.o two_file_test_1b_pic.o gcctestdir/ld
-	$(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b_pic.o
+	$(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b_pic.o -Wl,-z,notext
 two_file_shared_1_nonpic_test_SOURCES = \
@@ -620,10 +620,10 @@ weak_undef_file1_nonpic.o: weak_undef_fi
 	$(CXXCOMPILE) -c -o $@ $< weak_undef_file1_nonpic.o
-	$(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1_nonpic.o
+	$(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1_nonpic.o -Wl,-z,notext
 alt/ weak_undef_file2_nonpic.o
 	test -d alt || mkdir -p alt
-	$(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2_nonpic.o
+	$(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2_nonpic.o -Wl,-z,notext
@@ -809,7 +809,7 @@ endif
 check_PROGRAMS += tls_shared_nonpic_test tls_test.o tls_test_file2.o tls_test_c.o gcctestdir/ld
-	$(CXXLINK) -Bgcctestdir/ -shared tls_test.o tls_test_file2.o tls_test_c.o
+	$(CXXLINK) -Bgcctestdir/ -shared tls_test.o tls_test_file2.o tls_test_c.o -Wl,-z,notext
 tls_shared_nonpic_test_SOURCES =
 tls_shared_nonpic_test_DEPENDENCIES = gcctestdir/ld

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