Fix problem where mixed section types can cause internal error during a -r link.
[deliverable/binutils-gdb.git] / gold / testsuite / Makefile.am
index f9f707efec4afa4d132f264ef80e28f7873d22be..7140df64d0d48dc9346699aee5d9f4414e4c3ab9 100644 (file)
@@ -157,6 +157,10 @@ endif NATIVE_OR_CROSS_LINKER
 if NATIVE_LINKER
 if GCC
 
+# Test empty command line error conditions.
+check_SCRIPTS += empty_command_line_test.sh
+empty_command_line_test.sh: gcctestdir/ld
+
 # Each of these .o's is a useful, small complete program.  They're
 # particularly useful for making sure ld-new's flags do what they're
 # supposed to (hence their names), but are used for many tests that
@@ -174,7 +178,7 @@ incremental_test_1.o: incremental_test_1.c
 incremental_test_2.o: incremental_test_2.c
        $(COMPILE) -O0 -c -ffunction-sections -g -o $@ $<
 incremental_test: incremental_test_1.o incremental_test_2.o gcctestdir/ld
-       $(LINK) -Bgcctestdir/ -Wl,--incremental-full -Wl,-z,norelro incremental_test_1.o incremental_test_2.o -Wl,-debug 2> incremental_test.cmdline
+       $(LINK) -Bgcctestdir/ -Wl,--incremental-full -Wl,-z,norelro,-no-pie incremental_test_1.o incremental_test_2.o -Wl,-debug 2> incremental_test.cmdline
 incremental_test.stdout: incremental_test ../incremental-dump
        ../incremental-dump incremental_test > $@
 
@@ -215,11 +219,21 @@ check_DATA += pr14265.stdout
 MOSTLYCLEANFILES += pr14265
 pr14265.o: pr14265.c
        $(COMPILE) -O0 -c -o $@ $<
-pr14265: pr14265.o
+pr14265: pr14265.o gcctestdir/ld $(srcdir)/pr14265.t
        $(LINK) -Bgcctestdir/ -Wl,--gc-sections -Wl,-T,$(srcdir)/pr14265.t -o $@ $<
 pr14265.stdout: pr14265
        $(TEST_NM) --format=bsd --numeric-sort $< > $@
 
+check_SCRIPTS += pr20717.sh
+check_DATA += pr20717.stdout
+MOSTLYCLEANFILES += pr20717
+pr20717.o: pr20717.c
+       $(COMPILE) -O0 -ffunction-sections -c -o $@ $<
+pr20717: pr20717.o gcctestdir/ld $(srcdir)/pr20717.t
+       $(LINK) -Bgcctestdir/ -Wl,--gc-sections -Wl,-T,$(srcdir)/pr20717.t -o $@ $<
+pr20717.stdout: pr20717
+       $(TEST_NM) $< > $@
+
 check_SCRIPTS += gc_dynamic_list_test.sh
 check_DATA += gc_dynamic_list_test.stdout
 MOSTLYCLEANFILES += gc_dynamic_list_test
@@ -264,6 +278,20 @@ icf_safe_test_1.stdout: icf_safe_test
 icf_safe_test_2.stdout: icf_safe_test
        $(TEST_READELF) -h $< > $@
 
+check_SCRIPTS += icf_safe_pie_test.sh
+check_DATA += icf_safe_pie_test_1.stdout icf_safe_pie_test_2.stdout icf_safe_pie_test.map
+MOSTLYCLEANFILES += icf_safe_pie_test icf_safe_pie_test.map
+icf_safe_pie_test.o: icf_safe_test.cc
+       $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIE -g -o $@ $<
+icf_safe_pie_test: icf_safe_pie_test.o gcctestdir/ld
+       $(CXXLINK) -o icf_safe_pie_test -Bgcctestdir/ -Wl,--icf=safe,-Map,icf_safe_pie_test.map icf_safe_pie_test.o -pie
+icf_safe_pie_test.map: icf_safe_pie_test
+       @touch icf_safe_pie_test.map
+icf_safe_pie_test_1.stdout: icf_safe_pie_test
+       $(TEST_NM) $< > $@
+icf_safe_pie_test_2.stdout: icf_safe_pie_test
+       $(TEST_READELF) -h $< > $@
+
 check_SCRIPTS += icf_safe_so_test.sh
 check_DATA += icf_safe_so_test_1.stdout icf_safe_so_test_2.stdout icf_safe_so_test.map
 MOSTLYCLEANFILES += icf_safe_so_test icf_safe_so_test.map
@@ -316,6 +344,28 @@ section_sorting_name: section_sorting_name.o gcctestdir/ld
 section_sorting_name.stdout: section_sorting_name
        $(TEST_NM) -n --synthetic section_sorting_name > section_sorting_name.stdout
 
+check_SCRIPTS += text_unlikely_segment.sh
+check_DATA += text_unlikely_segment_readelf.stdout
+MOSTLYCLEANFILES += text_unlikely_segment
+text_unlikely_segment.o: text_unlikely_segment.cc
+       $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
+text_unlikely_segment: text_unlikely_segment.o gcctestdir/ld
+       $(CXXLINK)  -Bgcctestdir/ -Wl,-z,text-unlikely-segment text_unlikely_segment.o
+text_unlikely_segment_readelf.stdout: text_unlikely_segment
+       $(TEST_READELF) -Wl $< >$@
+
+check_SCRIPTS += keep_text_section_prefix.sh
+check_DATA += keep_text_section_prefix_readelf.stdout keep_text_section_prefix_nm.stdout
+MOSTLYCLEANFILES += keep_text_section_prefix
+keep_text_section_prefix.o: keep_text_section_prefix.cc
+       $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
+keep_text_section_prefix: keep_text_section_prefix.o gcctestdir/ld
+       $(CXXLINK)  -Bgcctestdir/ -Wl,-z,keep-text-section-prefix keep_text_section_prefix.o
+keep_text_section_prefix_readelf.stdout: keep_text_section_prefix
+       $(TEST_READELF) -Wl $< >$@
+keep_text_section_prefix_nm.stdout: keep_text_section_prefix
+       $(TEST_NM) -n $< >$@
+
 check_PROGRAMS += icf_virtual_function_folding_test
 MOSTLYCLEANFILES += icf_virtual_function_folding_test icf_virtual_function_folding_test.map
 icf_virtual_function_folding_test.o: icf_virtual_function_folding_test.cc
