From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2117.outbound.protection.outlook.com [40.107.215.117]) by sourceware.org (Postfix) with ESMTPS id A6F093884599 for ; Fri, 16 Jun 2023 06:34:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A6F093884599 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=cipunited.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cipunited.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IEry9fBBLvsEdHk9yQtjRRWgCT1y9pFIfeCjGuGYJuEQdQVBd+A3ySCXHhEo1smZTguUkMKwV+Xf5MVeXp4VRSfFiZjMiItCnEFNxcoKuAuTY51Ems9KP1DjsFS5BMC0YpZG996tILf5FLCjcUce+Jhu8HBvZIg1sj8M8YsZavmhzhhon98hGqmq38WeI4b77EnvlujnP61rynK8w3QfiJ1365sqyc/Yp0MtFZ5a4ySHXcQErUt9TXpPPOLz7lT0otSUJzK6Gi7+PPritgTTFBFnbGFKo3lc1uvaBm3QTzf8xl0c9xVKL11Ch5BgOge4lXQ1L2sbwpJ69S8J+4uyqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EAs39tU9FlL8LRRGl9VcDe5DbGsxO68/EtxXTiU1So0=; b=lKMDyZGySowWv++XY+jn55qmKoR2+2ZoZbxTEjcekhev0HsCsRuuiyFKDowHfU23wkNfQ/J9smDdDWmXcS6kP7MlQjNG1JXvvSA0lHLGiWPOg54S0623a1za7xroa5XP5Du8gQP98tHeUMQVxGyiZeqNWdt7asYfLTMuPG1yfbnEhs/9kETozJQsCtWCYVQblAO/ZClUzSMOMAaIEQu6qbFt03INdHL95OF/tl4x6ynkp9+OauQIAX2xd3TYoV7FJWmeZc+sK0nT/e/rvq0SI94bWSy/ozHmNZJzfVTTX+rAdM5/6zqPOmBPa3YCwdBq1wNyUmeAkisZYAk4wYzqsw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cipunited.com; dmarc=pass action=none header.from=cipunited.com; dkim=pass header.d=cipunited.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cipunited.onmicrosoft.com; s=selector1-cipunited-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EAs39tU9FlL8LRRGl9VcDe5DbGsxO68/EtxXTiU1So0=; b=tgExO736dLt/uqPBhKvGsY0W/GZJ+6fPgqis5Nrtae4uy8XzoeNM4F4M5/G1SyMwRanpQrq2gLU+UrIfkpvSrMh5Gc3prC6OPK3ODfao4M01WiYLydQVsB0/SMDCfHSMJGKSC4j6VY9scPQJB5WfPgkCG88dQLn7l9uCE+rLA6U= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=cipunited.com; Received: from SEZPR04MB6121.apcprd04.prod.outlook.com (2603:1096:101:98::10) by TYUPR04MB6911.apcprd04.prod.outlook.com (2603:1096:400:350::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.44; Fri, 16 Jun 2023 06:34:53 +0000 Received: from SEZPR04MB6121.apcprd04.prod.outlook.com ([fe80::8969:4dde:3fc5:33c9]) by SEZPR04MB6121.apcprd04.prod.outlook.com ([fe80::8969:4dde:3fc5:33c9%4]) with mapi id 15.20.6500.026; Fri, 16 Jun 2023 06:34:53 +0000 From: YunQiang Su To: binutils@sourceware.org Cc: macro@orcam.me.uk, paul.hua.gm@gmail.com, amodra@gmail.com, jbeulich@suse.com, YunQiang Su Subject: [PATCH v4 5/7] MIPS: Fix some ld testcases with compiler Date: Fri, 16 Jun 2023 14:34:10 +0800 Message-Id: <20230616063412.1715024-6-yunqiang.su@cipunited.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230616063412.1715024-1-yunqiang.su@cipunited.com> References: <20230616063412.1715024-1-yunqiang.su@cipunited.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR01CA0014.apcprd01.prod.exchangelabs.com (2603:1096:4:191::17) To SEZPR04MB6121.apcprd04.prod.outlook.com (2603:1096:101:98::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR04MB6121:EE_|TYUPR04MB6911:EE_ X-MS-Office365-Filtering-Correlation-Id: fc0b51df-159c-41d9-d857-08db6e33caeb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jIE4Ol0JdeMnC/eIGRJz73YVPLUyqqie2+ktHgck904UVR78U0sU8MrOXR421nKk4OkXwEfb7VI5kMHyvi5z2S1LjVxE9ljflTfDNhiNDRv6aKwq0jr4zdnn9Urf3OiUxlxgeQbEptETtc+gKm3Caz6qxbe2hVX6OAEe0wPmguyCeA3BsSYuZsq6My3bzr0ZSZSSHSfp7OgZRfVxLQOWCthjHzbOGpPsax+9HlO4TUka2IlGMMlGjx+XVan+Rov9+j6BxdEPkEL2prEbVc0aBR/Rh02PoyL7AKVilRySvOHhDKc6zGlYNM29MD3ZuWtfsiq+6MfKtuUPdpmhAEZnOR8Fj79K+RWPeOEiWxp49CInJSesQnvGhnnolbBjEe2iYN+zdD0TuECo8wgiicCMez+RnRMp1L4sqgRDEiF5z+SOkkyMG1dpLffsmMv6pbAIc/ACVFHjQtG3CH/c0xH8OTB0CCWsw/ParN/uRCRKKvbDuKlTJOCek3YEfNooVyeQJwpgoLUfUIUEbFFk4ZE6sVDFJjaYeEXdWXy5jdKeEy0kh5DLYk2Y54lTJX+sNHmG1G1NMnV2WWInHJRXLMn9+7P+FQUTkqZ4ZV8Lsp/gUCN7KDJi20mqYD3dYUPeYwdT X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR04MB6121.apcprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(396003)(39830400003)(366004)(346002)(376002)(451199021)(36756003)(186003)(30864003)(2906002)(83380400001)(26005)(1076003)(6512007)(6506007)(66946007)(52116002)(41300700001)(6486002)(107886003)(316002)(8676002)(8936002)(5660300002)(86362001)(66476007)(2616005)(66556008)(4326008)(6916009)(38350700002)(38100700002)(478600001)(6666004);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ImpJuxWItvj/smD9yCU8YAsNH7PlEq6/QgGn55P972WrZH7cFpL8ZcuoAjMX?= =?us-ascii?Q?4fuFS0ElwTDCUPbtIuEOMvnWf6E0XN7U0AKkw7tZtD9h8f6+S5mW0xFDcJuT?= =?us-ascii?Q?9cei0LtR9s8iKWL3GjuKmp+LhvpjYn/HKfjRMDCOFt2wBX25XNWtrfb4b9AM?= =?us-ascii?Q?Gf5lP1yCCxZ4FXmaCrI8geFIzFyqPtqMIAtNGRgZabl+GOpjqkLgcRBBt7mU?= =?us-ascii?Q?AwsMRUnzC7ecnoty3jIVPqyaORtVa1om6l6ZruteUyqhgxa+JEzomnrMS7jo?= =?us-ascii?Q?4Z/brH2AxS4wbKfJPb3s0gbfUI2DWIjMAhyusVYARvfkW3QJPW4UF/GCfXuN?= =?us-ascii?Q?olvp4WFMrrR9eCq9qzyOgpWjaLieKsB5eyoDelfXOUgqFc8DvluAUqcrR90T?= =?us-ascii?Q?kPt7Zqk75fpTLk2xNtpyNUsFeCJcD7pcMsH3DdbH+7UWftzd5HTqQjW1iTDF?= =?us-ascii?Q?8drGFhIO+NUr4uSTSzJlCeshNwpQxs1CetEpp77wv8UpJYJfpe2OmDE/TaWK?= =?us-ascii?Q?5M45cjkZScglyr5J67x7X9SMcs6xut+E8LiFqzPDIz4s+EAv7MErL9SKHozz?= =?us-ascii?Q?455PzBLyGHhYn8z+yrI0MHC0VSE72zByC1LyzVkhoEy97i3I7BaefHoXzkvu?= =?us-ascii?Q?XicbeoqsPZeWi7uaZFvBEd5eI5Gf8Odsc3UgvfjkxpYbBOabXFkodkms1F3X?= =?us-ascii?Q?5MYpYQ2A0D/LuY0nRPbbWy+ENulLj6i9auy80gsYe9XTGnwWqCHBwJyXLBSP?= =?us-ascii?Q?+T8rEy43iA1Tojsr7ZicKjUQcrnTr+Tal88zO3q1u+UYVaKAu21wt8JDUdWI?= =?us-ascii?Q?nT3xFB46oAeXHF8K1IB7FO8IUMZBpl575/WSfrUsqLvmqz30QeLcufKlay41?= =?us-ascii?Q?siECFHnWqpCTFzqUFqxX5OlcHmEsqvX4TilE4ASObiVtxTwRTFTCfzmFs1fG?= =?us-ascii?Q?ABkflf5fwVuYYoPcyDeCsSpFqvnSKGTZYGurPYiO1SfJEb+NV5VUr4eDeZt3?= =?us-ascii?Q?qssVfIdyE09UK3l4s1CcHFo8hSPzM8its8rGc3mADMLhpLBq9sEzWag+B2iW?= =?us-ascii?Q?FV3ZayDwsGJs6F58e8WyiXlvj2f/QY16NQT34M9xm+VqFLHSNFfX2iy0HQEr?= =?us-ascii?Q?SGPLBqoXkH/p0pf/59YpCZXXzfn95596XvvXo8ECH3qTGomVeU0RgCGZz2c5?= =?us-ascii?Q?DD1cH7uHZNppSJJiOraXk/lttjQWrfG7DUxYYI2gVg65Tf13lz8fjeX385zN?= =?us-ascii?Q?0QjFOvEvrH0Jr0nX8e4QWg14ei1ThJB0ChWJQ46KJpci6ZLKr9+qS7I9pyrZ?= =?us-ascii?Q?PYU202M7i9im3wt7/rAfwH2li/zrJ/5hqChZB/FC5d7SC7PdAYGz2X46tbA2?= =?us-ascii?Q?RjkFgeXmoOhIbI5sr22W5QN/e7DFL8A3F18jso34A5AatMDrrfBzHxj8U9HF?= =?us-ascii?Q?/h9sO5oBfWg6QvaHcq30NtqJgm61kQJD7/zoi3HmShr2YQWoySNYKiO/ykSH?= =?us-ascii?Q?HKwP8fSw05IBwvw8rNm1gZjk2QeqJ9lGkAZ3Dxs15F4m2y43STpzD3iUiVuy?= =?us-ascii?Q?I/sVndlm0FFDGh+zBdXtoM9qeqN093CQ4I8Ehhj9WJwSLbh+nK1xTRW90C/5?= =?us-ascii?Q?GQ=3D=3D?= X-OriginatorOrg: cipunited.com X-MS-Exchange-CrossTenant-Network-Message-Id: fc0b51df-159c-41d9-d857-08db6e33caeb X-MS-Exchange-CrossTenant-AuthSource: SEZPR04MB6121.apcprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2023 06:34:53.2257 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e31cf5b5-ee69-4d5f-9c69-edeeda2458c0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: QB3hLXTzde3ZAmFzH7BG+s9UHPAHTfN0f1AASIVVPO2ms+n2NWp4+CB2+EsZf+bqS3yKBbhiyFa5fdkIYfn607cZzkyN164lafh6+viCFjY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYUPR04MB6911 X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 1. config/default.exp: use -mabi=32 not for -gnuabi64; xfail_from_runlist: remove an element and mark it xfail. 2. ld-elf/indirect.exp: xfail indirect5a, indirect5b, indirect6a, indirect6b, indirect5c, indirect5d, indirect6c, indirect6d. 3. ld-elf/pr23658-2: mips output is not common. 4. ld-elf/shared.exp: non-run on mips: Build libpr16496b.so. 5. ld-elfvers/vers.exp: xfail vers4, vers4b; no-run on mips: vers24a, vers24b, vers24c. 6. ld-gc/gc.exp: add -KPIC into asflags for pr13683, pr14265, pr19161. 7. ld-mips-elf/mips-elf.exp: use noarch for mips16-local-stubs-1, since it use -mips4. 8. ld-plugin/lto.exp: no-run on mips/linux: PR ld/12982; add -KPIC into asflags for lto-3r, lto-5r, PR ld/19317 (2); xfail PR ld/15323 (4), PR ld/19317 (3). 9. ld-plugin/plugin.exp: xfail plugin claimfile lost symbol, plugin claimfile replace symbol, plugin claimfile replace symbol, plugin claimfile lost symbol with source, plugin claimfile replace symbol with source, plugin claimfile resolve symbol with source, plugin 2 with source lib, load plugin 2 with source, plugin 3 with source lib, load plugin 3 with source. 11. ld-selective/selective.exp: add -fno-PIC, which is needed for -mno-abicalls. 12. ld-shared/shared.exp: xfail shared (non PIC), shared (PIC main, non PIC so). --- 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, 77 insertions(+), 16 deletions(-) diff --git a/ld/testsuite/config/default.exp b/ld/testsuite/config/default.exp index 5c925476e23..1bc8760e72b 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 mips64*-*-linux*] && +if {[istarget mips*64*-*-linux*] && ![istarget mips*64*-*-linux-gnuabi64] && (![board_info [target_info name] exists multilib_flags] || ![string match "*-mabi" [board_info [target_info name] multilib_flags]]) } { @@ -263,6 +263,24 @@ proc ld_exec { target output } { default_ld_exec $target $output } +# +# 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/indirect.exp index ce4771371dd..dfbb097378b 100644 --- a/ld/testsuite/ld-elf/indirect.exp +++ b/ld/testsuite/ld-elf/indirect.exp @@ -219,7 +219,9 @@ proc check_dynamic_syms { test } { foreach t [list indirect5a indirect5b indirect6a indirect6b] { set testname [concat $t "dynsym"] - if { [check_dynamic_syms tmpdir/$t] } { + if { [istarget mips*] } { + xfail $testname + } elseif { [check_dynamic_syms tmpdir/$t] } { pass $testname } else { fail $testname @@ -252,7 +254,9 @@ run_ld_link_exec_tests $pie_tests foreach t [list indirect5c indirect5d indirect6c indirect6d] { set testname [concat $t "dynsym"] - if { [check_dynamic_syms tmpdir/$t] } { + if { [istarget mips*] } { + xfail $testname + } elseif { [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 9f89c4b40ae..e414ae3250d 100644 --- a/ld/testsuite/ld-elf/pr23658-2.rd +++ b/ld/testsuite/ld-elf/pr23658-2.rd @@ -1,5 +1,5 @@ #... - +[0-9]+ +\.interp \.note.4 \.note.1 \.note.2 \.note.3.* + +[0-9]+ +(\.MIPS\.abiflags \.MIPS\.options \.dynamic \.hash \.dynsym \.dynstr \.text |)\.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 1eef9f45667..2019275dda3 100644 --- a/ld/testsuite/ld-elf/shared.exp +++ b/ld/testsuite/ld-elf/shared.exp @@ -774,9 +774,6 @@ 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=pr16452.map" "-fPIC" {pr16452a.c} {} "libpr16452a.so"} @@ -797,6 +794,15 @@ set build_tests { {pr18458b.c} {} "libpr18458b.so"} } +# 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/vers.exp index b266cc0226f..2ab5487d440 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 # 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*" +setup_xfail "mips*-*-irix*" "mips*-linux-*" build_exec "vers4" vers4.c vers4 "" "" "" "" vers4.sym build_exec "vers4a" vers4.c vers4a "-Wl,-export-dynamic" "" vers4a.ver vers4a.dsym vers4a.sym # Verify that --no-export-dynamic undoes the effect of --export-dynamic. -setup_xfail "mips*-*-irix*" +setup_xfail "mips*-*-irix*" "mips*-linux-*" build_exec "vers4b" vers4.c vers4b "-Wl,-export-dynamic -Wl,--no-export-dynamic" "" "" "" vers4.sym @@ -932,18 +932,20 @@ set as_pic_flags "" if [istarget sparc*-*-*] { set as_pic_flags "-K PIC" } -run_ld_link_tests [list "\"vers24a\" +if { ![istarget mips*-*-*] } { + run_ld_link_tests [list "\"vers24a\" \"-shared --version-script $srcdir/$subdir/vers24.map\" \"\" \"$as_pic_flags $as_options\" {vers24a.c vers24b.c} { { readelf -Wrs vers24.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 vers24.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\""] +} # 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 bca0397ee02..e342c3ba2fe 100644 --- a/ld/testsuite/ld-gc/gc.exp +++ b/ld/testsuite/ld-gc/gc.exp @@ -151,6 +151,10 @@ if { [check_compiler_available] } { } } +set save_asflags $ASFLAGS +if { [istarget "mips*-*-linux*"] } { + append ASFLAGS " -KPIC" +} set symdefs "" if [is_pecoff_format] { set symdefs {{ld {--defsym __main=main --defsym ___main=main}}} @@ -174,6 +178,7 @@ if { [check_compiler_available] } { } run_dump_test "pr19161" $symdefs } +set ASFLAGS $save_asflags 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-elf/mips-elf.exp index ee0522b073f..4565bc9570c 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) } { } run_dump_test_o32 "mips16-local-stubs-1" -run_dump_test_n32 "mips16-local-stubs-1" +run_dump_test_n32 "mips16-local-stubs-1" noarch 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 e7e7952bb1b..a4b546d4253 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*-*-*"] } { +if { ! [istarget "hppa*-*-*"] && ! [istarget "mips*-linux*"] } { lappend lto_link_elf_tests \ [list "PR ld/12982" \ "-O2 -flto -fuse-linker-plugin" "-O2 -flto" \ @@ -909,6 +909,10 @@ if { [at_least_gcc_version 4 7] } { } } +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" @@ -922,7 +926,12 @@ run_ld_link_tests [list \ "-r tmpdir/pr19317.o" "" "" \ {dummy.s} {} "pr19317-r.o"] \ ] +set ASFLAGS $save_asflags +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 if { [is_elf_format] } { diff --git a/ld/testsuite/ld-plugin/plugin.exp b/ld/testsuite/ld-plugin/plugin.exp index bbb8cedbc2c..ce7d406c998 100644 --- a/ld/testsuite/ld-plugin/plugin.exp +++ b/ld/testsuite/ld-plugin/plugin.exp @@ -295,6 +295,15 @@ if { !$can_compile || $failed_compile } { return } +if { [istarget "mips*-*-linux*"] } { + set plugin_tests [xfail_from_runlist $plugin_tests "plugin claimfile lost symbol"] + set plugin_tests [xfail_from_runlist $plugin_tests "plugin claimfile replace symbol"] + set plugin_tests [xfail_from_runlist $plugin_tests "plugin claimfile resolve symbol"] + set plugin_tests [xfail_from_runlist $plugin_tests "plugin claimfile lost symbol with source"] + set plugin_tests [xfail_from_runlist $plugin_tests "plugin claimfile replace symbol with source"] + set plugin_tests [xfail_from_runlist $plugin_tests "plugin claimfile resolve symbol with source"] + set plugin_tests [xfail_from_runlist $plugin_tests "plugin claimfile resolve symbol with source"] +} run_ld_link_tests $plugin_tests if { [is_elf_format] \ @@ -355,6 +364,12 @@ if { [regexp "0+ T func" "$plugin_nm_output"] && # 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 with 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 with 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-selective/selective.exp index 813a52d54de..2531a5e5df8 100644 --- a/ld/testsuite/ld-selective/selective.exp +++ b/ld/testsuite/ld-selective/selective.exp @@ -52,7 +52,7 @@ set ldflags "--gc-sections -Bstatic" if [istarget mips*-*] { # MIPS16 doesn't support PIC code. - set cflags "-mno-abicalls $cflags" + set cflags "-mno-abicalls -fno-PIC $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/shared.exp index f56e42f667b..3b0adddf023 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/$subdir/main.c $tmpdir/mainnp. || ![ld_compile "$CC_FOR_TARGET $PLT_CFLAGS $SHCFLAG" $srcdir/$subdir/sh2.c $tmpdir/sh2np.o] } { unsupported "shared (non PIC)" } else { if { [is_xcoff_format] } { - shared_test shnp "shared (nonPIC)" mainnp.o sh1np.o sh2np.o xcoff + shared_test shnp "shared (non PIC)" mainnp.o sh1np.o sh2np.o xcoff } else { # Solaris defaults to -z text. setup_xfail "*-*-solaris2*" @@ -242,6 +242,7 @@ if ![ld_compile "$CC_FOR_TARGET $SHCFLAG" $srcdir/$subdir/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 # Test ELF shared library relocations with a non-zero load @@ -323,6 +324,7 @@ if ![ld_compile "$CC_FOR_TARGET $SHCFLAG $picflag" $srcdir/$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 sh2np.o shared } } else { -- 2.30.2