diff options
Diffstat (limited to 'binutils-2.22/gold/testsuite')
19 files changed, 1003 insertions, 97 deletions
diff --git a/binutils-2.22/gold/testsuite/Makefile.am b/binutils-2.22/gold/testsuite/Makefile.am index fdb37e5..b8b88e8 100644 --- a/binutils-2.22/gold/testsuite/Makefile.am +++ b/binutils-2.22/gold/testsuite/Makefile.am @@ -94,6 +94,9 @@ object_unittest_SOURCES = object_unittest.cc check_PROGRAMS += binary_unittest binary_unittest_SOURCES = binary_unittest.cc +check_PROGRAMS += leb128_unittest +leb128_unittest_SOURCES = leb128_unittest.cc + endif NATIVE_OR_CROSS_LINKER # --------------------------------------------------------------------- @@ -861,7 +864,7 @@ initpri1_LDADD = check_PROGRAMS += initpri2 initpri2_SOURCES = initpri2.c initpri2_DEPENDENCIES = gcctestdir/ld -initpri2_LDFLAGS = -Bgcctestdir/ +initpri2_LDFLAGS = -Bgcctestdir/ -Wl,--ctors-in-init-array initpri2_LDADD = check_PROGRAMS += initpri3a @@ -870,11 +873,16 @@ initpri3a_DEPENDENCIES = gcctestdir/ld initpri3a_LDFLAGS = -Bgcctestdir/ initpri3a_LDADD = -check_PROGRAMS += initpri3b -initpri3b_SOURCES = initpri3.c -initpri3b_DEPENDENCIES = gcctestdir/ld -initpri3b_LDFLAGS = -Bgcctestdir/ -Wl,--no-ctors-in-init-array -initpri3b_LDADD = +# This test fails on targets not using .ctors and .dtors sections (e.g. ARM +# EABI). Given that gcc is moving towards using .init_array in all cases, +# this test is commented out. A better fix would be checking whether gcc +# uses .ctors or .init_array sections in configure. + +# check_PROGRAMS += initpri3b +# initpri3b_SOURCES = initpri3.c +# initpri3b_DEPENDENCIES = gcctestdir/ld +# initpri3b_LDFLAGS = -Bgcctestdir/ -Wl,--no-ctors-in-init-array +# initpri3b_LDADD = # Test --detect-odr-violations check_SCRIPTS += debug_msg.sh @@ -1510,6 +1518,20 @@ unused.o: unused.c unused.c: @cp /dev/null $@ +check_SCRIPTS += plugin_final_layout.sh +check_DATA += plugin_final_layout.stdout +plugin_final_layout.o: plugin_final_layout.cc + $(CXXCOMPILE) -O0 -c -ffunction-sections -fdata-sections -g -o $@ $< +plugin_final_layout: plugin_final_layout.o plugin_section_order.so gcctestdir/ld + $(CXXLINK) -Bgcctestdir/ -Wl,--plugin,"./plugin_section_order.so" plugin_final_layout.o +plugin_final_layout.stdout: plugin_final_layout + $(TEST_NM) -n plugin_final_layout > plugin_final_layout.stdout + +plugin_section_order.so: plugin_section_order.o + $(LINK) -Bgcctestdir/ -shared plugin_section_order.o +plugin_section_order.o: plugin_section_order.c + $(COMPILE) -O0 -c -fpic -o $@ $< + endif PLUGINS check_PROGRAMS += exclude_libs_test @@ -1651,7 +1673,7 @@ no_version_test.stdout: libno_version_test.so if IFUNC ifuncmod1.o: ifuncmod1.c - $(COMPILE) -c -fpic -o $@ $< + $(COMPILE) -c -fPIC -o $@ $< ifuncmod1.so: ifuncmod1.o gcctestdir/ld $(LINK) -Bgcctestdir/ -shared ifuncmod1.o @@ -1659,9 +1681,9 @@ ifuncdep1.o: ifuncmod1.c $(COMPILE) -c -o $@ $< ifuncmain1pic.o: ifuncmain1.c - $(COMPILE) -c -fpic -o $@ $< + $(COMPILE) -c -fPIC -o $@ $< ifuncmain1pie.o: ifuncmain1.c - $(COMPILE) -c -fpie -o $@ $< + $(COMPILE) -c -fPIE -o $@ $< if HAVE_STATIC if IFUNC_STATIC @@ -1695,7 +1717,7 @@ ifuncmain1vis_LDADD = ifuncmod1.so check_PROGRAMS += ifuncmain1vispic ifuncmain1vispic.o: ifuncmain1vis.c - $(COMPILE) -c -fpic -o $@ $< + $(COMPILE) -c -fPIC -o $@ $< ifuncmain1vispic: ifuncmain1vispic.o ifuncmod1.so gcctestdir/ld $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,. @@ -1709,7 +1731,7 @@ ifuncmain1pie: ifuncmain1pie.o ifuncmod1.so gcctestdir/ld check_PROGRAMS += ifuncmain1vispie ifuncmain1vispie.o: ifuncmain1vis.c - $(COMPILE) -c -fpie -o $@ $< + $(COMPILE) -c -fPIE -o $@ $< ifuncmain1vispie: ifuncmain1vispie.o ifuncmod1.so gcctestdir/ld $(LINK) -Bgcctestdir/ -pie ifuncmain1vispie.o ifuncmod1.so -Wl,-R,. @@ -1718,10 +1740,10 @@ ifuncmain1staticpie: ifuncmain1pie.o ifuncmod1.o gcctestdir/ld $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.o ifuncmain2pic.o: ifuncmain2.c - $(COMPILE) -c -fpic -o $@ $< + $(COMPILE) -c -fPIC -o $@ $< ifuncdep2pic.o: ifuncdep2.c - $(COMPILE) -c -fpic -o $@ $< + $(COMPILE) -c -fPIC -o $@ $< if HAVE_STATIC if IFUNC_STATIC @@ -1748,7 +1770,7 @@ ifuncmain2pic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld $(LINK) -Bgcctestdir/ ifuncmain2pic.o ifuncdep2pic.o ifuncmod3.o: ifuncmod3.c - $(COMPILE) -c -fpic -o $@ $< + $(COMPILE) -c -fPIC -o $@ $< ifuncmod3.so: ifuncmod3.o gcctestdir/ld $(LINK) -Bgcctestdir/ -shared ifuncmod3.o @@ -1759,7 +1781,7 @@ ifuncmain3_LDFLAGS = -Bgcctestdir/ -Wl,--export-dynamic -Wl,-R,. ifuncmain3_LDADD = -ldl ifuncmain4pic.o: ifuncmain4.c - $(COMPILE) -c -fpic -o $@ $< + $(COMPILE) -c -fPIC -o $@ $< if HAVE_STATIC if IFUNC_STATIC @@ -1782,13 +1804,13 @@ ifuncmain4_LDFLAGS = -Bgcctestdir/ ifuncmain4_LDADD = ifuncmain5pic.o: ifuncmain5.c - $(COMPILE) -c -fpic -o $@ $< + $(COMPILE) -c -fPIC -o $@ $< ifuncmain5pie.o: ifuncmain5.c - $(COMPILE) -c -fpie -o $@ $< + $(COMPILE) -c -fPIE -o $@ $< ifuncmod5.o: ifuncmod5.c - $(COMPILE) -c -fpic -o $@ $< + $(COMPILE) -c -fPIC -o $@ $< ifuncmod5.so: ifuncmod5.o gcctestdir/ld $(LINK) -Bgcctestdir/ -shared ifuncmod5.o @@ -1828,10 +1850,10 @@ ifuncmain5pie: ifuncmain5pie.o ifuncmod5.so gcctestdir/ld $(LINK) -Bgcctestdir/ -pie ifuncmain5pie.o ifuncmod5.so -Wl,-R,. ifuncmain6pie.o: ifuncmain6pie.c - $(COMPILE) -c -fpie -o $@ $< + $(COMPILE) -c -fPIE -o $@ $< ifuncmod6.o: ifuncmod6.c - $(COMPILE) -c -fpic -o $@ $< + $(COMPILE) -c -fPIC -o $@ $< ifuncmod6.so: ifuncmod6.o gcctestdir/ld $(LINK) -Bgcctestdir/ -shared ifuncmod6.o @@ -1840,10 +1862,10 @@ ifuncmain6pie: ifuncmain6pie.o ifuncmod6.so gcctestdir/ld $(LINK) -Bgcctestdir/ -pie ifuncmain6pie.o ifuncmod6.so -Wl,-R,. ifuncmain7pic.o: ifuncmain7.c - $(COMPILE) -c -fpic -o $@ $< + $(COMPILE) -c -fPIC -o $@ $< ifuncmain7pie.o: ifuncmain7.c - $(COMPILE) -c -fpie -o $@ $< + $(COMPILE) -c -fPIE -o $@ $< if HAVE_STATIC if IFUNC_STATIC @@ -1875,9 +1897,9 @@ ifuncmain7pie: ifuncmain7pie.o gcctestdir/ld check_PROGRAMS += ifuncvar ifuncvar1_pic.o: ifuncvar1.c - $(COMPILE) -c -fpic -o $@ $< + $(COMPILE) -c -fPIC -o $@ $< ifuncvar2_pic.o: ifuncvar2.c - $(COMPILE) -c -fpic -o $@ $< + $(COMPILE) -c -fPIC -o $@ $< ifuncvar.so: ifuncvar1_pic.o ifuncvar2_pic.o gcctestdir/ld $(LINK) -Bgcctestdir/ -shared ifuncvar1_pic.o ifuncvar2_pic.o ifuncvar_SOURCES = ifuncvar3.c @@ -1945,6 +1967,58 @@ memory_test: memory_test.o gcctestdir/ld $(srcdir)/memory_test.t memory_test.stdout: memory_test $(TEST_READELF) -lWS $< > $@ +if HAVE_PUBNAMES + +# Test that --gdb-index functions correctly without gcc-generated pubnames. +check_SCRIPTS += gdb_index_test_1.sh +check_DATA += gdb_index_test_1.stdout +MOSTLYCLEANFILES += gdb_index_test_1.stdout gdb_index_test_1 +gdb_index_test.o: gdb_index_test.cc + $(CXXCOMPILE) -O0 -g -gno-pubnames -c -o $@ $< +gdb_index_test_1: gdb_index_test.o gcctestdir/ld + $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $< +gdb_index_test_1.stdout: gdb_index_test_1 + $(TEST_READELF) --debug-dump=gdb_index $< > $@ + +if HAVE_ZLIB + +# Test that --gdb-index functions correctly with compressed debug sections. +check_SCRIPTS += gdb_index_test_2.sh +check_DATA += gdb_index_test_2.stdout +MOSTLYCLEANFILES += gdb_index_test_2.stdout gdb_index_test_2 +gdb_index_test_cdebug.o: gdb_index_test.cc + $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections -c -o $@ $< +gdb_index_test_2: gdb_index_test_cdebug.o gcctestdir/ld + $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $< +gdb_index_test_2.stdout: gdb_index_test_2 + $(TEST_READELF) --debug-dump=gdb_index $< > $@ + +endif HAVE_ZLIB + +# Another simple C test (DW_AT_high_pc encoding) for --gdb-index. +check_SCRIPTS += gdb_index_test_3.sh +check_DATA += gdb_index_test_3.stdout +MOSTLYCLEANFILES += gdb_index_test_3.stdout gdb_index_test_3 +gdb_index_test_3.o: gdb_index_test_3.c + $(COMPILE) -O0 -g -c -o $@ $< +gdb_index_test_3: gdb_index_test_3.o gcctestdir/ld + $(LINK) -Bgcctestdir/ -Wl,--gdb-index,--fatal-warnings $< +gdb_index_test_3.stdout: gdb_index_test_3 + $(TEST_READELF) --debug-dump=gdb_index $< > $@ + +# Test that --gdb-index functions correctly with gcc-generated pubnames. +check_SCRIPTS += gdb_index_test_4.sh +check_DATA += gdb_index_test_4.stdout +MOSTLYCLEANFILES += gdb_index_test_4.stdout gdb_index_test_4 +gdb_index_test_pub.o: gdb_index_test.cc + $(CXXCOMPILE) -O0 -g -gpubnames -c -o $@ $< +gdb_index_test_4: gdb_index_test_pub.o gcctestdir/ld + $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $< +gdb_index_test_4.stdout: gdb_index_test_4 + $(TEST_READELF) --debug-dump=gdb_index $< > $@ + +endif HAVE_PUBNAMES + # End-to-end incremental linking tests. # Incremental linking is currently supported only on the x86_64 target. diff --git a/binutils-2.22/gold/testsuite/Makefile.in b/binutils-2.22/gold/testsuite/Makefile.in index 67149fb..4887827 100644 --- a/binutils-2.22/gold/testsuite/Makefile.in +++ b/binutils-2.22/gold/testsuite/Makefile.in @@ -54,7 +54,18 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ $(am__EXEEXT_34) $(am__EXEEXT_35) $(am__EXEEXT_36) \ $(am__EXEEXT_37) $(am__EXEEXT_38) @NATIVE_OR_CROSS_LINKER_TRUE@am__append_1 = object_unittest \ -@NATIVE_OR_CROSS_LINKER_TRUE@ binary_unittest +@NATIVE_OR_CROSS_LINKER_TRUE@ binary_unittest leb128_unittest + +# This test fails on targets not using .ctors and .dtors sections (e.g. ARM +# EABI). Given that gcc is moving towards using .init_array in all cases, +# this test is commented out. A better fix would be checking whether gcc +# uses .ctors or .init_array sections in configure. + +# check_PROGRAMS += initpri3b +# initpri3b_SOURCES = initpri3.c +# initpri3b_DEPENDENCIES = gcctestdir/ld +# initpri3b_LDFLAGS = -Bgcctestdir/ -Wl,--no-ctors-in-init-array +# initpri3b_LDADD = # Test --detect-odr-violations @@ -189,7 +200,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ # Test -o when emitting to a special file (such as something in /dev). @GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_24 = many_sections_test \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ many_sections_r_test initpri1 \ -@GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri2 initpri3a initpri3b \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri2 initpri3a \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ flagstest_o_specialfile @GCC_FALSE@many_sections_test_DEPENDENCIES = @NATIVE_LINKER_FALSE@many_sections_test_DEPENDENCIES = @@ -204,8 +215,6 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ @NATIVE_LINKER_FALSE@initpri2_DEPENDENCIES = @GCC_FALSE@initpri3a_DEPENDENCIES = @NATIVE_LINKER_FALSE@initpri3a_DEPENDENCIES = -@GCC_FALSE@initpri3b_DEPENDENCIES = -@NATIVE_LINKER_FALSE@initpri3b_DEPENDENCIES = # Check that --detect-odr-violations works with compressed debug sections. @GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@am__append_27 = debug_msg_cdebug.err @@ -306,7 +315,8 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_3.sh \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_4.sh \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_6.sh \ -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_7.sh +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_7.sh \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_final_layout.sh # Test that symbols known in the IR file but not in the replacement file # produce an unresolved symbol error. @@ -318,7 +328,8 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_6.err \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_7.err \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_7.syms \ -@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_9.err +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_9.err \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_final_layout.stdout # Make a copy of two_file_test_1.o, which does not define the symbol _Z4t16av. @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@am__append_36 = \ @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_1.err \ @@ -467,9 +478,31 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ # Test that --start-lib and --end-lib function correctly. @GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_53 = start_lib_test +# Test that --gdb-index functions correctly without gcc-generated pubnames. +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@am__append_54 = gdb_index_test_1.sh +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@am__append_55 = gdb_index_test_1.stdout +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@am__append_56 = gdb_index_test_1.stdout gdb_index_test_1 + +# Test that --gdb-index functions correctly with compressed debug sections. +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@am__append_57 = gdb_index_test_2.sh +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@am__append_58 = gdb_index_test_2.stdout +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@am__append_59 = gdb_index_test_2.stdout gdb_index_test_2 + +# Another simple C test (DW_AT_high_pc encoding) for --gdb-index. + +# Test that --gdb-index functions correctly with gcc-generated pubnames. +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@am__append_60 = gdb_index_test_3.sh \ +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ gdb_index_test_4.sh +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@am__append_61 = gdb_index_test_3.stdout \ +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ gdb_index_test_4.stdout +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@am__append_62 = gdb_index_test_3.stdout \ +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ gdb_index_test_3 \ +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ gdb_index_test_4.stdout \ +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ gdb_index_test_4 + # Test the --incremental-unchanged flag with an archive library. # The second link should not update the library. -@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_54 = incremental_test_2 \ +@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_63 = incremental_test_2 \ @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_3 \ @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_4 \ @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_5 \ @@ -477,7 +510,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_copy_test \ @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_common_test_1 \ @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_comdat_test_1 -@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_55 = two_file_test_tmp_2.o \ +@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_64 = two_file_test_tmp_2.o \ @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_tmp_3.o \ @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ incremental_test_4.base \ @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_tmp_4.o \ @@ -487,22 +520,22 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ # These tests work with native and cross linkers. # Test script section order. -@NATIVE_OR_CROSS_LINKER_TRUE@am__append_56 = script_test_10.sh -@NATIVE_OR_CROSS_LINKER_TRUE@am__append_57 = script_test_10.stdout +@NATIVE_OR_CROSS_LINKER_TRUE@am__append_65 = script_test_10.sh +@NATIVE_OR_CROSS_LINKER_TRUE@am__append_66 = script_test_10.stdout # These tests work with cross linkers only. -@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_58 = split_i386.sh -@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_59 = split_i386_1.stdout split_i386_2.stdout \ +@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_67 = split_i386.sh +@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_68 = split_i386_1.stdout split_i386_2.stdout \ @DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_i386_3.stdout split_i386_4.stdout split_i386_r.stdout -@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_60 = split_i386_1 split_i386_2 split_i386_3 \ +@DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_69 = split_i386_1 split_i386_2 split_i386_3 \ @DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_i386_4 split_i386_r -@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_61 = split_x86_64.sh -@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_62 = split_x86_64_1.stdout split_x86_64_2.stdout \ +@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_70 = split_x86_64.sh +@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_71 = split_x86_64_1.stdout split_x86_64_2.stdout \ @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_x86_64_3.stdout split_x86_64_4.stdout split_x86_64_r.stdout -@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_63 = split_x86_64_1 split_x86_64_2 split_x86_64_3 \ +@DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_72 = split_x86_64_1 split_x86_64_2 split_x86_64_3 \ @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ split_x86_64_4 split_x86_64_r @@ -517,7 +550,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ # Check Thumb to Thumb farcall veneers # Check Thumb to ARM farcall veneers -@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_64 = arm_abs_global.sh \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_73 = arm_abs_global.sh \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_branch_in_range.sh \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_branch_out_of_range.sh \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_fix_v4bx.sh \ @@ -531,7 +564,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_arm_thumb.sh \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_thumb.sh \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_arm.sh -@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_65 = arm_abs_global.stdout \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_74 = arm_abs_global.stdout \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_in_range.stdout \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_out_of_range.stdout \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ thumb_bl_in_range.stdout \ @@ -576,7 +609,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_thumb_6m.stdout \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_arm.stdout \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_arm_5t.stdout -@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_66 = arm_abs_global \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_75 = arm_abs_global \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_in_range \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_out_of_range \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ thumb_bl_in_range \ @@ -624,6 +657,7 @@ DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/../config/gettext-sister.m4 \ + $(top_srcdir)/../config/lcmessage.m4 \ $(top_srcdir)/../config/lead-dot.m4 \ $(top_srcdir)/../config/nls.m4 \ $(top_srcdir)/../config/override.m4 \ @@ -644,7 +678,8 @@ am_libgoldtest_a_OBJECTS = test.$(OBJEXT) testmain.$(OBJEXT) \ testfile.$(OBJEXT) libgoldtest_a_OBJECTS = $(am_libgoldtest_a_OBJECTS) @NATIVE_OR_CROSS_LINKER_TRUE@am__EXEEXT_1 = object_unittest$(EXEEXT) \ -@NATIVE_OR_CROSS_LINKER_TRUE@ binary_unittest$(EXEEXT) +@NATIVE_OR_CROSS_LINKER_TRUE@ binary_unittest$(EXEEXT) \ +@NATIVE_OR_CROSS_LINKER_TRUE@ leb128_unittest$(EXEEXT) @GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_2 = icf_virtual_function_folding_test$(EXEEXT) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ basic_test$(EXEEXT) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ basic_pic_test$(EXEEXT) @@ -712,7 +747,6 @@ libgoldtest_a_OBJECTS = $(am_libgoldtest_a_OBJECTS) @GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri1$(EXEEXT) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri2$(EXEEXT) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri3a$(EXEEXT) \ -@GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri3b$(EXEEXT) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ flagstest_o_specialfile$(EXEEXT) @GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_21 = flagstest_compress_debug_sections$(EXEEXT) \ @GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@ flagstest_o_specialfile_and_compress_debug_sections$(EXEEXT) @@ -1200,11 +1234,6 @@ initpri2_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(initpri2_LDFLAGS) \ initpri3a_OBJECTS = $(am_initpri3a_OBJECTS) initpri3a_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(initpri3a_LDFLAGS) \ $(LDFLAGS) -o $@ -@GCC_TRUE@@NATIVE_LINKER_TRUE@am_initpri3b_OBJECTS = \ -@GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri3.$(OBJEXT) -initpri3b_OBJECTS = $(am_initpri3b_OBJECTS) -initpri3b_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(initpri3b_LDFLAGS) \ - $(LDFLAGS) -o $@ @GCC_TRUE@@NATIVE_LINKER_TRUE@am_justsyms_OBJECTS = \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ justsyms_1.$(OBJEXT) justsyms_OBJECTS = $(am_justsyms_OBJECTS) @@ -1219,6 +1248,13 @@ justsyms_exec_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ large_OBJECTS = $(am_large_OBJECTS) large_LINK = $(CCLD) $(large_CFLAGS) $(CFLAGS) $(large_LDFLAGS) \ $(LDFLAGS) -o $@ +@NATIVE_OR_CROSS_LINKER_TRUE@am_leb128_unittest_OBJECTS = \ +@NATIVE_OR_CROSS_LINKER_TRUE@ leb128_unittest.$(OBJEXT) +leb128_unittest_OBJECTS = $(am_leb128_unittest_OBJECTS) +leb128_unittest_LDADD = $(LDADD) +leb128_unittest_DEPENDENCIES = libgoldtest.a ../libgold.a \ + ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) local_labels_test_SOURCES = local_labels_test.c local_labels_test_OBJECTS = local_labels_test.$(OBJEXT) local_labels_test_LDADD = $(LDADD) @@ -1698,8 +1734,9 @@ SOURCES = $(libgoldtest_a_SOURCES) basic_pic_test.c basic_pie_test.c \ incremental_copy_test.c incremental_test_2.c \ incremental_test_3.c incremental_test_4.c incremental_test_5.c \ incremental_test_6.c $(initpri1_SOURCES) $(initpri2_SOURCES) \ - $(initpri3a_SOURCES) $(initpri3b_SOURCES) $(justsyms_SOURCES) \ - $(justsyms_exec_SOURCES) $(large_SOURCES) local_labels_test.c \ + $(initpri3a_SOURCES) $(justsyms_SOURCES) \ + $(justsyms_exec_SOURCES) $(large_SOURCES) \ + $(leb128_unittest_SOURCES) local_labels_test.c \ many_sections_r_test.c $(many_sections_test_SOURCES) \ $(object_unittest_SOURCES) permission_test.c plugin_test_1.c \ plugin_test_2.c plugin_test_3.c plugin_test_4.c \ @@ -1844,6 +1881,8 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GENCAT = @GENCAT@ GMSGFMT = @GMSGFMT@ +GOLD_LDADD = @GOLD_LDADD@ +GOLD_LDFLAGS = @GOLD_LDFLAGS@ GREP = @GREP@ INCINTL = @INCINTL@ INSTALL = @INSTALL@ @@ -1981,18 +2020,21 @@ TEST_AS = $(top_builddir)/../gas/as-new MOSTLYCLEANFILES = *.so *.syms *.stdout $(am__append_4) \ $(am__append_17) $(am__append_26) $(am__append_28) \ $(am__append_30) $(am__append_36) $(am__append_40) \ - $(am__append_55) $(am__append_60) $(am__append_63) \ - $(am__append_66) + $(am__append_56) $(am__append_59) $(am__append_62) \ + $(am__append_64) $(am__append_69) $(am__append_72) \ + $(am__append_75) # We will add to these later, for each individual test. Note # that we add each test under check_SCRIPTS or check_PROGRAMS; # the TESTS variable is automatically populated from these. check_SCRIPTS = $(am__append_2) $(am__append_34) $(am__append_38) \ - $(am__append_56) $(am__append_58) $(am__append_61) \ - $(am__append_64) + $(am__append_54) $(am__append_57) $(am__append_60) \ + $(am__append_65) $(am__append_67) $(am__append_70) \ + $(am__append_73) check_DATA = $(am__append_3) $(am__append_27) $(am__append_29) \ - $(am__append_35) $(am__append_39) $(am__append_57) \ - $(am__append_59) $(am__append_62) $(am__append_65) + $(am__append_35) $(am__append_39) $(am__append_55) \ + $(am__append_58) $(am__append_61) $(am__append_66) \ + $(am__append_68) $(am__append_71) $(am__append_74) BUILT_SOURCES = $(am__append_25) TESTS = $(check_SCRIPTS) $(check_PROGRAMS) @@ -2010,6 +2052,7 @@ LDADD = libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL) \ @NATIVE_OR_CROSS_LINKER_TRUE@object_unittest_SOURCES = object_unittest.cc @NATIVE_OR_CROSS_LINKER_TRUE@binary_unittest_SOURCES = binary_unittest.cc +@NATIVE_OR_CROSS_LINKER_TRUE@leb128_unittest_SOURCES = leb128_unittest.cc @GCC_TRUE@@NATIVE_LINKER_TRUE@constructor_test_SOURCES = constructor_test.cc @GCC_TRUE@@NATIVE_LINKER_TRUE@constructor_test_DEPENDENCIES = gcctestdir/ld @GCC_TRUE@@NATIVE_LINKER_TRUE@constructor_test_LDFLAGS = -Bgcctestdir/ @@ -2273,16 +2316,12 @@ LDADD = libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@initpri1_LDADD = @GCC_TRUE@@NATIVE_LINKER_TRUE@initpri2_SOURCES = initpri2.c @GCC_TRUE@@NATIVE_LINKER_TRUE@initpri2_DEPENDENCIES = gcctestdir/ld -@GCC_TRUE@@NATIVE_LINKER_TRUE@initpri2_LDFLAGS = -Bgcctestdir/ +@GCC_TRUE@@NATIVE_LINKER_TRUE@initpri2_LDFLAGS = -Bgcctestdir/ -Wl,--ctors-in-init-array @GCC_TRUE@@NATIVE_LINKER_TRUE@initpri2_LDADD = @GCC_TRUE@@NATIVE_LINKER_TRUE@initpri3a_SOURCES = initpri3.c @GCC_TRUE@@NATIVE_LINKER_TRUE@initpri3a_DEPENDENCIES = gcctestdir/ld @GCC_TRUE@@NATIVE_LINKER_TRUE@initpri3a_LDFLAGS = -Bgcctestdir/ @GCC_TRUE@@NATIVE_LINKER_TRUE@initpri3a_LDADD = -@GCC_TRUE@@NATIVE_LINKER_TRUE@initpri3b_SOURCES = initpri3.c -@GCC_TRUE@@NATIVE_LINKER_TRUE@initpri3b_DEPENDENCIES = gcctestdir/ld -@GCC_TRUE@@NATIVE_LINKER_TRUE@initpri3b_LDFLAGS = -Bgcctestdir/ -Wl,--no-ctors-in-init-array -@GCC_TRUE@@NATIVE_LINKER_TRUE@initpri3b_LDADD = @GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_SOURCES = ver_test_main.cc @GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_DEPENDENCIES = gcctestdir/ld ver_test_1.so ver_test_2.so ver_test_4.so @GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. @@ -2926,9 +2965,6 @@ initpri2$(EXEEXT): $(initpri2_OBJECTS) $(initpri2_DEPENDENCIES) initpri3a$(EXEEXT): $(initpri3a_OBJECTS) $(initpri3a_DEPENDENCIES) @rm -f initpri3a$(EXEEXT) $(initpri3a_LINK) $(initpri3a_OBJECTS) $(initpri3a_LDADD) $(LIBS) -initpri3b$(EXEEXT): $(initpri3b_OBJECTS) $(initpri3b_DEPENDENCIES) - @rm -f initpri3b$(EXEEXT) - $(initpri3b_LINK) $(initpri3b_OBJECTS) $(initpri3b_LDADD) $(LIBS) justsyms$(EXEEXT): $(justsyms_OBJECTS) $(justsyms_DEPENDENCIES) @rm -f justsyms$(EXEEXT) $(justsyms_LINK) $(justsyms_OBJECTS) $(justsyms_LDADD) $(LIBS) @@ -2938,6 +2974,9 @@ justsyms_exec$(EXEEXT): $(justsyms_exec_OBJECTS) $(justsyms_exec_DEPENDENCIES) large$(EXEEXT): $(large_OBJECTS) $(large_DEPENDENCIES) @rm -f large$(EXEEXT) $(large_LINK) $(large_OBJECTS) $(large_LDADD) $(LIBS) +leb128_unittest$(EXEEXT): $(leb128_unittest_OBJECTS) $(leb128_unittest_DEPENDENCIES) + @rm -f leb128_unittest$(EXEEXT) + $(CXXLINK) $(leb128_unittest_OBJECTS) $(leb128_unittest_LDADD) $(LIBS) @GCC_FALSE@local_labels_test$(EXEEXT): $(local_labels_test_OBJECTS) $(local_labels_test_DEPENDENCIES) @GCC_FALSE@ @rm -f local_labels_test$(EXEEXT) @GCC_FALSE@ $(LINK) $(local_labels_test_OBJECTS) $(local_labels_test_LDADD) $(LIBS) @@ -3318,6 +3357,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/justsyms_1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/justsyms_exec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/large-large.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/leb128_unittest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/local_labels_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/many_sections_r_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/many_sections_test.Po@am__quote@ @@ -3689,6 +3729,8 @@ plugin_test_6.sh.log: plugin_test_6.sh @p='plugin_test_6.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) plugin_test_7.sh.log: plugin_test_7.sh @p='plugin_test_7.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) +plugin_final_layout.sh.log: plugin_final_layout.sh + @p='plugin_final_layout.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) exclude_libs_test.sh.log: exclude_libs_test.sh @p='exclude_libs_test.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) discard_locals_test.sh.log: discard_locals_test.sh @@ -3705,6 +3747,14 @@ dyn_weak_ref.sh.log: dyn_weak_ref.sh @p='dyn_weak_ref.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) memory_test.sh.log: memory_test.sh @p='memory_test.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) +gdb_index_test_1.sh.log: gdb_index_test_1.sh + @p='gdb_index_test_1.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) +gdb_index_test_2.sh.log: gdb_index_test_2.sh + @p='gdb_index_test_2.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) +gdb_index_test_3.sh.log: gdb_index_test_3.sh + @p='gdb_index_test_3.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) +gdb_index_test_4.sh.log: gdb_index_test_4.sh + @p='gdb_index_test_4.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) script_test_10.sh.log: script_test_10.sh @p='script_test_10.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) split_i386.sh.log: split_i386.sh @@ -3743,6 +3793,8 @@ object_unittest.log: object_unittest$(EXEEXT) @p='object_unittest$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) binary_unittest.log: binary_unittest$(EXEEXT) @p='binary_unittest$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) +leb128_unittest.log: leb128_unittest$(EXEEXT) + @p='leb128_unittest$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) icf_virtual_function_folding_test.log: icf_virtual_function_folding_test$(EXEEXT) @p='icf_virtual_function_folding_test$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) basic_test.log: basic_test$(EXEEXT) @@ -3867,8 +3919,6 @@ initpri2.log: initpri2$(EXEEXT) @p='initpri2$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) initpri3a.log: initpri3a$(EXEEXT) @p='initpri3a$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) -initpri3b.log: initpri3b$(EXEEXT) - @p='initpri3b$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) flagstest_o_specialfile.log: flagstest_o_specialfile$(EXEEXT) @p='flagstest_o_specialfile$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) flagstest_compress_debug_sections.log: flagstest_compress_debug_sections$(EXEEXT) @@ -4811,6 +4861,17 @@ uninstall-am: @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(COMPILE) -c -o $@ $< @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@unused.c: @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ @cp /dev/null $@ +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_final_layout.o: plugin_final_layout.cc +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(CXXCOMPILE) -O0 -c -ffunction-sections -fdata-sections -g -o $@ $< +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_final_layout: plugin_final_layout.o plugin_section_order.so gcctestdir/ld +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--plugin,"./plugin_section_order.so" plugin_final_layout.o +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_final_layout.stdout: plugin_final_layout +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(TEST_NM) -n plugin_final_layout > plugin_final_layout.stdout + +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_section_order.so: plugin_section_order.o +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(LINK) -Bgcctestdir/ -shared plugin_section_order.o +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_section_order.o: plugin_section_order.c +@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(COMPILE) -O0 -c -fpic -o $@ $< @GCC_TRUE@@NATIVE_LINKER_TRUE@exclude_libs_test.syms: exclude_libs_test @GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) -sW $< >$@ 2>/dev/null @GCC_TRUE@@NATIVE_LINKER_TRUE@libexclude_libs_test_1.a: exclude_libs_test_1.o @@ -4880,7 +4941,7 @@ uninstall-am: # Test STT_GNU_IFUNC symbols. @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmod1.o: ifuncmod1.c -@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fpic -o $@ $< +@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fPIC -o $@ $< @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmod1.so: ifuncmod1.o gcctestdir/ld @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ -shared ifuncmod1.o @@ -4888,15 +4949,15 @@ uninstall-am: @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -o $@ $< @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1pic.o: ifuncmain1.c -@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fpic -o $@ $< +@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fPIC -o $@ $< @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1pie.o: ifuncmain1.c -@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fpie -o $@ $< +@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fPIE -o $@ $< @GCC_TRUE@@HAVE_STATIC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1picstatic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld @GCC_TRUE@@HAVE_STATIC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ -static ifuncmain1pic.o ifuncmod1.o @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1pic: ifuncmain1pic.o ifuncmod1.so gcctestdir/ld @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,. @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1vispic.o: ifuncmain1vis.c -@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fpic -o $@ $< +@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fPIC -o $@ $< @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1vispic: ifuncmain1vispic.o ifuncmod1.so gcctestdir/ld @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,. @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1staticpic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld @@ -4904,40 +4965,40 @@ uninstall-am: @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1pie: ifuncmain1pie.o ifuncmod1.so gcctestdir/ld @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.so -Wl,-R,. @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1vispie.o: ifuncmain1vis.c -@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fpie -o $@ $< +@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fPIE -o $@ $< @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1vispie: ifuncmain1vispie.o ifuncmod1.so gcctestdir/ld @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ -pie ifuncmain1vispie.o ifuncmod1.so -Wl,-R,. @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain1staticpie: ifuncmain1pie.o ifuncmod1.o gcctestdir/ld @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.o @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain2pic.o: ifuncmain2.c -@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fpic -o $@ $< +@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fPIC -o $@ $< @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncdep2pic.o: ifuncdep2.c -@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fpic -o $@ $< +@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fPIC -o $@ $< @GCC_TRUE@@HAVE_STATIC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain2picstatic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld @GCC_TRUE@@HAVE_STATIC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ -static ifuncmain2pic.o ifuncdep2pic.o @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain2pic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ ifuncmain2pic.o ifuncdep2pic.o @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmod3.o: ifuncmod3.c -@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fpic -o $@ $< +@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fPIC -o $@ $< @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmod3.so: ifuncmod3.o gcctestdir/ld @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ -shared ifuncmod3.o @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain4pic.o: ifuncmain4.c -@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fpic -o $@ $< +@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fPIC -o $@ $< @GCC_TRUE@@HAVE_STATIC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain4picstatic: ifuncmain4pic.o gcctestdir/ld @GCC_TRUE@@HAVE_STATIC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ -static ifuncmain4pic.o @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain5pic.o: ifuncmain5.c -@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fpic -o $@ $< +@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fPIC -o $@ $< @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain5pie.o: ifuncmain5.c -@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fpie -o $@ $< +@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fPIE -o $@ $< @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmod5.o: ifuncmod5.c -@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fpic -o $@ $< +@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fPIC -o $@ $< @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmod5.so: ifuncmod5.o gcctestdir/ld @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ -shared ifuncmod5.o @@ -4953,20 +5014,20 @@ uninstall-am: @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ -pie ifuncmain5pie.o ifuncmod5.so -Wl,-R,. @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain6pie.o: ifuncmain6pie.c -@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fpie -o $@ $< +@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fPIE -o $@ $< @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmod6.o: ifuncmod6.c -@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fpic -o $@ $< +@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fPIC -o $@ $< @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmod6.so: ifuncmod6.o gcctestdir/ld @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ -shared ifuncmod6.o @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain6pie: ifuncmain6pie.o ifuncmod6.so gcctestdir/ld @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ -pie ifuncmain6pie.o ifuncmod6.so -Wl,-R,. @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain7pic.o: ifuncmain7.c -@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fpic -o $@ $< +@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fPIC -o $@ $< @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain7pie.o: ifuncmain7.c -@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fpie -o $@ $< +@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fPIE -o $@ $< @GCC_TRUE@@HAVE_STATIC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain7picstatic: ifuncmain7pic.o gcctestdir/ld @GCC_TRUE@@HAVE_STATIC_TRUE@@IFUNC_STATIC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ -static ifuncmain7pic.o @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain7pic: ifuncmain7pic.o gcctestdir/ld @@ -4974,9 +5035,9 @@ uninstall-am: @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncmain7pie: ifuncmain7pie.o gcctestdir/ld @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ -pie ifuncmain7pie.o @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncvar1_pic.o: ifuncvar1.c -@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fpic -o $@ $< +@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fPIC -o $@ $< @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncvar2_pic.o: ifuncvar2.c -@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fpic -o $@ $< +@GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -c -fPIC -o $@ $< @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncvar.so: ifuncvar1_pic.o ifuncvar2_pic.o gcctestdir/ld @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ -shared ifuncvar1_pic.o ifuncvar2_pic.o @GCC_TRUE@@NATIVE_LINKER_TRUE@strong_ref_weak_def_2.o: strong_ref_weak_def_2.c @@ -5015,6 +5076,30 @@ uninstall-am: @GCC_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ -nostartfiles -nostdlib -T $(srcdir)/memory_test.t -o $@ memory_test.o @GCC_TRUE@@NATIVE_LINKER_TRUE@memory_test.stdout: memory_test @GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) -lWS $< > $@ +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test.o: gdb_index_test.cc +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -O0 -g -gno-pubnames -c -o $@ $< +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_1: gdb_index_test.o gcctestdir/ld +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $< +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_1.stdout: gdb_index_test_1 +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) --debug-dump=gdb_index $< > $@ +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_cdebug.o: gdb_index_test.cc +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -Wa,--compress-debug-sections -c -o $@ $< +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_2: gdb_index_test_cdebug.o gcctestdir/ld +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $< +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_2.stdout: gdb_index_test_2 +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) --debug-dump=gdb_index $< > $@ +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_3.o: gdb_index_test_3.c +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ $(COMPILE) -O0 -g -c -o $@ $< +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_3: gdb_index_test_3.o gcctestdir/ld +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ $(LINK) -Bgcctestdir/ -Wl,--gdb-index,--fatal-warnings $< +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_3.stdout: gdb_index_test_3 +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) --debug-dump=gdb_index $< > $@ +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_pub.o: gdb_index_test.cc +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -O0 -g -gpubnames -c -o $@ $< +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_4: gdb_index_test_pub.o gcctestdir/ld +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--gdb-index $< +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@gdb_index_test_4.stdout: gdb_index_test_4 +@GCC_TRUE@@HAVE_PUBNAMES_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) --debug-dump=gdb_index $< > $@ # End-to-end incremental linking tests. # Incremental linking is currently supported only on the x86_64 target. @@ -5436,7 +5521,7 @@ uninstall-am: @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_AS) -o $@ $< @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_exidx_test.stdout: arm_exidx_test.so -@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_READELF) -S $< > $@ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_READELF) -Sr $< > $@ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_exidx_test.so: arm_exidx_test.o ../ld-new @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ ../ld-new -shared -o $@ $< diff --git a/binutils-2.22/gold/testsuite/gdb_index_test.cc b/binutils-2.22/gold/testsuite/gdb_index_test.cc new file mode 100644 index 0000000..342d47c --- /dev/null +++ b/binutils-2.22/gold/testsuite/gdb_index_test.cc @@ -0,0 +1,138 @@ +// gdb_index_test.cc -- a test case for the --gdb-index option. + +// Copyright 2012 Free Software Foundation, Inc. +// Written by Cary Coutant <ccoutant@google.com>. + +// This file is part of gold. + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, +// MA 02110-1301, USA. + +// This source file defines a number of symbols of different forms +// to exercise the DWARF scanner in gold. + +namespace +{ +int c1_count; +int c2_count; +}; + +namespace one +{ + +enum G +{ + G_A, + G_B, + G_C +}; + +class c1 +{ + public: + static int count; + + c1() + { ++c1_count; } + + ~c1() + { + --c1_count; + } + + enum E + { + E_A, + E_B, + E_C, + }; + + int + val() + { return E_A; } +}; + +c1 c1v; +}; + +namespace two +{ +const int ci = 3; + +template <typename T> +class c2 +{ + public: + c2(T t) + : t_(t) + { + ++c2_count; + } + + ~c2() + { --c2_count; } + + T + val() + { return this->t_; } + + T t_; +}; + +c2<int> c2v1(1); +c2<double> c2v2(2.0); +c2<int const*> c2v3(&ci); +}; + +enum F +{ + F_A, + F_B, + F_C +}; + +template <class C> +bool +check(C* c) +{ return c->val() == 0; } + +bool +check_enum(int i) +{ return i > 0; } + +struct anonymous_union_container { + union { + struct astruct { + int a; + }; + int b; + } u; +}; + +anonymous_union_container anonymous_union_var; + +int +main() +{ + F f = F_A; + one::G g = one::G_A; + check_enum(f); + check_enum(g); + check(&one::c1v); + check(&two::c2v1); + check(&two::c2v2); + check(&two::c2v3); + return anonymous_union_var.u.b; +} diff --git a/binutils-2.22/gold/testsuite/gdb_index_test_1.sh b/binutils-2.22/gold/testsuite/gdb_index_test_1.sh new file mode 100755 index 0000000..f04c8a7 --- /dev/null +++ b/binutils-2.22/gold/testsuite/gdb_index_test_1.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +# gdb_index_test_1.sh -- a test case for the --gdb-index option. + +# Copyright 2012 Free Software Foundation, Inc. +# Written by Cary Coutant <ccoutant@google.com>. + +# This file is part of gold. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, +# MA 02110-1301, USA. + +exec ${srcdir}/gdb_index_test_comm.sh gdb_index_test_1.stdout diff --git a/binutils-2.22/gold/testsuite/gdb_index_test_2.sh b/binutils-2.22/gold/testsuite/gdb_index_test_2.sh new file mode 100755 index 0000000..e31aa42 --- /dev/null +++ b/binutils-2.22/gold/testsuite/gdb_index_test_2.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +# gdb_index_test_2.sh -- a test case for the --gdb-index option. + +# Copyright 2012 Free Software Foundation, Inc. +# Written by Cary Coutant <ccoutant@google.com>. + +# This file is part of gold. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, +# MA 02110-1301, USA. + +exec ${srcdir}/gdb_index_test_comm.sh gdb_index_test_2.stdout diff --git a/binutils-2.22/gold/testsuite/gdb_index_test_3.c b/binutils-2.22/gold/testsuite/gdb_index_test_3.c new file mode 100644 index 0000000..df49261 --- /dev/null +++ b/binutils-2.22/gold/testsuite/gdb_index_test_3.c @@ -0,0 +1,39 @@ +// gdb_index_test.c -- a test case for the --gdb-index option. + +// Copyright 2012 Free Software Foundation, Inc. + +// This file is part of gold. + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, +// MA 02110-1301, USA. + +// This source file is just a simple C source file that is mainly to +// test the CU DW_AT_high_pc FORM encoding is handled correctly by the +// DWARF scanner in gold. + +int check_int (int); +int main (void); + +int j = 0; + +int +check_int (int i) +{ return i > 0; } + +int +main() +{ + return check_int (0); +} diff --git a/binutils-2.22/gold/testsuite/gdb_index_test_3.sh b/binutils-2.22/gold/testsuite/gdb_index_test_3.sh new file mode 100755 index 0000000..bd1500b --- /dev/null +++ b/binutils-2.22/gold/testsuite/gdb_index_test_3.sh @@ -0,0 +1,49 @@ +#!/bin/sh + +# gdb_index_test_3.sh -- a test case for the --gdb-index option. + +# Copyright 2012 Free Software Foundation, Inc. +# Written by Cary Coutant <ccoutant@google.com>. + +# This file is part of gold. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, +# MA 02110-1301, USA. + +check() +{ + if ! grep -q "$2" "$1" + then + echo "Did not find expected output:" + echo " $2" + echo "" + echo "Actual error output below:" + cat "$1" + exit 1 + fi +} + +STDOUT=gdb_index_test_3.stdout + +check $STDOUT "^Version [45]" + +# Look for the symbols we know should be in the symbol table. + +check $STDOUT "^\[ *[0-9]*\] main:" +check $STDOUT "^\[ *[0-9]*\] check_int:" +check $STDOUT "^\[ *[0-9]*\] j:" +check $STDOUT "^\[ *[0-9]*\] int:" + +exit 0 diff --git a/binutils-2.22/gold/testsuite/gdb_index_test_4.sh b/binutils-2.22/gold/testsuite/gdb_index_test_4.sh new file mode 100755 index 0000000..44c8a9a --- /dev/null +++ b/binutils-2.22/gold/testsuite/gdb_index_test_4.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +# gdb_index_test_4.sh -- a test case for the --gdb-index option. + +# Copyright 2012 Free Software Foundation, Inc. +# Written by Cary Coutant <ccoutant@google.com>. + +# This file is part of gold. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, +# MA 02110-1301, USA. + +exec ${srcdir}/gdb_index_test_comm.sh gdb_index_test_4.stdout diff --git a/binutils-2.22/gold/testsuite/gdb_index_test_comm.sh b/binutils-2.22/gold/testsuite/gdb_index_test_comm.sh new file mode 100755 index 0000000..7100329 --- /dev/null +++ b/binutils-2.22/gold/testsuite/gdb_index_test_comm.sh @@ -0,0 +1,84 @@ +#!/bin/sh + +# gdb_index_test_comm.sh -- common code for --gdb-index tests. + +# Copyright 2012 Free Software Foundation, Inc. +# Written by Cary Coutant <ccoutant@google.com>. + +# This file is part of gold. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, +# MA 02110-1301, USA. + +check() +{ + if ! grep -q "$2" "$1" + then + echo "Did not find expected output:" + echo " $2" + echo "" + echo "Actual error output below:" + cat "$1" + exit 1 + fi +} + +STDOUT="$1" + +check $STDOUT "^Version [45]" + +# Look for the symbols we know should be in the symbol table. + +check $STDOUT "^\[ *[0-9]*\] (anonymous namespace):" +check $STDOUT "^\[ *[0-9]*\] (anonymous namespace)::c1_count:" +check $STDOUT "^\[ *[0-9]*\] (anonymous namespace)::c2_count:" +check $STDOUT "^\[ *[0-9]*\] bool:" +check $STDOUT "^\[ *[0-9]*\] check<one::c1>:" +check $STDOUT "^\[ *[0-9]*\] check<two::c2<double> >:" +check $STDOUT "^\[ *[0-9]*\] check<two::c2<int> >:" +# check $STDOUT "^\[ *[0-9]*\] check<two::c2<int const\*> >:" +check $STDOUT "^\[ *[0-9]*\] double:" +check $STDOUT "^\[ *[0-9]*\] F_A:" +check $STDOUT "^\[ *[0-9]*\] F_B:" +check $STDOUT "^\[ *[0-9]*\] F_C:" +check $STDOUT "^\[ *[0-9]*\] int:" +check $STDOUT "^\[ *[0-9]*\] main:" +check $STDOUT "^\[ *[0-9]*\] one:" +check $STDOUT "^\[ *[0-9]*\] one::c1:" +check $STDOUT "^\[ *[0-9]*\] one::c1::~c1:" +check $STDOUT "^\[ *[0-9]*\] one::c1::c1:" +check $STDOUT "^\[ *[0-9]*\] one::c1::val:" +check $STDOUT "^\[ *[0-9]*\] one::c1v:" +check $STDOUT "^\[ *[0-9]*\] one::G_A:" +check $STDOUT "^\[ *[0-9]*\] one::G_B:" +check $STDOUT "^\[ *[0-9]*\] one::G_B:" +check $STDOUT "^\[ *[0-9]*\] two:" +check $STDOUT "^\[ *[0-9]*\] two::c2<double>::~c2:" +check $STDOUT "^\[ *[0-9]*\] two::c2<double>::c2:" +check $STDOUT "^\[ *[0-9]*\] two::c2<double>::val:" +check $STDOUT "^\[ *[0-9]*\] two::c2<double>:" +check $STDOUT "^\[ *[0-9]*\] two::c2<int const\*>:" +check $STDOUT "^\[ *[0-9]*\] two::c2<int const\*>::~c2:" +check $STDOUT "^\[ *[0-9]*\] two::c2<int const\*>::c2:" +check $STDOUT "^\[ *[0-9]*\] two::c2<int const\*>::val:" +check $STDOUT "^\[ *[0-9]*\] two::c2<int>::~c2:" +check $STDOUT "^\[ *[0-9]*\] two::c2<int>::c2:" +check $STDOUT "^\[ *[0-9]*\] two::c2<int>::val:" +check $STDOUT "^\[ *[0-9]*\] two::c2<int>:" +check $STDOUT "^\[ *[0-9]*\] two::c2v1:" +check $STDOUT "^\[ *[0-9]*\] two::c2v2:" +check $STDOUT "^\[ *[0-9]*\] anonymous_union_var:" + +exit 0 diff --git a/binutils-2.22/gold/testsuite/leb128_unittest.cc b/binutils-2.22/gold/testsuite/leb128_unittest.cc new file mode 100644 index 0000000..05c7093 --- /dev/null +++ b/binutils-2.22/gold/testsuite/leb128_unittest.cc @@ -0,0 +1,88 @@ +// leb_unittest.cc -- test read_signed_LEB_128 and read_unsigned_LEB_128 + +// Copyright 2012 Free Software Foundation, Inc. +// Written by Cary Coutant <ccoutant@google.com>. + +// This file is part of gold. + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, +// MA 02110-1301, USA. + +#include "gold.h" + +#include <sys/types.h> + +#include "int_encoding.h" + +#include "test.h" + +namespace gold_testsuite +{ + +using namespace gold; + +bool +Leb128_test(Test_report*) +{ + size_t len; + + // Unsigned tests. + static unsigned char u1[] = { 0 }; // 0 + static unsigned char u2[] = { 1 }; // 1 + static unsigned char u3[] = { 126 }; // 126 + static unsigned char u4[] = { 127 }; // 127 + static unsigned char u5[] = { 0x80+0, 1 }; // 128 + static unsigned char u6[] = { 0x80+1, 1 }; // 129 + static unsigned char u7[] = { 0x80+57, 100 }; // 12857 + static unsigned char u8[] = { 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, + 0x80, 1}; // 1ULL << 63 + + // Signed tests. + static unsigned char s1[] = { 0 }; // 0 + static unsigned char s2[] = { 1 }; // 1 + static unsigned char s3[] = { 0x7e }; // -2 + static unsigned char s4[] = { 0x80+127, 0 }; // 127 + static unsigned char s5[] = { 0x80+1, 0x7f }; // -127 + static unsigned char s6[] = { 0x80+0, 1 }; // 128 + static unsigned char s7[] = { 0x80+0, 0x7f }; // -128 + static unsigned char s8[] = { 0x80+1, 1 }; // 129 + static unsigned char s9[] = { 0xff, 0x7e }; // -129 + + CHECK(read_unsigned_LEB_128(u1, &len) == 0 && len == sizeof(u1)); + CHECK(read_unsigned_LEB_128(u2, &len) == 1 && len == sizeof(u2)); + CHECK(read_unsigned_LEB_128(u3, &len) == 126 && len == sizeof(u3)); + CHECK(read_unsigned_LEB_128(u4, &len) == 127 && len == sizeof(u4)); + CHECK(read_unsigned_LEB_128(u5, &len) == 128 && len == sizeof(u5)); + CHECK(read_unsigned_LEB_128(u6, &len) == 129 && len == sizeof(u6)); + CHECK(read_unsigned_LEB_128(u7, &len) == 12857 && len == sizeof(u7)); + CHECK(read_unsigned_LEB_128(u8, &len) == (1ULL << 63) && len == sizeof(u8)); + + CHECK(read_signed_LEB_128(s1, &len) == 0 && len == sizeof(s1)); + CHECK(read_signed_LEB_128(s2, &len) == 1 && len == sizeof(s2)); + CHECK(read_signed_LEB_128(s3, &len) == -2 && len == sizeof(s3)); + CHECK(read_signed_LEB_128(s4, &len) == 127 && len == sizeof(s4)); + CHECK(read_signed_LEB_128(s5, &len) == -127 && len == sizeof(s5)); + CHECK(read_signed_LEB_128(s6, &len) == 128 && len == sizeof(s6)); + CHECK(read_signed_LEB_128(s7, &len) == -128 && len == sizeof(s7)); + CHECK(read_signed_LEB_128(s8, &len) == 129 && len == sizeof(s8)); + CHECK(read_signed_LEB_128(s9, &len) == -129 && len == sizeof(s9)); + + return true; +} + +Register_test leb128_register("LEB128", Leb128_test); + +} // End namespace gold_testsuite. diff --git a/binutils-2.22/gold/testsuite/plugin_final_layout.cc b/binutils-2.22/gold/testsuite/plugin_final_layout.cc new file mode 100644 index 0000000..3e264f6 --- /dev/null +++ b/binutils-2.22/gold/testsuite/plugin_final_layout.cc @@ -0,0 +1,41 @@ +// plugin_final_layout.cc -- a test case for gold + +// Copyright 2011 Free Software Foundation, Inc. +// Written by Sriraman Tallam <tmsriram@google.com>. + +// This file is part of gold. + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, +// MA 02110-1301, USA. + +// The goal of this program is to verify if section ordering +// via plugins happens correctly. + +void bar () +{ +} + +void baz () +{ +} + +void foo () +{ +} + +int main () +{ + return 0; +} diff --git a/binutils-2.22/gold/testsuite/plugin_final_layout.sh b/binutils-2.22/gold/testsuite/plugin_final_layout.sh new file mode 100755 index 0000000..600f8e2 --- /dev/null +++ b/binutils-2.22/gold/testsuite/plugin_final_layout.sh @@ -0,0 +1,60 @@ +#!/bin/sh + +# plugin_final_layout.sh -- test + +# Copyright 2011 Free Software Foundation, Inc. +# Written by Sriraman Tallam <tmsriram@google.com>. + +# This file is part of gold. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, +# MA 02110-1301, USA. + +# The goal of this program is to verify if --section-ordering-file works as +# intended. File final_layout.cc is in this test. + + +set -e + +check() +{ + awk " +BEGIN { saw1 = 0; saw2 = 0; err = 0; } +/.*$2\$/ { saw1 = 1; } +/.*$3\$/ { + saw2 = 1; + if (!saw1) + { + printf \"layout of $2 and $3 is not right\\n\"; + err = 1; + exit 1; + } + } +END { + if (!saw1 && !err) + { + printf \"did not see $2\\n\"; + exit 1; + } + if (!saw2 && !err) + { + printf \"did not see $3\\n\"; + exit 1; + } + }" $1 +} + +check plugin_final_layout.stdout "_Z3foov" "_Z3barv" +check plugin_final_layout.stdout "_Z3barv" "_Z3bazv" diff --git a/binutils-2.22/gold/testsuite/plugin_section_order.c b/binutils-2.22/gold/testsuite/plugin_section_order.c new file mode 100644 index 0000000..0e2079b --- /dev/null +++ b/binutils-2.22/gold/testsuite/plugin_section_order.c @@ -0,0 +1,167 @@ +/* plugin_section_reorder.c -- Simple plugin to reorder function sections + + Copyright 2011 Free Software Foundation, Inc. + Written by Sriraman Tallam <tmsriram@google.com>. + + This file is part of gold. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <assert.h> +#include "plugin-api.h" + +static ld_plugin_get_input_section_count get_input_section_count = NULL; +static ld_plugin_get_input_section_type get_input_section_type = NULL; +static ld_plugin_get_input_section_name get_input_section_name = NULL; +static ld_plugin_get_input_section_contents get_input_section_contents = NULL; +static ld_plugin_update_section_order update_section_order = NULL; +static ld_plugin_allow_section_ordering allow_section_ordering = NULL; + +enum ld_plugin_status onload(struct ld_plugin_tv *tv); +enum ld_plugin_status claim_file_hook(const struct ld_plugin_input_file *file, + int *claimed); +enum ld_plugin_status all_symbols_read_hook(void); + +/* Plugin entry point. */ +enum ld_plugin_status +onload(struct ld_plugin_tv *tv) +{ + struct ld_plugin_tv *entry; + for (entry = tv; entry->tv_tag != LDPT_NULL; ++entry) + { + switch (entry->tv_tag) + { + case LDPT_REGISTER_CLAIM_FILE_HOOK: + assert((*entry->tv_u.tv_register_claim_file) (claim_file_hook) == LDPS_OK); + break; + case LDPT_REGISTER_ALL_SYMBOLS_READ_HOOK: + assert((*entry->tv_u.tv_register_all_symbols_read) (all_symbols_read_hook) + == LDPS_OK); + break; + case LDPT_GET_INPUT_SECTION_COUNT: + get_input_section_count = *entry->tv_u.tv_get_input_section_count; + break; + case LDPT_GET_INPUT_SECTION_TYPE: + get_input_section_type = *entry->tv_u.tv_get_input_section_type; + break; + case LDPT_GET_INPUT_SECTION_NAME: + get_input_section_name = *entry->tv_u.tv_get_input_section_name; + break; + case LDPT_GET_INPUT_SECTION_CONTENTS: + get_input_section_contents = *entry->tv_u.tv_get_input_section_contents; + break; + case LDPT_UPDATE_SECTION_ORDER: + update_section_order = *entry->tv_u.tv_update_section_order; + break; + case LDPT_ALLOW_SECTION_ORDERING: + allow_section_ordering = *entry->tv_u.tv_allow_section_ordering; + break; + default: + break; + } + } + + if (get_input_section_count == NULL + || get_input_section_type == NULL + || get_input_section_name == NULL + || get_input_section_contents == NULL + || update_section_order == NULL + || allow_section_ordering == NULL) + { + fprintf(stderr, "Some interfaces are missing\n"); + return LDPS_ERR; + } + + return LDPS_OK; +} + +inline static int is_prefix_of(const char *prefix, const char *str) +{ + return strncmp(prefix, str, strlen (prefix)) == 0; +} + +struct ld_plugin_section section_list[3]; +int num_entries = 0; + +/* This function is called by the linker for every new object it encounters. */ +enum ld_plugin_status +claim_file_hook(const struct ld_plugin_input_file *file, int *claimed) +{ + static int is_ordering_specified = 0; + struct ld_plugin_section section; + unsigned int count = 0; + unsigned int shndx; + + *claimed = 0; + if (is_ordering_specified == 0) + { + /* Inform the linker to prepare for section reordering. */ + (*allow_section_ordering)(); + is_ordering_specified = 1; + } + + (*get_input_section_count)(file->handle, &count); + + for (shndx = 0; shndx < count; ++shndx) + { + char *name = NULL; + int position = 3; + + section.handle = file->handle; + section.shndx = shndx; + (*get_input_section_name)(section, &name); + + /* Order is foo() followed by bar() followed by baz() */ + if (is_prefix_of(".text.", name)) + { + if (strstr(name, "_Z3foov") != NULL) + position = 0; + else if (strstr(name, "_Z3barv") != NULL) + position = 1; + else if (strstr(name, "_Z3bazv") != NULL) + position = 2; + else + position = 3; + } + if (position < 3) + { + section_list[position].handle = file->handle; + section_list[position].shndx = shndx; + num_entries++; + } + } + return LDPS_OK; +} + +/* This function is called by the linker after all the symbols have been read. + At this stage, it is fine to tell the linker the desired function order. */ + +enum ld_plugin_status +all_symbols_read_hook(void) +{ + if (num_entries == 3) + update_section_order(section_list, num_entries); + + return LDPS_OK; +} + diff --git a/binutils-2.22/gold/testsuite/plugin_test_2.sh b/binutils-2.22/gold/testsuite/plugin_test_2.sh index a47d22a..293b1f0 100755 --- a/binutils-2.22/gold/testsuite/plugin_test_2.sh +++ b/binutils-2.22/gold/testsuite/plugin_test_2.sh @@ -45,7 +45,7 @@ check plugin_test_2.err "two_file_test_main.o: claim file hook called" check plugin_test_2.err "two_file_test_1.syms: claim file hook called" check plugin_test_2.err "two_file_test_1b.syms: claim file hook called" check plugin_test_2.err "two_file_shared_2.so: claim file hook called" -check plugin_test_2.err "two_file_test_1.syms: _Z4f13iv: PREVAILING_DEF_REG" +check plugin_test_2.err "two_file_test_1.syms: _Z4f13iv: PREVAILING_DEF_IRONLY_EXP" check plugin_test_2.err "two_file_test_1.syms: _Z2t2v: PREVAILING_DEF_REG" check plugin_test_2.err "two_file_test_1.syms: v2: RESOLVED_DYN" check plugin_test_2.err "two_file_test_1.syms: t17data: RESOLVED_DYN" diff --git a/binutils-2.22/gold/testsuite/relro_test.cc b/binutils-2.22/gold/testsuite/relro_test.cc index d741022..795ad39 100644 --- a/binutils-2.22/gold/testsuite/relro_test.cc +++ b/binutils-2.22/gold/testsuite/relro_test.cc @@ -45,6 +45,9 @@ int* const p1 __attribute__ ((aligned(64))) = &i1; // P2 is a local relro variable. int* const p2 __attribute__ ((aligned(64))) = &i2; +// Add a TLS variable to make sure -z relro works correctly with TLS. +__thread int i3 = 1; + // Test symbol addresses. bool @@ -76,6 +79,7 @@ t1() assert(i1page != p2page); assert(i2page != p1page); assert(i2page != p2page); + assert(i3 == 1); return true; } diff --git a/binutils-2.22/gold/testsuite/script_test_2.t b/binutils-2.22/gold/testsuite/script_test_2.t index 73d39df..6a0188f 100644 --- a/binutils-2.22/gold/testsuite/script_test_2.t +++ b/binutils-2.22/gold/testsuite/script_test_2.t @@ -49,7 +49,7 @@ SECTIONS /* This should match the remaining sections. */ *(.gold_test) - . = . + 4; + . = 60; start_data = .; BYTE(1) SHORT(2) diff --git a/binutils-2.22/gold/testsuite/testfile.cc b/binutils-2.22/gold/testsuite/testfile.cc index 93e716a..e963d4d 100644 --- a/binutils-2.22/gold/testsuite/testfile.cc +++ b/binutils-2.22/gold/testsuite/testfile.cc @@ -1,6 +1,6 @@ // testfile.cc -- Dummy ELF objects for testing purposes. -// Copyright 2006, 2007, 2008, 2009, 2011 Free Software Foundation, Inc. +// Copyright 2006, 2007, 2008, 2009, 2011, 2012 Free Software Foundation, Inc. // Written by Ian Lance Taylor <iant@google.com>. // This file is part of gold. @@ -100,6 +100,8 @@ const Target::Target_info Target_test<size, big_endian>::test_target_info = 0x08000000, // default_text_segment_address 0x1000, // abi_pagesize 0x1000, // common_pagesize + false, // isolate_execinstr + 0, // rosegment_gap elfcpp::SHN_UNDEF, // small_common_shndx elfcpp::SHN_UNDEF, // large_common_shndx 0, // small_common_section_flags @@ -154,15 +156,15 @@ class Target_selector_test : public Target_selector : Target_selector(0xffff, size, big_endian, NULL, NULL) { } - Target* + virtual Target* do_instantiate_target() { gold_unreachable(); return NULL; } - Target* - do_recognize(int, int, int) + virtual Target* + do_recognize(Input_file*, off_t, int, int, int) { if (size == 32) { @@ -198,11 +200,11 @@ class Target_selector_test : public Target_selector return NULL; } - Target* + virtual Target* do_recognize_by_name(const char*) { return NULL; } - void + virtual void do_supported_names(std::vector<const char*>*) { } }; diff --git a/binutils-2.22/gold/testsuite/tls_test.cc b/binutils-2.22/gold/testsuite/tls_test.cc index 880bf23..c875752 100644 --- a/binutils-2.22/gold/testsuite/tls_test.cc +++ b/binutils-2.22/gold/testsuite/tls_test.cc @@ -44,8 +44,8 @@ // last Verify that the above tests left the variables set correctly. -#include <cstdio> #include "config.h" +#include <cstdio> #include "tls_test.h" #define CHECK_EQ_OR_RETURN(var, expected) \ diff --git a/binutils-2.22/gold/testsuite/tls_test_c.c b/binutils-2.22/gold/testsuite/tls_test_c.c index 730e46d..896191f 100644 --- a/binutils-2.22/gold/testsuite/tls_test_c.c +++ b/binutils-2.22/gold/testsuite/tls_test_c.c @@ -23,8 +23,8 @@ /* The only way I know to get gcc to generate a TLS common symbol is to use a C file and an OpenMP directive. */ -#include <stdio.h> #include "config.h" +#include <stdio.h> #define CHECK_EQ_OR_RETURN(var, expected) \ do \ |