@@ -755,9 +805,9 @@ weak_undef_file1.o: weak_undef_file1.cc
        $(CXXCOMPILE) -c -fpic -o $@ $<
 weak_undef_file2.o: weak_undef_file2.cc
        $(CXXCOMPILE) -c -fpic -o $@ $<
-weak_undef_lib.so: weak_undef_file1.o
+weak_undef_lib.so: weak_undef_file1.o gcctestdir/ld
        $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1.o
-alt/weak_undef_lib.so: weak_undef_file2.o
+alt/weak_undef_lib.so: weak_undef_file2.o gcctestdir/ld
        test -d alt || mkdir -p alt
        $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2.o
 
@@ -848,6 +898,16 @@ copy_test_2_pic.o: copy_test_2.cc
 copy_test_2.so: gcctestdir/ld copy_test_2_pic.o
        $(CXXLINK) -Bgcctestdir/ -shared copy_test_2_pic.o
 
+check_PROGRAMS += copy_test_relro
+copy_test_relro_SOURCES = copy_test_relro.cc
+copy_test_relro_DEPENDENCIES = gcctestdir/ld copy_test_relro_1.so
+copy_test_relro_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -Wl,-z,relro
+copy_test_relro_LDADD = copy_test_relro_1.so
+copy_test_relro_1_pic.o: copy_test_relro_1.cc
+       $(CXXCOMPILE) -c -fpic -o $@ $<
+copy_test_relro_1.so: gcctestdir/ld copy_test_relro_1_pic.o
+       $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro copy_test_relro_1_pic.o
+
 if !DEFAULT_TARGET_POWERPC
 check_SCRIPTS += copy_test_protected.sh
 check_DATA += copy_test_protected.err
@@ -1041,33 +1101,33 @@ x86_64_mov_to_lea7.o: x86_64_mov_to_lea4.s
        $(TEST_AS) --x32 -o $@ $<
 x86_64_mov_to_lea8.o: x86_64_mov_to_lea4.s
        $(TEST_AS) --64 -o $@ $<
-x86_64_mov_to_lea1: x86_64_mov_to_lea1.o
+x86_64_mov_to_lea1: x86_64_mov_to_lea1.o ../ld-new
        ../ld-new -Bsymbolic -shared  -melf_x86_64  -o $@ $<
-x86_64_mov_to_lea2: x86_64_mov_to_lea1.o
+x86_64_mov_to_lea2: x86_64_mov_to_lea1.o ../ld-new
        ../ld-new -pie -melf_x86_64  -o $@ $<
-x86_64_mov_to_lea3: x86_64_mov_to_lea1.o
+x86_64_mov_to_lea3: x86_64_mov_to_lea1.o ../ld-new
        ../ld-new -melf_x86_64  -o $@ $<
-x86_64_mov_to_lea4: x86_64_mov_to_lea2.o
+x86_64_mov_to_lea4: x86_64_mov_to_lea2.o ../ld-new
        ../ld-new -Bsymbolic -shared  -melf32_x86_64  -o $@ $<
-x86_64_mov_to_lea5: x86_64_mov_to_lea2.o
+x86_64_mov_to_lea5: x86_64_mov_to_lea2.o ../ld-new
        ../ld-new -pie -melf32_x86_64  -o $@ $<
-x86_64_mov_to_lea6: x86_64_mov_to_lea2.o
+x86_64_mov_to_lea6: x86_64_mov_to_lea2.o ../ld-new
        ../ld-new -melf32_x86_64  -o $@ $<
-x86_64_mov_to_lea7: x86_64_mov_to_lea3.o
+x86_64_mov_to_lea7: x86_64_mov_to_lea3.o ../ld-new
        ../ld-new -melf32_x86_64 -pie -o $@ $<
-x86_64_mov_to_lea8: x86_64_mov_to_lea4.o
+x86_64_mov_to_lea8: x86_64_mov_to_lea4.o ../ld-new
        ../ld-new -melf_x86_64 -pie -o $@ $<
-x86_64_mov_to_lea9: x86_64_mov_to_lea5.o
+x86_64_mov_to_lea9: x86_64_mov_to_lea5.o ../ld-new
        ../ld-new -melf32_x86_64  -o $@ $<
-x86_64_mov_to_lea10: x86_64_mov_to_lea6.o
+x86_64_mov_to_lea10: x86_64_mov_to_lea6.o ../ld-new
        ../ld-new -melf_x86_64  -o $@ $<
-x86_64_mov_to_lea11: x86_64_mov_to_lea2.o
+x86_64_mov_to_lea11: x86_64_mov_to_lea2.o ../ld-new
        ../ld-new -melf32_x86_64 -shared  -o $@ $<
-x86_64_mov_to_lea12: x86_64_mov_to_lea1.o
+x86_64_mov_to_lea12: x86_64_mov_to_lea1.o ../ld-new
        ../ld-new -melf_x86_64 -shared  -o $@ $<
-x86_64_mov_to_lea13: x86_64_mov_to_lea7.o
+x86_64_mov_to_lea13: x86_64_mov_to_lea7.o ../ld-new
        ../ld-new -melf32_x86_64 -shared  -o $@ $<
-x86_64_mov_to_lea14: x86_64_mov_to_lea8.o
+x86_64_mov_to_lea14: x86_64_mov_to_lea8.o ../ld-new
        ../ld-new -melf_x86_64 -shared  -o $@ $<
 x86_64_mov_to_lea1.stdout: x86_64_mov_to_lea1
        $(TEST_OBJDUMP) -dw $< > $@
@@ -1131,6 +1191,12 @@ x86_64_overflow_pc32.err: x86_64_overflow_pc32.o gcctestdir/ld
          exit 1; \
        fi
 
+check_PROGRAMS += pr17704a_test
+pr17704a_test.o: pr17704a_test.s
+       $(TEST_AS) --64  -o $@ $<
+pr17704a_test: pr17704a_test.o gcctestdir/ld
+       gcctestdir/ld --icf=all -o $@ $<
+
 check_SCRIPTS += x32_overflow_pc32.sh
 check_DATA += x32_overflow_pc32.err
 MOSTLYCLEANFILES += x32_overflow_pc32.err
@@ -1145,6 +1211,32 @@ x32_overflow_pc32.err: x32_overflow_pc32.o gcctestdir/ld
          exit 1; \
        fi
 
