From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1256) id 124873858C33; Thu, 15 Jun 2023 03:48:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 124873858C33 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Maciej W. Rozycki To: bfd-cvs@sourceware.org Subject: [binutils-gdb] Revert "MIPS: fix some ld testcases with compiler" X-Act-Checkin: binutils-gdb X-Git-Author: Maciej W. Rozycki X-Git-Refname: refs/heads/master X-Git-Oldrev: 0c5c669cefa7aea782abe98d5455cb7f54bbe944 X-Git-Newrev: 0b46c1ec2d7d008d9650f0438835804b6b7b344c Message-Id: <20230615034843.124873858C33@sourceware.org> Date: Thu, 15 Jun 2023 03:48:43 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jun 2023 03:48:43 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D0b46c1ec2d7d= 008d9650f0438835804b6b7b344c commit 0b46c1ec2d7d008d9650f0438835804b6b7b344c Author: Maciej W. Rozycki Date: Thu Jun 15 04:45:03 2023 +0100 Revert "MIPS: fix some ld testcases with compiler" =20 This reverts commit a0631c1501c113c04891c9a24a9ff5276257f28d. It was applied unapproved. Diff: --- ld/testsuite/config/default.exp | 20 +------------------- ld/testsuite/ld-elf/indirect.exp | 8 ++------ ld/testsuite/ld-elf/pr23658-2.rd | 2 +- ld/testsuite/ld-elf/shared.exp | 12 +++--------- ld/testsuite/ld-elfvers/vers.exp | 12 +++++------- ld/testsuite/ld-gc/gc.exp | 5 ----- ld/testsuite/ld-mips-elf/mips-elf.exp | 2 +- ld/testsuite/ld-plugin/lto.exp | 11 +---------- ld/testsuite/ld-plugin/plugin.exp | 15 --------------- ld/testsuite/ld-selective/selective.exp | 2 +- ld/testsuite/ld-shared/shared.exp | 4 +--- 11 files changed, 16 insertions(+), 77 deletions(-) diff --git a/ld/testsuite/config/default.exp b/ld/testsuite/config/default.= exp index 1bc8760e72b..5c925476e23 100644 --- a/ld/testsuite/config/default.exp +++ b/ld/testsuite/config/default.exp @@ -155,7 +155,7 @@ if {! [info exists env(CCC_OVERRIDE_OPTIONS)]} { # installed, but to the O32 ABI in the build tree, because of some # specs-file hacks. Make sure we use an ABI that is compatible with # the one we expect. -if {[istarget mips*64*-*-linux*] && ![istarget mips*64*-*-linux-gnuabi64] = && +if {[istarget mips64*-*-linux*] && (![board_info [target_info name] exists multilib_flags] || ![string match "*-mabi" [board_info [target_info name] multilib_flags= ]]) } { @@ -263,24 +263,6 @@ proc ld_exec { target output } { default_ld_exec $target $output } =20 -# -# xfail_from_runlist -# mark a test xfail and remove it from the runlist -proc xfail_from_runlist { runlist name } { - set i 0 - set rtl $runlist - foreach t $runlist { - set tn [lindex $t 0] - if [string equal $name $tn] { - xfail $tn - set rtl [lreplace $rtl $i $i] - } - incr i - } - return $rtl -} - - # From gas-defs.exp, to support run_dump_test. if ![info exists AS] then { set AS $as diff --git a/ld/testsuite/ld-elf/indirect.exp b/ld/testsuite/ld-elf/indirec= t.exp index dfbb097378b..ce4771371dd 100644 --- a/ld/testsuite/ld-elf/indirect.exp +++ b/ld/testsuite/ld-elf/indirect.exp @@ -219,9 +219,7 @@ proc check_dynamic_syms { test } { =20 foreach t [list indirect5a indirect5b indirect6a indirect6b] { set testname [concat $t "dynsym"] - if { [istarget mips*] } { - xfail $testname - } elseif { [check_dynamic_syms tmpdir/$t] } { + if { [check_dynamic_syms tmpdir/$t] } { pass $testname } else { fail $testname @@ -254,9 +252,7 @@ run_ld_link_exec_tests $pie_tests =20 foreach t [list indirect5c indirect5d indirect6c indirect6d] { set testname [concat $t "dynsym"] - if { [istarget mips*] } { - xfail $testname - } elseif { [check_dynamic_syms tmpdir/$t] } { + if { [check_dynamic_syms tmpdir/$t] } { pass $testname } else { fail $testname diff --git a/ld/testsuite/ld-elf/pr23658-2.rd b/ld/testsuite/ld-elf/pr23658= -2.rd index e414ae3250d..9f89c4b40ae 100644 --- a/ld/testsuite/ld-elf/pr23658-2.rd +++ b/ld/testsuite/ld-elf/pr23658-2.rd @@ -1,5 +1,5 @@ #... - +[0-9]+ +(\.MIPS\.abiflags \.MIPS\.options \.dynamic \.hash \.dynsym \.dy= nstr \.text |)\.interp \.note.4 \.note.1 \.note.2 \.note.3.* + +[0-9]+ +\.interp \.note.4 \.note.1 \.note.2 \.note.3.* #... +[0-9]+ +\.note\.4 \.note\.1 + +[0-9]+ +\.note\.2 .note\.3 + diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp index 2019275dda3..1eef9f45667 100644 --- a/ld/testsuite/ld-elf/shared.exp +++ b/ld/testsuite/ld-elf/shared.exp @@ -774,6 +774,9 @@ set build_tests { {"Build libpr16496b.a" "" "-fPIC" {pr16496b.c} {} "libpr16496b.a"} + {"Build libpr16496b.so" + "-shared -Wl,--no-as-needed tmpdir/pr16496b.o tmpdir/libpr16496a.so" "" + {dummy.c} {{objdump {-R} pr16496b.od}} "libpr16496b.so"} {"Build libpr16452a.so" "-shared -Wl,-soname,libpr16452a.so,--version-script=3Dpr16452.map" "-f= PIC" {pr16452a.c} {} "libpr16452a.so"} @@ -794,15 +797,6 @@ set build_tests { {pr18458b.c} {} "libpr18458b.so"} } =20 -# MIPS PIC uses different way: .MIPS.stub -if { ![istarget mips*-linux*] } { - append build_tests { - {"Build libpr16496b.so" - "-shared -Wl,--no-as-needed tmpdir/pr16496b.o tmpdir/libpr16496a.so" "" - {dummy.c} {{objdump {-R} pr16496b.od}} "libpr16496b.so"} - } -} - run_cc_link_tests [list \ [list \ "Build libpr2404a.so" \ diff --git a/ld/testsuite/ld-elfvers/vers.exp b/ld/testsuite/ld-elfvers/ver= s.exp index 2ab5487d440..b266cc0226f 100644 --- a/ld/testsuite/ld-elfvers/vers.exp +++ b/ld/testsuite/ld-elfvers/vers.exp @@ -801,13 +801,13 @@ build_exec "vers3" vers3.c vers3 "-Wl,--no-as-needed"= vers1.so vers3.ver vers3.d =20 # This test fails on MIPS. On the MIPS we must put foo in the dynamic # symbol table, which the test does not expect. -setup_xfail "mips*-*-irix*" "mips*-linux-*" +setup_xfail "mips*-*-irix*" build_exec "vers4" vers4.c vers4 "" "" "" "" vers4.sym =20 build_exec "vers4a" vers4.c vers4a "-Wl,-export-dynamic" "" vers4a.ver ver= s4a.dsym vers4a.sym =20 # Verify that --no-export-dynamic undoes the effect of --export-dynamic. -setup_xfail "mips*-*-irix*" "mips*-linux-*" +setup_xfail "mips*-*-irix*" build_exec "vers4b" vers4.c vers4b "-Wl,-export-dynamic -Wl,--no-export-dy= namic" "" "" "" vers4.sym =20 =20 @@ -932,20 +932,18 @@ set as_pic_flags "" if [istarget sparc*-*-*] { set as_pic_flags "-K PIC" } -if { ![istarget mips*-*-*] } { - run_ld_link_tests [list "\"vers24a\" +run_ld_link_tests [list "\"vers24a\" \"-shared --version-script $srcdir/$subdir/vers24.map\" \"\" \"$as_pic_flags $as_options\" {vers24a.c vers24b.c} { { readelf -Wrs v= ers24.rd } } \"libvers24a.so\" \"-fpic\""] - run_ld_link_tests [list "\"vers24b\" +run_ld_link_tests [list "\"vers24b\" \"-shared --version-script $srcdir/$subdir/vers24.map\" \"\" \"$as_pic_flags $as_options\" {vers24b.c vers24a.c} { { readelf -Wrs v= ers24.rd } } \"libvers24b.so\" \"-fpic\""] - run_ld_link_tests [list "\"vers24c\" +run_ld_link_tests [list "\"vers24c\" \"-shared --version-script $srcdir/$subdir/vers24.map\" \"\" \"$as_pic_flags $as_options\" {vers24c.c} { { readelf -Wrs vers24.rd }= } \"libvers24c.so\" \"-fpic\""] -} =20 # Test versioned definition vs. normal definition in different files. if [string match "yes" $pic] then { diff --git a/ld/testsuite/ld-gc/gc.exp b/ld/testsuite/ld-gc/gc.exp index e342c3ba2fe..bca0397ee02 100644 --- a/ld/testsuite/ld-gc/gc.exp +++ b/ld/testsuite/ld-gc/gc.exp @@ -151,10 +151,6 @@ if { [check_compiler_available] } { } } =20 -set save_asflags $ASFLAGS -if { [istarget "mips*-*-linux*"] } { - append ASFLAGS " -KPIC" -} set symdefs "" if [is_pecoff_format] { set symdefs {{ld {--defsym __main=3Dmain --defsym ___main=3Dmain}}} @@ -178,7 +174,6 @@ if { [check_compiler_available] } { } run_dump_test "pr19161" $symdefs } -set ASFLAGS $save_asflags =20 if { [is_elf_format] && [check_shared_lib_support] \ && [check_compiler_available] } { diff --git a/ld/testsuite/ld-mips-elf/mips-elf.exp b/ld/testsuite/ld-mips-e= lf/mips-elf.exp index 4565bc9570c..ee0522b073f 100644 --- a/ld/testsuite/ld-mips-elf/mips-elf.exp +++ b/ld/testsuite/ld-mips-elf/mips-elf.exp @@ -1101,7 +1101,7 @@ if { $has_abi(o32) } { } =20 run_dump_test_o32 "mips16-local-stubs-1" -run_dump_test_n32 "mips16-local-stubs-1" noarch +run_dump_test_n32 "mips16-local-stubs-1" =20 set mips16_fp_stub_test [list \ [list "Floating-point stub for mips16 functions" \ diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp index a4b546d4253..e7e7952bb1b 100644 --- a/ld/testsuite/ld-plugin/lto.exp +++ b/ld/testsuite/ld-plugin/lto.exp @@ -557,7 +557,7 @@ if { ! [istarget "arm*-*-*"] } { # when using the LTO plugin. The HPPA target however requires an # executable stack for syscall restarts and signal returns, so we # skip this test for that target. -if { ! [istarget "hppa*-*-*"] && ! [istarget "mips*-linux*"] } { +if { ! [istarget "hppa*-*-*"] } { lappend lto_link_elf_tests \ [list "PR ld/12982" \ "-O2 -flto -fuse-linker-plugin" "-O2 -flto" \ @@ -909,10 +909,6 @@ if { [at_least_gcc_version 4 7] } { } } =20 -set save_asflags $ASFLAGS -if { [istarget "mips*-*-linux*"] } { - append ASFLAGS " -KPIC" -} # Run "ld -r" to generate inputs for complex LTO tests. run_dump_test "lto-3r" remote_exec host "mv" "tmpdir/dump tmpdir/lto-3.o" @@ -926,12 +922,7 @@ run_ld_link_tests [list \ "-r tmpdir/pr19317.o" "" "" \ {dummy.s} {} "pr19317-r.o"] \ ] -set ASFLAGS $save_asflags =20 -if { [istarget "mips*-*-linux*"] } { - set lto_run_tests [xfail_from_runlist $lto_run_tests "PR ld/15323 (4)"] - set lto_run_tests [xfail_from_runlist $lto_run_tests "PR ld/19317 (3)"] -} run_ld_link_exec_tests $lto_run_tests =20 if { [is_elf_format] } { diff --git a/ld/testsuite/ld-plugin/plugin.exp b/ld/testsuite/ld-plugin/plu= gin.exp index ce7d406c998..bbb8cedbc2c 100644 --- a/ld/testsuite/ld-plugin/plugin.exp +++ b/ld/testsuite/ld-plugin/plugin.exp @@ -295,15 +295,6 @@ if { !$can_compile || $failed_compile } { return } =20 -if { [istarget "mips*-*-linux*"] } { - set plugin_tests [xfail_from_runlist $plugin_tests "plugin claimfile los= t symbol"] - set plugin_tests [xfail_from_runlist $plugin_tests "plugin claimfile rep= lace symbol"] - set plugin_tests [xfail_from_runlist $plugin_tests "plugin claimfile res= olve symbol"] - set plugin_tests [xfail_from_runlist $plugin_tests "plugin claimfile los= t symbol with source"] - set plugin_tests [xfail_from_runlist $plugin_tests "plugin claimfile rep= lace symbol with source"] - set plugin_tests [xfail_from_runlist $plugin_tests "plugin claimfile res= olve symbol with source"] - set plugin_tests [xfail_from_runlist $plugin_tests "plugin claimfile res= olve symbol with source"] -} run_ld_link_tests $plugin_tests =20 if { [is_elf_format] \ @@ -364,12 +355,6 @@ if { [regexp "0+ T func" "$plugin_nm_output"] && =20 # Check if ar --plugin works. file delete tmpdir/libfunc.a -if { [istarget "mips*-*-linux*"] } { - set plugin_src_tests [xfail_from_runlist $plugin_src_tests "plugin 2 wit= h source lib"] - set plugin_src_tests [xfail_from_runlist $plugin_src_tests "load plugin = 2 with source"] - set plugin_src_tests [xfail_from_runlist $plugin_src_tests "plugin 3 wit= h source lib"] - set plugin_src_tests [xfail_from_runlist $plugin_src_tests "load plugin = 3 with source"] -} if [ar_simple_create $ar "--plugin $plugin2_path" "tmpdir/libfunc.a" \ "tmpdir/main.o $srcdir/$subdir/func.c"] { set testname "ar --plugin" diff --git a/ld/testsuite/ld-selective/selective.exp b/ld/testsuite/ld-sele= ctive/selective.exp index 2531a5e5df8..813a52d54de 100644 --- a/ld/testsuite/ld-selective/selective.exp +++ b/ld/testsuite/ld-selective/selective.exp @@ -52,7 +52,7 @@ set ldflags "--gc-sections -Bstatic" =20 if [istarget mips*-*] { # MIPS16 doesn't support PIC code. - set cflags "-mno-abicalls -fno-PIC $cflags" + set cflags "-mno-abicalls $cflags" # MIPS ELF uses __start by default, we override it. set ldflags "-e _start $ldflags" } diff --git a/ld/testsuite/ld-shared/shared.exp b/ld/testsuite/ld-shared/sha= red.exp index 3b0adddf023..f56e42f667b 100644 --- a/ld/testsuite/ld-shared/shared.exp +++ b/ld/testsuite/ld-shared/shared.exp @@ -220,7 +220,7 @@ if ![ld_compile "$CC_FOR_TARGET $SHCFLAG" $srcdir/$subd= ir/main.c $tmpdir/mainnp. || ![ld_compile "$CC_FOR_TARGET $PLT_CFLAGS $SHCFLAG" $srcdir/$subdir/sh= 2.c $tmpdir/sh2np.o] } { unsupported "shared (non PIC)" } else { if { [is_xcoff_format] } { - shared_test shnp "shared (non PIC)" mainnp.o sh1np.o sh2np.o xcoff + shared_test shnp "shared (nonPIC)" mainnp.o sh1np.o sh2np.o xcoff } else { # Solaris defaults to -z text. setup_xfail "*-*-solaris2*" @@ -242,7 +242,6 @@ if ![ld_compile "$CC_FOR_TARGET $SHCFLAG" $srcdir/$subd= ir/main.c $tmpdir/mainnp. setup_xfail "arm*-*-linux*" } setup_xfail "aarch64*-*-linux*" - setup_xfail "mips*-*-linux*" shared_test shnp "shared (non PIC)" mainnp.o sh1np.o sh2np.o shared =20 # Test ELF shared library relocations with a non-zero load @@ -324,7 +323,6 @@ if ![ld_compile "$CC_FOR_TARGET $SHCFLAG $picflag" $src= dir/$subdir/main.c $tmpdi setup_xfail "arm*-*-linux*" } setup_xfail "aarch64*-*-linux*" - setup_xfail "mips*-*-linux*" shared_test shmpnp "shared (PIC main, non PIC so)" mainp.o sh1np.o sh= 2np.o shared } } else {