From 4ebf39dbf440f80e8d8b507d9ab2949d0209ae5a Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 24 Mar 2010 18:12:48 +0000 Subject: [PATCH] * testsuite/script_test_3.t: Add a TLS segment. * testsuite/Makefile.am (check_PROGRAMS): Add tls_phdrs_script_test. (tls_phdrs_script_test_SOURCES): Define. (tls_phdrs_script_test_DEPENDENCIES): Define. (tls_phdrs_script_test_LDFLAGS): Define. (tls_phdrs_script_test_LDADD): Define. * testsuite/Makefile.in: Rebuild. --- gold/ChangeLog | 11 +++++++++++ gold/testsuite/Makefile.am | 6 ++++++ gold/testsuite/Makefile.in | 34 ++++++++++++++++++++++++++-------- gold/testsuite/script_test_3.t | 5 ++++- 4 files changed, 47 insertions(+), 9 deletions(-) diff --git a/gold/ChangeLog b/gold/ChangeLog index 5da12393cce..d8b8d79430c 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,14 @@ +2010-03-24 Ian Lance Taylor + + * testsuite/script_test_3.t: Add a TLS segment. + * testsuite/Makefile.am (check_PROGRAMS): Add + tls_phdrs_script_test. + (tls_phdrs_script_test_SOURCES): Define. + (tls_phdrs_script_test_DEPENDENCIES): Define. + (tls_phdrs_script_test_LDFLAGS): Define. + (tls_phdrs_script_test_LDADD): Define. + * testsuite/Makefile.in: Rebuild. + 2010-03-23 Cary Coutant * fileread.cc (find_or_make_view): Fix comment. diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am index cad75fb50e1..b4f97e9a643 100644 --- a/gold/testsuite/Makefile.am +++ b/gold/testsuite/Makefile.am @@ -1086,6 +1086,12 @@ script_test_3: basic_test.o gcctestdir/ld script_test_3.t script_test_3.stdout: script_test_3 $(TEST_READELF) -SlW script_test_3 > script_test_3.stdout +check_PROGRAMS += tls_phdrs_script_test +tls_phdrs_script_test_SOURCES = $(tls_test_SOURCES) +tls_phdrs_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_3.t +tls_phdrs_script_test_LDFLAGS = $(tls_test_LDFLAGS) -T $(srcdir)/script_test_3.t +tls_phdrs_script_test_LDADD = $(tls_test_LDADD) + check_SCRIPTS += script_test_4.sh check_DATA += script_test_4.stdout MOSTLYCLEANFILES += script_test_4 diff --git a/gold/testsuite/Makefile.in b/gold/testsuite/Makefile.in index d69aa968f2b..86d7a5da700 100644 --- a/gold/testsuite/Makefile.in +++ b/gold/testsuite/Makefile.in @@ -223,6 +223,7 @@ check_PROGRAMS = object_unittest$(EXEEXT) binary_unittest$(EXEEXT) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ relro_script_test script_test_1 \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_2 justsyms \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ binary_test script_test_3 \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ tls_phdrs_script_test \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ tls_script_test \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ thin_archive_test_1 \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ thin_archive_test_2 @@ -461,6 +462,7 @@ libgoldtest_a_OBJECTS = $(am_libgoldtest_a_OBJECTS) @GCC_TRUE@@NATIVE_LINKER_TRUE@ justsyms$(EXEEXT) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ binary_test$(EXEEXT) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_3$(EXEEXT) \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ tls_phdrs_script_test$(EXEEXT) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ tls_script_test$(EXEEXT) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ thin_archive_test_1$(EXEEXT) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ thin_archive_test_2$(EXEEXT) @@ -798,6 +800,19 @@ am__thin_archive_test_2_SOURCES_DIST = thin_archive_main.cc thin_archive_test_2_OBJECTS = $(am_thin_archive_test_2_OBJECTS) thin_archive_test_2_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ $(thin_archive_test_2_LDFLAGS) $(LDFLAGS) -o $@ +am__tls_phdrs_script_test_SOURCES_DIST = tls_test.cc tls_test_file2.cc \ + tls_test_main.cc tls_test.h +@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@am__objects_3 = \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_test.$(OBJEXT) \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_test_file2.$(OBJEXT) \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_test_main.$(OBJEXT) +@GCC_TRUE@@NATIVE_LINKER_TRUE@am_tls_phdrs_script_test_OBJECTS = \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(am__objects_3) +tls_phdrs_script_test_OBJECTS = $(am_tls_phdrs_script_test_OBJECTS) +@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@am__DEPENDENCIES_2 = \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_test_c.o +tls_phdrs_script_test_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ + $(tls_phdrs_script_test_LDFLAGS) $(LDFLAGS) -o $@ am__tls_pic_test_SOURCES_DIST = tls_test_main.cc @GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@am_tls_pic_test_OBJECTS = tls_test_main.$(OBJEXT) tls_pic_test_OBJECTS = $(am_tls_pic_test_OBJECTS) @@ -817,15 +832,9 @@ tls_pie_test_DEPENDENCIES = libgoldtest.a ../libgold.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am__tls_script_test_SOURCES_DIST = tls_test.cc tls_test_file2.cc \ tls_test_main.cc tls_test.h -@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@am__objects_3 = \ -@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_test.$(OBJEXT) \ -@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_test_file2.$(OBJEXT) \ -@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_test_main.$(OBJEXT) @GCC_TRUE@@NATIVE_LINKER_TRUE@am_tls_script_test_OBJECTS = \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ $(am__objects_3) tls_script_test_OBJECTS = $(am_tls_script_test_OBJECTS) -@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@am__DEPENDENCIES_2 = \ -@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_test_c.o tls_script_test_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ $(tls_script_test_LDFLAGS) $(LDFLAGS) -o $@ am__tls_shared_gd_to_ie_test_SOURCES_DIST = tls_test_main.cc @@ -1161,8 +1170,9 @@ SOURCES = $(libgoldtest_a_SOURCES) basic_pic_test.c basic_pie_test.c \ $(script_test_1_SOURCES) $(script_test_2_SOURCES) \ script_test_3.c $(searched_file_test_SOURCES) \ $(thin_archive_test_1_SOURCES) $(thin_archive_test_2_SOURCES) \ - $(tls_pic_test_SOURCES) tls_pie_pic_test.c tls_pie_test.c \ - $(tls_script_test_SOURCES) $(tls_shared_gd_to_ie_test_SOURCES) \ + $(tls_phdrs_script_test_SOURCES) $(tls_pic_test_SOURCES) \ + tls_pie_pic_test.c tls_pie_test.c $(tls_script_test_SOURCES) \ + $(tls_shared_gd_to_ie_test_SOURCES) \ $(tls_shared_gnu2_gd_to_ie_test_SOURCES) \ $(tls_shared_gnu2_test_SOURCES) $(tls_shared_ie_test_SOURCES) \ $(tls_shared_nonpic_test_SOURCES) $(tls_shared_test_SOURCES) \ @@ -1224,6 +1234,7 @@ DIST_SOURCES = $(libgoldtest_a_SOURCES) basic_pic_test.c \ $(am__searched_file_test_SOURCES_DIST) \ $(am__thin_archive_test_1_SOURCES_DIST) \ $(am__thin_archive_test_2_SOURCES_DIST) \ + $(am__tls_phdrs_script_test_SOURCES_DIST) \ $(am__tls_pic_test_SOURCES_DIST) tls_pie_pic_test.c \ tls_pie_test.c $(am__tls_script_test_SOURCES_DIST) \ $(am__tls_shared_gd_to_ie_test_SOURCES_DIST) \ @@ -1773,6 +1784,10 @@ binary_unittest_SOURCES = binary_unittest.cc @GCC_TRUE@@NATIVE_LINKER_TRUE@binary_test_DEPENDENCIES = gcctestdir/ld binary.txt @GCC_TRUE@@NATIVE_LINKER_TRUE@binary_test_LDFLAGS = -Bgcctestdir/ -Wl,--format,binary,binary.txt,--format,elf @GCC_TRUE@@NATIVE_LINKER_TRUE@binary_test_LDADD = +@GCC_TRUE@@NATIVE_LINKER_TRUE@tls_phdrs_script_test_SOURCES = $(tls_test_SOURCES) +@GCC_TRUE@@NATIVE_LINKER_TRUE@tls_phdrs_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_3.t +@GCC_TRUE@@NATIVE_LINKER_TRUE@tls_phdrs_script_test_LDFLAGS = $(tls_test_LDFLAGS) -T $(srcdir)/script_test_3.t +@GCC_TRUE@@NATIVE_LINKER_TRUE@tls_phdrs_script_test_LDADD = $(tls_test_LDADD) @GCC_TRUE@@NATIVE_LINKER_TRUE@tls_script_test_SOURCES = $(tls_test_SOURCES) @GCC_TRUE@@NATIVE_LINKER_TRUE@tls_script_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) $(srcdir)/script_test_4.t @GCC_TRUE@@NATIVE_LINKER_TRUE@tls_script_test_LDFLAGS = $(tls_test_LDFLAGS) -T $(srcdir)/script_test_4.t @@ -2067,6 +2082,9 @@ thin_archive_test_1$(EXEEXT): $(thin_archive_test_1_OBJECTS) $(thin_archive_test thin_archive_test_2$(EXEEXT): $(thin_archive_test_2_OBJECTS) $(thin_archive_test_2_DEPENDENCIES) @rm -f thin_archive_test_2$(EXEEXT) $(thin_archive_test_2_LINK) $(thin_archive_test_2_OBJECTS) $(thin_archive_test_2_LDADD) $(LIBS) +tls_phdrs_script_test$(EXEEXT): $(tls_phdrs_script_test_OBJECTS) $(tls_phdrs_script_test_DEPENDENCIES) + @rm -f tls_phdrs_script_test$(EXEEXT) + $(tls_phdrs_script_test_LINK) $(tls_phdrs_script_test_OBJECTS) $(tls_phdrs_script_test_LDADD) $(LIBS) tls_pic_test$(EXEEXT): $(tls_pic_test_OBJECTS) $(tls_pic_test_DEPENDENCIES) @rm -f tls_pic_test$(EXEEXT) $(tls_pic_test_LINK) $(tls_pic_test_OBJECTS) $(tls_pic_test_LDADD) $(LIBS) diff --git a/gold/testsuite/script_test_3.t b/gold/testsuite/script_test_3.t index 99103492882..a6a655f7e72 100644 --- a/gold/testsuite/script_test_3.t +++ b/gold/testsuite/script_test_3.t @@ -1,6 +1,6 @@ /* script_test_3.t -- linker script test 3 for gold - Copyright 2008 Free Software Foundation, Inc. + Copyright 2008, 2010 Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of gold. @@ -32,6 +32,8 @@ SECTIONS . = ALIGN(0x100); .dynamic : { *(.dynamic) } :data :dynamic .data : { *(.data) } :data + .tdata : { *(.tdata*) } :data :tls + .tbss : { *(.tbss*) } :data :tls . += 0x100000; . = ALIGN(0x100); .bss : { *(.bss) } :bss @@ -44,4 +46,5 @@ PHDRS dynamic PT_DYNAMIC FLAGS(4); data PT_LOAD; bss PT_LOAD; + tls PT_TLS; } -- 2.30.2