+check_SCRIPTS += pr23016_1.sh
+check_DATA += pr23016_1.stdout pr23016_1r.stdout
+pr23016_1.stdout: pr23016_1.o
+       $(TEST_READELF) -rSW $< >$@ 2>/dev/null
+pr23016_1.o: pr23016_1a.o pr23016_1b.o gcctestdir/ld
+       gcctestdir/ld -r -o $@ pr23016_1a.o pr23016_1b.o
+pr23016_1r.stdout: pr23016_1r.o
+       $(TEST_READELF) -rSW $< >$@ 2>/dev/null
+pr23016_1r.o: pr23016_1a.o pr23016_1b.o gcctestdir/ld
+       gcctestdir/ld -r -o $@ pr23016_1b.o pr23016_1a.o
+pr23016_1a.o: pr23016_1a.s
+       $(TEST_AS) -o $@ $<
+pr23016_1b.o: pr23016_1b.s
+       $(TEST_AS) -o $@ $<
+
+check_SCRIPTS += pr23016_2.sh
+check_DATA += pr23016_2.stdout
+pr23016_2.stdout: pr23016_2.o
+       $(TEST_READELF) -rW $< >$@ 2>/dev/null
+pr23016_2.o: pr23016_2a.o pr23016_2b.o gcctestdir/ld
+       gcctestdir/ld -r -o $@ pr23016_2a.o pr23016_2b.o
+pr23016_2a.o: pr23016_2a.s
+       $(TEST_AS) -o $@ $<
+pr23016_2b.o: pr23016_2b.s
+       $(TEST_AS) -o $@ $<
+
 endif DEFAULT_TARGET_X86_64
 
 if DEFAULT_TARGET_X86_64_OR_X32
@@ -1221,21 +1313,21 @@ i386_mov_to_lea4.o: i386_mov_to_lea4.s
        $(TEST_AS) --32 -o $@ $<
 i386_mov_to_lea5.o: i386_mov_to_lea5.s
        $(TEST_AS) --32 -o $@ $<
-i386_mov_to_lea1: i386_mov_to_lea1.o
+i386_mov_to_lea1: i386_mov_to_lea1.o ../ld-new
        ../ld-new -Bsymbolic -shared -melf_i386  -o $@ $<
-i386_mov_to_lea2: i386_mov_to_lea1.o
+i386_mov_to_lea2: i386_mov_to_lea1.o ../ld-new
        ../ld-new  -pie -melf_i386  -o $@ $<
-i386_mov_to_lea3: i386_mov_to_lea1.o
+i386_mov_to_lea3: i386_mov_to_lea1.o ../ld-new
        ../ld-new -melf_i386  -o $@ $<
-i386_mov_to_lea4: i386_mov_to_lea1.o
+i386_mov_to_lea4: i386_mov_to_lea1.o ../ld-new
        ../ld-new -melf_i386 -shared  -o $@ $<
-i386_mov_to_lea5: i386_mov_to_lea2.o
+i386_mov_to_lea5: i386_mov_to_lea2.o ../ld-new
        ../ld-new -melf_i386 -shared  -o $@ $<
-i386_mov_to_lea6: i386_mov_to_lea3.o
+i386_mov_to_lea6: i386_mov_to_lea3.o ../ld-new
        ../ld-new -melf_i386 -shared  -o $@ $<
-i386_mov_to_lea7: i386_mov_to_lea4.o
+i386_mov_to_lea7: i386_mov_to_lea4.o ../ld-new
        ../ld-new -melf_i386 -shared  -o $@ $<
-i386_mov_to_lea8: i386_mov_to_lea5.o
+i386_mov_to_lea8: i386_mov_to_lea5.o ../ld-new
        ../ld-new -melf_i386 -shared  -o $@ $<
 i386_mov_to_lea1.stdout: i386_mov_to_lea1
        $(TEST_OBJDUMP) -dw $< > $@
@@ -1333,6 +1425,16 @@ many_sections_r_test.o: many_sections_test.o gcctestdir/ld
 many_sections_r_test: many_sections_r_test.o gcctestdir/ld
        $(CXXLINK) -Bgcctestdir/ many_sections_r_test.o $(LIBS)
 
+check_SCRIPTS += file_in_many_sections_test.sh
+check_DATA += file_in_many_sections.stdout
+MOSTLYCLEANFILES += file_in_many_sections
+file_in_many_sections.o: file_in_many_sections.c many_sections_define.h
+       $(COMPILE) -c -fdata-sections -o $@ $(srcdir)/file_in_many_sections.c
+file_in_many_sections: file_in_many_sections.o gcctestdir/ld
+       $(LINK) -Bgcctestdir/ file_in_many_sections.o -Wl,--gc-sections
+file_in_many_sections.stdout: file_in_many_sections
+       $(TEST_READELF) -s $< > $@
+
 check_PROGRAMS += initpri1
 initpri1_SOURCES = initpri1.c
 initpri1_DEPENDENCIES = gcctestdir/ld
@@ -1713,6 +1815,11 @@ ver_test_8_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so gc
 ver_test_8_2.so: two_file_test_2_pic.o $(srcdir)/ver_test_8.script gcctestdir/ld
        $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_8.script two_file_test_2_pic.o
 
+check_SCRIPTS += ver_test_8.sh
+check_DATA += ver_test_8_2.so.syms
+ver_test_8_2.so.syms: ver_test_8_2.so
+       $(TEST_READELF) -s $< >$@ 2>/dev/null
+
 check_PROGRAMS += ver_test_9
 ver_test_9_SOURCES = ver_test_main.cc
 ver_test_9_DEPENDENCIES = gcctestdir/ld ver_test_9.so
@@ -1982,6 +2089,17 @@ script_test_12a.o: script_test_12a.c
 script_test_12b.o: script_test_12b.c
        $(COMPILE) -O0 -c -o $@ $<
 
+# Test for ordering internally created sections with a linker script.
+check_SCRIPTS += script_test_13.sh
+check_DATA += script_test_13.stdout
+MOSTLYCLEANFILES += script_test_13
+script_test_13.o: script_test_13.c
+       $(COMPILE) -O0 -c -fPIC -o $@ $<
+script_test_13: $(srcdir)/script_test_13.t script_test_13.o gcctestdir/ld
+       gcctestdir/ld -shared -o $@ script_test_13.o -T $(srcdir)/script_test_13.t
+script_test_13.stdout: script_test_13
+       $(TEST_READELF) -SW script_test_13 > $@
+
 # Test for SORT_BY_INIT_PRIORITY.
 check_SCRIPTS += script_test_14.sh
 check_DATA += script_test_14.stdout
@@ -1993,6 +2111,33 @@ script_test_14: $(srcdir)/script_test_14.t script_test_14.o gcctestdir/ld
 script_test_14.stdout: script_test_14
        $(TEST_OBJDUMP) -s script_test_14 > $@
 
+# Test BSS section placement at end of segment.
+check_SCRIPTS += script_test_15a.sh
+check_DATA += script_test_15a.stdout
+MOSTLYCLEANFILES += script_test_15a
+script_test_15a: $(srcdir)/script_test_15a.t script_test_15.o gcctestdir/ld
+       gcctestdir/ld -o $@ script_test_15.o -T $(srcdir)/script_test_15a.t
+script_test_15a.stdout: script_test_15a
+       $(TEST_READELF) -lSW script_test_15a > $@
+
+# Test BSS section placement in middle of segment.
+check_SCRIPTS += script_test_15b.sh
+check_DATA += script_test_15b.stdout
+MOSTLYCLEANFILES += script_test_15b
+script_test_15b: $(srcdir)/script_test_15b.t script_test_15.o gcctestdir/ld
+       gcctestdir/ld -o $@ script_test_15.o -T $(srcdir)/script_test_15b.t
+script_test_15b.stdout: script_test_15b
+       $(TEST_READELF) -lSW script_test_15b > $@
+
+# Test orphan BSS section placement.
+check_SCRIPTS += script_test_15c.sh
+check_DATA += script_test_15c.stdout
+MOSTLYCLEANFILES += script_test_15c
+script_test_15c: $(srcdir)/script_test_15c.t script_test_15.o gcctestdir/ld
+       gcctestdir/ld -o $@ script_test_15.o -T $(srcdir)/script_test_15c.t
+script_test_15c.stdout: script_test_15c
+       $(TEST_READELF) -lSW script_test_15c > $@
+
 # Test --dynamic-list, --dynamic-list-data, --dynamic-list-cpp-new,
 # and --dynamic-list-cpp-typeinfo
 
@@ -2202,6 +2347,31 @@ plugin_test_thin.a: two_file_test_1.o two_file_test_1b.o two_file_test_2.o
        rm -f $@
        $(TEST_AR) crT $@ $^
 
+check_PROGRAMS += plugin_test_12
+check_SCRIPTS += plugin_test_12.sh
+check_DATA += plugin_test_12.err
+MOSTLYCLEANFILES += plugin_test_12.err
+export_dynamic_plugin.o.syms: export_dynamic_plugin.o
+       $(TEST_READELF) -sW $< >$@ 2>/dev/null
+export_dynamic_plugin.o: export_dynamic_plugin.cc
+       $(COMPILE) -c -o $@ $<
+plugin_test_12: export_dynamic_plugin.o gcctestdir/ld plugin_test.so export_dynamic_plugin.o.syms
+       $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z3foov" -Wl,--export-dynamic-symbol,"_Z3foov" export_dynamic_plugin.o.syms 2>plugin_test_12.err
+plugin_test_12.err: plugin_test_12
+       @touch plugin_test_12.err
+
+check_PROGRAMS += plugin_test_wrap_symbols
+check_SCRIPTS += plugin_test_wrap_symbols.sh
+check_DATA += plugin_test_wrap_symbols.err
+MOSTLYCLEANFILES += plugin_test_wrap_symbols.err
+plugin_test_wrap_symbols_1.o: plugin_test_wrap_symbols_1.cc
+       $(COMPILE) -c -o $@ $<
+plugin_test_wrap_symbols_2.o: plugin_test_wrap_symbols_2.cc
+       $(COMPILE) -c -o $@ $<
+plugin_test_wrap_symbols: plugin_test_wrap_symbols_1.o plugin_test_wrap_symbols_2.o gcctestdir/ld plugin_test.so
+       $(CXXLINK) -Bgcctestdir/ -Wl,--plugin,"./plugin_test.so" -Wl,--wrap=hello,--wrap=jello plugin_test_wrap_symbols_1.o plugin_test_wrap_symbols_2.o 2>plugin_test_wrap_symbols.err
+plugin_test_wrap_symbols.err: plugin_test_wrap_symbols
+       @touch plugin_test_wrap_symbols.err
 
 check_PROGRAMS += plugin_test_start_lib
 check_SCRIPTS += plugin_test_start_lib.sh
@@ -2213,12 +2383,23 @@ plugin_test_start_lib: unused.o plugin_start_lib_test.o plugin_start_lib_test_2.
 plugin_test_start_lib.err: plugin_test_start_lib
        @touch plugin_test_start_lib.err
 
+check_PROGRAMS += plugin_test_defsym
+check_SCRIPTS += plugin_test_defsym.sh
+check_DATA += plugin_test_defsym.err
+MOSTLYCLEANFILES += plugin_test_defsym.err
+plugin_test_defsym.syms: plugin_test_defsym.o
+       $(TEST_READELF) -sW $< >$@ 2>/dev/null
+plugin_test_defsym.o: plugin_test_defsym.c
+       $(COMPILE) -c -o $@ $<
+plugin_test_defsym: plugin_test_defsym.o plugin_test_defsym.syms gcctestdir/ld plugin_test.so
+       $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so" -Wl,--defsym,bar=foo plugin_test_defsym.syms 2>plugin_test_defsym.err
+plugin_test_defsym.err: plugin_test_defsym
+       @touch plugin_test_defsym.err
 
 plugin_start_lib_test_2.syms: plugin_start_lib_test_2.o
        $(TEST_READELF) -sW $< >$@ 2>/dev/null
 
-
-plugin_test.so: plugin_test.o
+plugin_test.so: plugin_test.o gcctestdir/ld
        $(LINK) -Bgcctestdir/ -shared plugin_test.o
 plugin_test.o: plugin_test.c
        $(COMPILE) -O0 -c -fpic -o $@ $<
@@ -2277,11 +2458,28 @@ plugin_final_layout.stdout: plugin_final_layout
 plugin_final_layout_readelf.stdout: plugin_final_layout
        $(TEST_READELF) -Wl plugin_final_layout > plugin_final_layout_readelf.stdout
 
-plugin_section_order.so: plugin_section_order.o
+plugin_section_order.so: plugin_section_order.o gcctestdir/ld
        $(LINK) -Bgcctestdir/ -shared plugin_section_order.o
 plugin_section_order.o: plugin_section_order.c
        $(COMPILE) -O0 -c -fpic -o $@ $<
 
+# Uses the plugin_final_layout.sh script above to avoid duplication
+check_DATA += plugin_layout_new_file.stdout plugin_layout_new_file_readelf.stdout
+MOSTLYCLEANFILES += plugin_layout_new_file
+plugin_final_layout.o.syms: plugin_final_layout.o
+       $(TEST_READELF) -sW $< >$@ 2>/dev/null
+plugin_layout_new_file: plugin_final_layout.o.syms plugin_test.so plugin_new_section_layout.so gcctestdir/ld
+       $(CXXLINK) -Bgcctestdir/ -Wl,--plugin,"./plugin_test.so"  -Wl,--plugin,"./plugin_new_section_layout.so" plugin_final_layout.o.syms
+plugin_layout_new_file.stdout: plugin_layout_new_file
+       $(TEST_NM) -n --synthetic plugin_layout_new_file > plugin_layout_new_file.stdout
+plugin_layout_new_file_readelf.stdout: plugin_layout_new_file
+       $(TEST_READELF) -Wl plugin_layout_new_file > plugin_layout_new_file_readelf.stdout
+
+plugin_new_section_layout.so: plugin_new_section_layout.o gcctestdir/ld
+       $(LINK) -Bgcctestdir/ -shared plugin_new_section_layout.o
+plugin_new_section_layout.o: plugin_new_section_layout.c
+       $(COMPILE) -O0 -c -fpic -o $@ $<
+
 check_SCRIPTS += plugin_layout_with_alignment.sh
 check_DATA += plugin_layout_with_alignment.stdout
 MOSTLYCLEANFILES += plugin_layout_with_alignment
@@ -2292,11 +2490,32 @@ plugin_layout_with_alignment: plugin_layout_with_alignment.o plugin_section_alig
 plugin_layout_with_alignment.stdout: plugin_layout_with_alignment
        $(TEST_NM) -n --synthetic plugin_layout_with_alignment > plugin_layout_with_alignment.stdout
 
-plugin_section_alignment.so: plugin_section_alignment.o
+plugin_section_alignment.so: plugin_section_alignment.o gcctestdir/ld
        $(CXXLINK) -Bgcctestdir/ -shared plugin_section_alignment.o
 plugin_section_alignment.o: plugin_section_alignment.cc
        $(CXXCOMPILE) -O0 -c -fpic -o $@ $<
 
+check_SCRIPTS += plugin_pr22868.sh
+check_DATA += plugin_pr22868.stdout
+MOSTLYCLEANFILES += plugin_pr22868.stdout
+plugin_pr22868.stdout: plugin_pr22868.so
+       $(TEST_READELF) -W --dyn-syms $< >$@ 2>/dev/null
+plugin_pr22868.so: plugin_pr22868_a.o.syms plugin_pr22868_b.o.syms plugin_pr22868_b.o plugin_test.so gcctestdir/ld
+       $(LINK) -Bgcctestdir/ -shared -Wl,--plugin,"./plugin_test.so" plugin_pr22868_a.o.syms plugin_pr22868_b.o.syms
+plugin_pr22868_a.o.syms: plugin_pr22868_a.o
+       $(TEST_READELF) -sW $< >$@ 2>/dev/null
+# Generate the .syms file from an alternate version of the original source
+# file, with a "protected" visibility attribute. We'll link with a
+# "replacement" object that does not have that attribute.
+plugin_pr22868_b.o.syms: plugin_pr22868_b_ir.o
+       $(TEST_READELF) -sW $< >$@ 2>/dev/null
+plugin_pr22868_a.o: plugin_pr22868_a.c
+       $(COMPILE) -c -fpic -o $@ $<
+plugin_pr22868_b_ir.o: plugin_pr22868_b.c
+       $(COMPILE) -c -DIR -fpic -o $@ $<
+plugin_pr22868_b.o: plugin_pr22868_b.c
+       $(COMPILE) -c -fpic -o $@ $<
+
 endif PLUGINS
 
 check_PROGRAMS += exclude_libs_test
@@ -2325,7 +2544,7 @@ alt/libexclude_libs_test_3.a: exclude_libs_test_3.o
 check_PROGRAMS += local_labels_test
 local_labels_test.o: ver_test_6.c
        $(COMPILE) -g -c -Wa,-L -o $@ $<
-local_labels_test: local_labels_test.o
+local_labels_test: local_labels_test.o gcctestdir/ld
        $(LINK) -Bgcctestdir/ local_labels_test.o
 
 check_PROGRAMS += discard_locals_test
@@ -2412,7 +2631,7 @@ check_PROGRAMS += searched_file_test
 MOSTLYCLEANFILES += searched_file_test searched_file_test_lib.o \
                     alt/searched_file_test_lib.a
 searched_file_test_SOURCES = searched_file_test.cc
-searched_file_test_DEPENDENCIES = alt/searched_file_test_lib.a
+searched_file_test_DEPENDENCIES = gcctestdir/ld alt/searched_file_test_lib.a
 searched_file_test_LDFLAGS = -Bgcctestdir/ -Lalt
 searched_file_test_LDADD = -l:searched_file_test_lib.a
 searched_file_test_lib.o: searched_file_test_lib.cc
@@ -2462,6 +2681,11 @@ ifuncmain1static_LDADD = ifuncdep1.o
 check_PROGRAMS += ifuncmain1picstatic
 ifuncmain1picstatic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld
        $(LINK) -Bgcctestdir/ -static ifuncmain1pic.o ifuncmod1.o
+
+check_SCRIPTS += ifuncmod1.sh
+check_DATA += ifuncmod1.so.stderr
+ifuncmod1.so.stderr: ifuncmod1.so
+       $(TEST_READELF) -s $< > /dev/null 2> $@
 endif
 endif
 
@@ -2859,15 +3083,22 @@ defsym_test: defsym_test.o gcctestdir/ld
 defsym_test.o: defsym_test.c
        $(COMPILE) -c -o $@ $<
 
+# Test that the -d option (force common allocation) works correctly.
+check_PROGRAMS += pr20976
+pr20976: pr20976-d.o gcctestdir/ld
+       $(LINK) -Bgcctestdir/ pr20976-d.o
+pr20976-d.o: pr20976.o gcctestdir/ld
+       gcctestdir/ld -r -d -o $@ pr20976.o
+
 # End-to-end incremental linking tests.
 # Incremental linking is currently supported only on the x86_64 target.
 
 if DEFAULT_TARGET_X86_64
 
 two_file_test_1_v1_ndebug.o: two_file_test_1_v1.cc
-       $(CXXCOMPILE) -O0 -g0 -c -o $@ $<
+       $(CXXCOMPILE) -O0 -g0 -fno-exceptions -fno-asynchronous-unwind-tables -c -o $@ $<
 two_file_test_1_ndebug.o: two_file_test_1.cc
-       $(CXXCOMPILE) -O0 -g0 -c -o $@ $<
+       $(CXXCOMPILE) -O0 -g0 -fno-exceptions -fno-asynchronous-unwind-tables -c -o $@ $<
 two_file_test_1b_ndebug.o: two_file_test_1b.cc
        $(CXXCOMPILE) -O0 -g0 -c -o $@ $<
 two_file_test_2_ndebug.o: two_file_test_2.cc
@@ -2880,31 +3111,31 @@ MOSTLYCLEANFILES += two_file_test_tmp_2.o
 incremental_test_2: two_file_test_1_v1_ndebug.o two_file_test_1_ndebug.o two_file_test_1b_ndebug.o \
                    two_file_test_2_ndebug.o two_file_test_main_ndebug.o gcctestdir/ld
        cp -f two_file_test_1_v1_ndebug.o two_file_test_tmp_2.o
-       $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro -Bgcctestdir/ two_file_test_tmp_2.o two_file_test_1b_ndebug.o two_file_test_2_ndebug.o two_file_test_main_ndebug.o
+       $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro,-no-pie -Bgcctestdir/ two_file_test_tmp_2.o two_file_test_1b_ndebug.o two_file_test_2_ndebug.o two_file_test_main_ndebug.o
        @sleep 1
        cp -f two_file_test_1_ndebug.o two_file_test_tmp_2.o
-       $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro -Bgcctestdir/ two_file_test_tmp_2.o two_file_test_1b_ndebug.o two_file_test_2_ndebug.o two_file_test_main_ndebug.o
+       $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie -Bgcctestdir/ two_file_test_tmp_2.o two_file_test_1b_ndebug.o two_file_test_2_ndebug.o two_file_test_main_ndebug.o
 
 check_PROGRAMS += incremental_test_3
 MOSTLYCLEANFILES += two_file_test_tmp_3.o
 incremental_test_3: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \
                    two_file_test_2.o two_file_test_main.o gcctestdir/ld
        cp -f two_file_test_1b_v1.o two_file_test_tmp_3.o
-       $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro -Bgcctestdir/ two_file_test_1.o two_file_test_tmp_3.o two_file_test_2.o two_file_test_main.o
+       $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro,-no-pie -Bgcctestdir/ two_file_test_1.o two_file_test_tmp_3.o two_file_test_2.o two_file_test_main.o
        @sleep 1
        cp -f two_file_test_1b.o two_file_test_tmp_3.o
-       $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro -Bgcctestdir/ two_file_test_1.o two_file_test_tmp_3.o two_file_test_2.o two_file_test_main.o
+       $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie -Bgcctestdir/ two_file_test_1.o two_file_test_tmp_3.o two_file_test_2.o two_file_test_main.o
 
 check_PROGRAMS += incremental_test_4
 MOSTLYCLEANFILES += incremental_test_4.base two_file_test_tmp_4.o
 incremental_test_4: two_file_test_1.o two_file_test_1b.o two_file_test_2_v1.o \
                    two_file_test_2.o two_file_test_main.o gcctestdir/ld
        cp -f two_file_test_2_v1.o two_file_test_tmp_4.o
-       $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro -Bgcctestdir/ two_file_test_1.o two_file_test_1b.o two_file_test_tmp_4.o two_file_test_main.o
+       $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro,-no-pie -Bgcctestdir/ two_file_test_1.o two_file_test_1b.o two_file_test_tmp_4.o two_file_test_main.o
        mv -f incremental_test_4 incremental_test_4.base
        @sleep 1
        cp -f two_file_test_2.o two_file_test_tmp_4.o
-       $(CXXLINK) -Wl,--incremental-update,--incremental-base=incremental_test_4.base -Wl,-z,norelro -Bgcctestdir/ two_file_test_1.o two_file_test_1b.o two_file_test_tmp_4.o two_file_test_main.o
+       $(CXXLINK) -Wl,--incremental-update,--incremental-base=incremental_test_4.base -Wl,-z,norelro,-no-pie -Bgcctestdir/ two_file_test_1.o two_file_test_1b.o two_file_test_tmp_4.o two_file_test_main.o
 
 check_PROGRAMS += incremental_test_5
 MOSTLYCLEANFILES += two_file_test_5.a
@@ -2912,11 +3143,11 @@ incremental_test_5: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \
                    two_file_test_2.o two_file_test_main.o gcctestdir/ld
        cp -f two_file_test_1b_v1.o two_file_test_tmp_5.o
        $(TEST_AR) rc two_file_test_5.a two_file_test_1.o two_file_test_tmp_5.o two_file_test_2.o
-       $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro -Bgcctestdir/ two_file_test_main.o two_file_test_5.a
+       $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro,-no-pie -Bgcctestdir/ two_file_test_main.o two_file_test_5.a
        @sleep 1
        cp -f two_file_test_1b.o two_file_test_tmp_5.o
        $(TEST_AR) rc two_file_test_5.a two_file_test_1.o two_file_test_tmp_5.o two_file_test_2.o
-       $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro -Bgcctestdir/ two_file_test_main.o two_file_test_5.a
+       $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie -Bgcctestdir/ two_file_test_main.o two_file_test_5.a
 
 # Test the --incremental-unchanged flag with an archive library.
 # The second link should not update the library.
@@ -2926,38 +3157,38 @@ incremental_test_6: two_file_test_1.o two_file_test_1b_v1.o two_file_test_1b.o \
                    two_file_test_2.o two_file_test_main.o gcctestdir/ld
        cp -f two_file_test_1b.o two_file_test_tmp_6.o
        $(TEST_AR) rc two_file_test_6.a two_file_test_1.o two_file_test_tmp_6.o two_file_test_2.o
-       $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro -Bgcctestdir/ two_file_test_main.o two_file_test_6.a
+       $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro,-no-pie -Bgcctestdir/ two_file_test_main.o two_file_test_6.a
        @sleep 1
        cp -f two_file_test_1b_v1.o two_file_test_tmp_6.o
        $(TEST_AR) rc two_file_test_6.a two_file_test_1.o two_file_test_tmp_6.o two_file_test_2.o
-       $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro -Bgcctestdir/ two_file_test_main.o -Wl,--incremental-unchanged two_file_test_6.a -Wl,--incremental-unknown
+       $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie -Bgcctestdir/ two_file_test_main.o -Wl,--incremental-unchanged two_file_test_6.a -Wl,--incremental-unknown
 
 check_PROGRAMS += incremental_copy_test
 incremental_copy_test: copy_test_v1.o copy_test.o copy_test_1.so copy_test_2.so
        cp -f copy_test_v1.o copy_test_tmp.o
-       $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro -Bgcctestdir/ -Wl,-R,. -Wl,--no-as-needed copy_test_tmp.o copy_test_1.so copy_test_2.so
+       $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro,-no-pie -Bgcctestdir/ -Wl,-R,. -Wl,--no-as-needed copy_test_tmp.o copy_test_1.so copy_test_2.so
        @sleep 1
        cp -f copy_test.o copy_test_tmp.o
-       $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro -Bgcctestdir/ -Wl,-R,. -Wl,--no-as-needed copy_test_tmp.o copy_test_1.so copy_test_2.so
+       $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie -Bgcctestdir/ -Wl,-R,. -Wl,--no-as-needed copy_test_tmp.o copy_test_1.so copy_test_2.so
 
 check_PROGRAMS += incremental_common_test_1
 incremental_common_test_1: common_test_1_v1.o common_test_1_v2.o gcctestdir/ld
        cp -f common_test_1_v1.o common_test_1_tmp.o
-       $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro -Bgcctestdir/ common_test_1_tmp.o
+       $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro,-no-pie -Bgcctestdir/ common_test_1_tmp.o
        @sleep 1
        cp -f common_test_1_v2.o common_test_1_tmp.o
-       $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro -Bgcctestdir/ common_test_1_tmp.o
+       $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie -Bgcctestdir/ common_test_1_tmp.o
 
 check_PROGRAMS += incremental_comdat_test_1
 incremental_comdat_test_1: incr_comdat_test_1.o incr_comdat_test_2_v1.o incr_comdat_test_2_v2.o incr_comdat_test_2_v3.o gcctestdir/ld
        cp -f incr_comdat_test_2_v1.o incr_comdat_test_1_tmp.o
-       $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o
+       $(CXXLINK) -Wl,--incremental-full,--incremental-patch=100 -Wl,-z,norelro,-no-pie -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o
        @sleep 1
        cp -f incr_comdat_test_2_v2.o incr_comdat_test_1_tmp.o
-       $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o
+       $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o
        @sleep 1
        cp -f incr_comdat_test_2_v3.o incr_comdat_test_1_tmp.o
-       $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o
+       $(CXXLINK) -Wl,--incremental-update -Wl,-z,norelro,-no-pie -Bgcctestdir/ incr_comdat_test_1.o incr_comdat_test_1_tmp.o
 
 endif DEFAULT_TARGET_X86_64
 
@@ -2965,7 +3196,7 @@ if DEFAULT_TARGET_X86_64
 check_PROGRAMS += exception_x86_64_bnd_test
 exception_x86_64_bnd_test_SOURCES = exception_test_main.cc
 exception_x86_64_bnd_test_DEPENDENCIES = gcctestdir/ld exception_x86_64_bnd_1.o exception_x86_64_bnd_2.o
-exception_x86_64_bnd_test_LDFLAGS = $(exception_test_LDFLAGS)
+exception_x86_64_bnd_test_LDFLAGS = $(exception_test_LDFLAGS) -Wl,-z,bndplt
 exception_x86_64_bnd_test_LDADD = exception_x86_64_bnd_1.o exception_x86_64_bnd_2.o
 exception_x86_64_bnd_1.o: exception_test_1.cc gcctestdir/as
        $(CXXCOMPILE) -c -fpic -Bgcctestdir/ -Wa,-madd-bnd-prefix -o $@ $<
@@ -2973,6 +3204,12 @@ exception_x86_64_bnd_2.o: exception_test_2.cc gcctestdir/as
        $(CXXCOMPILE) -c -Bgcctestdir/ -Wa,-madd-bnd-prefix -o $@ $<
 endif DEFAULT_TARGET_X86_64
 
+check_PROGRAMS += pr22266
+pr22266: pr22266_main.o pr22266_ar.o gcctestdir/ld
+       $(LINK) -Bgcctestdir/ pr22266_main.o pr22266_ar.o
+pr22266_ar.o: pr22266_a.o gcctestdir/ld
+       gcctestdir/ld -r -T $(srcdir)/pr22266_script.t -o $@ pr22266_a.o
+
 endif GCC
 endif NATIVE_LINKER
 
@@ -3065,6 +3302,33 @@ split_x86_64_r.stdout: split_x86_64_1.o split_x86_64_n.o ../ld-new
 MOSTLYCLEANFILES += split_x86_64_1 split_x86_64_2 split_x86_64_3 \
        split_x86_64_4 split_x86_64_r
 
+check_SCRIPTS += bnd_plt_1.sh
+check_DATA += bnd_plt_1.stdout
+bnd_plt_1.o: bnd_plt_1.s
+       $(TEST_AS) --64 -o $@ $<
+bnd_plt_1.so: bnd_plt_1.o ../ld-new
+       ../ld-new -shared -z bndplt bnd_plt_1.o -o $@
+bnd_plt_1.stdout: bnd_plt_1.so
+       $(TEST_OBJDUMP) -dw $< > $@
+
+check_SCRIPTS += bnd_ifunc_1.sh
+check_DATA += bnd_ifunc_1.stdout
+bnd_ifunc_1.o: bnd_ifunc_1.s
+       $(TEST_AS) --64 -madd-bnd-prefix -o $@ $<
+bnd_ifunc_1.so: bnd_ifunc_1.o ../ld-new
+       ../ld-new -shared -z bndplt bnd_ifunc_1.o -o $@
+bnd_ifunc_1.stdout: bnd_ifunc_1.so
+       $(TEST_OBJDUMP) -dw $< > $@
+
+check_SCRIPTS += bnd_ifunc_2.sh
+check_DATA += bnd_ifunc_2.stdout
+bnd_ifunc_2.o: bnd_ifunc_2.s
+       $(TEST_AS) --64 -madd-bnd-prefix -o $@ $<
+bnd_ifunc_2.so: bnd_ifunc_2.o ../ld-new
+       ../ld-new -shared -z bndplt bnd_ifunc_2.o -o $@
+bnd_ifunc_2.stdout: bnd_ifunc_2.so
+       $(TEST_OBJDUMP) -dw $< > $@
+
 endif DEFAULT_TARGET_X86_64
 
 if DEFAULT_TARGET_X32
@@ -3287,7 +3551,7 @@ check_DATA += arm_attr_merge_6.stdout arm_attr_merge_6r.stdout \
 arm_attr_merge_6.stdout: arm_attr_merge_6
        $(TEST_READELF) -A $< > $@
 
-arm_attr_merge_6: arm_attr_merge_6a.o arm_attr_merge_6b.o
+arm_attr_merge_6: arm_attr_merge_6a.o arm_attr_merge_6b.o ../ld-new
        ../ld-new -o $@ arm_attr_merge_6a.o arm_attr_merge_6b.o
 
 arm_attr_merge_6a.o: arm_attr_merge_6a.s
@@ -3299,13 +3563,13 @@ arm_attr_merge_6b.o: arm_attr_merge_6b.s
 arm_attr_merge_6r.stdout: arm_attr_merge_6r
        $(TEST_READELF) -A $< > $@
 
-arm_attr_merge_6r: arm_attr_merge_6b.o arm_attr_merge_6a.o
+arm_attr_merge_6r: arm_attr_merge_6b.o arm_attr_merge_6a.o ../ld-new
        ../ld-new -o $@ arm_attr_merge_6b.o arm_attr_merge_6a.o
 
 arm_attr_merge_7.stdout: arm_attr_merge_7
        $(TEST_READELF) -A $< > $@
 
-arm_attr_merge_7: arm_attr_merge_7a.o arm_attr_merge_7b.o
+arm_attr_merge_7: arm_attr_merge_7a.o arm_attr_merge_7b.o ../ld-new
        ../ld-new -o $@ arm_attr_merge_7a.o arm_attr_merge_7b.o
 
 arm_attr_merge_7a.o: arm_attr_merge_7a.s
@@ -3578,6 +3842,38 @@ arm_farcall_thumb_thumb_6m.o: arm_farcall_thumb_thumb.s
 MOSTLYCLEANFILES += arm_farcall_thumb_thumb arm_farcall_thumb_thumb_5t \
                    arm_farcall_thumb_thumb_7m arm_farcall_thumb_thumb_6m
 
+#Check ARM to ARM farcall veneers in the be8 mode addressing
+
+check_SCRIPTS += arm_farcall_arm_arm_be8.sh
+check_DATA += arm_farcall_arm_arm_be8.stdout
+
+arm_farcall_arm_arm_be8.stdout: arm_farcall_arm_arm_be8
+       $(TEST_OBJDUMP) -D $< > $@
+
+arm_farcall_arm_arm_be8: arm_farcall_arm_arm_be8.o ../ld-new
+       ../ld-new --no-fix-arm1176 --section-start .text=0x1000 --section-start .foo=0x2001020 -EB --be8 -o $@ $<
+
+arm_farcall_arm_arm_be8.o: arm_farcall_arm_arm.s
+       $(TEST_AS) -EB -o $@ $<
+
+MOSTLYCLEANFILES += arm_farcall_arm_arm_be8
+
+#Check THUMB  to  THUMB farcall veneers in the be8 mode addressing
+
+check_SCRIPTS += arm_farcall_thumb_thumb_be8.sh
+check_DATA += arm_farcall_thumb_thumb_be8.stdout
+
+arm_farcall_thumb_thumb_be8.stdout: arm_farcall_thumb_thumb_be8
+       $(TEST_OBJDUMP) -D $< > $@
+
+arm_farcall_thumb_thumb_be8: arm_farcall_thumb_thumb_be8.o ../ld-new
+       ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -EB --be8 -o $@ $<
+
+arm_farcall_thumb_thumb_be8.o: arm_farcall_thumb_thumb.s
+       $(TEST_AS) -march=armv7-m -EB -o $@ $<
+
+MOSTLYCLEANFILES += arm_farcall_thumb_thumb_be8
+
 # Check Thumb to ARM farcall veneers
 
 check_SCRIPTS += arm_farcall_thumb_arm.sh
@@ -3650,6 +3946,14 @@ arm_target2.o: arm_target2.s
 MOSTLYCLEANFILES += arm_target1_abs arm_target1_rel \
                    arm_target2_rel arm_target2_abs arm_target2_got_rel
 
+# The test demonstrates why the constructor of a target object should not access options.
+check_DATA += arm_target_lazy_init
+MOSTLYCLEANFILES += arm_target_lazy_init
+arm_target_lazy_init: arm_target_lazy_init.o arm_target_lazy_init.t ../ld-new
+       ../ld-new -T $(srcdir)/arm_target_lazy_init.t -o $@ $<
+arm_target_lazy_init.o: arm_target_lazy_init.s
+       $(TEST_AS) -EL -o $@ $<
+
 endif DEFAULT_TARGET_ARM
 
 if DEFAULT_TARGET_AARCH64
@@ -3678,6 +3982,28 @@ aarch64_relocs.stdout: aarch64_relocs
 
 MOSTLYCLEANFILES += aarch64_relocs
 
+check_SCRIPTS += pr21430.sh
+check_DATA += pr21430.stdout
+pr21430.o: pr21430.s
+       $(TEST_AS) -o $@ $<
+pr21430: pr21430.o ../ld-new
+       ../ld-new -o $@ $<
+pr21430.stdout: pr21430
+       $(TEST_NM) -S $< > $@
+
+MOSTLYCLEANFILES += pr21430
+
+check_SCRIPTS += aarch64_tlsdesc.sh
+check_DATA += aarch64_tlsdesc.stdout
+aarch64_tlsdesc.o: aarch64_tlsdesc.s
+       $(TEST_AS) -o $@ $<
+aarch64_tlsdesc: aarch64_tlsdesc.o $(srcdir)/aarch64_tlsdesc.t ../ld-new
+       ../ld-new $< -shared -T $(srcdir)/aarch64_tlsdesc.t -o $@
+aarch64_tlsdesc.stdout: aarch64_tlsdesc
+       $(TEST_OBJDUMP) -dR -j.text -j.got.plt $< > $@
+
+MOSTLYCLEANFILES += aarch64_tlsdesc
+
 endif DEFAULT_TARGET_AARCH64
 
 if DEFAULT_TARGET_S390
This page took 0.036317 seconds and 4 git commands to generate.