From patchwork Thu Feb 2 03:09:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 51640 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp6721wrn; Wed, 1 Feb 2023 19:10:05 -0800 (PST) X-Google-Smtp-Source: AK7set8s7kbb807bzvhLzsDpqvFlMDxTmBz7xuCnHAHRvFZmfMn2+TTdB25Kn0lsMmu3u1LazQ4r X-Received: by 2002:a05:6402:b31:b0:49e:a080:d55f with SMTP id bo17-20020a0564020b3100b0049ea080d55fmr4265725edb.18.1675307404911; Wed, 01 Feb 2023 19:10:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675307404; cv=none; d=google.com; s=arc-20160816; b=azFaxpxVL5g+NCUuJk+n66uPhRKMuW0gc9zlDCrZ4RdsVP2fXVyShkBm2aamAsYL6X q7bGlqg2y38aYk0svUNmISbDVl/7mxx+DC2YpFPllIswU+zzqYrfZUeNDPjJ+ik+8X7N XGJJ34xORQStVDQEmKnEieJ3C43kpv5OQ0MOnLVDErPeX0/iJBgBTl/zSmQqOIZo69Lg d60izQBWpN4w7lVTPSiK5q9jrUPQunPiKp7gjNnf3AolXE1uJnRKkf/UNQwl7Sx3v77h GYr8OXY6hI9D3rXXQ/2lO4hHQLzIGvzshbul26GdXWMKz1r32SBr17274kHUr1o6t6zC 2o6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-disposition:mime-version:message-id:subject:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=aBQMPeXA4Jvu861DTQZTu/r4zMivP9Wex3TSjjUub6k=; b=iJTHXqfBOVLm+rph68IKJFcGkNtx8WdUPn6qB4C812GAtJED3IH0F0KV8dXUa1v55I ogrAmgPaE6pSpkUUxwxHAAs9lvlS2YHQHf+WaM7BBkn6nwuk0FNq3RlRYcxDwzKW2P73 mnCuikuFJJEBOJe1Sl79zqbKyyPjb1qxlJBPwQIkN/ukrDLPLLtWA6VqfLGKp9z0f4Pd SSbCJBtWd2DAEVU6Ud5LztXripIP/xQpDq7VBNtNxsX/Z+3WvNQt7HyE1peT3B8s9col v/ePNWUghDBh8AYwvAKrtsTy7DYYyPPUe97n35J6ao9t2AnEvbUoj4ZWR5K3AoVeLzRs OaBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=uJ8Zxnfa; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id x2-20020a056402414200b004a20a775cd8si22384863eda.298.2023.02.01.19.10.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 19:10:04 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=uJ8Zxnfa; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E2BFD3858C2C for ; Thu, 2 Feb 2023 03:10:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E2BFD3858C2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675307403; bh=aBQMPeXA4Jvu861DTQZTu/r4zMivP9Wex3TSjjUub6k=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=uJ8Zxnfam2cUiro+LzMXTZI74i9ZY8MGYqhkfP+3rZwc5nLsyvWcpxZS0XAaRiWbb cU4J3XK8Of0LzrVvEEpnpypj3UJYOK1iMS/DGKsfPWiueuLLabc+wIKzfdpUV76fy3 qzsPEEpDSQDUSamTEpdXu7wkG7ieiwXfiR4iJpfo= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by sourceware.org (Postfix) with ESMTPS id 7C4FE3858C2C for ; Thu, 2 Feb 2023 03:09:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7C4FE3858C2C Received: by mail-pl1-x629.google.com with SMTP id be8so536765plb.7 for ; Wed, 01 Feb 2023 19:09:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aBQMPeXA4Jvu861DTQZTu/r4zMivP9Wex3TSjjUub6k=; b=5aal9bBj0lPPuIFSs6iQptKJ3a0xyLIO+rzdXFTozHPikMInsMAsAa3y5aHE/nX9ur +/2tRMQPeFkKETuFaSa4ERX1XU8UcjhWvY2jU7694XBCGt86cWy0tglzd2U0n4LEsU8G qMYF2ZJQ7aXixT2emks4vizovtrAChrhtcuS3wd1HMY0ogE6afnlnzobi5LYWXoVZvAt 29DayEB5PMj8fX7m5P1Y1lLM6QheLai13XxDlrejhqDkHwdsjNyI268DYBgD2CQLAd84 UzeOGCvwEX4iIQoYCdIIHv351ev3xKdvI2FmxGgvcfmKStqknVI2zXcfupBqL4wmF4oy kjXA== X-Gm-Message-State: AO0yUKUSJcmpaKJZA0z/uQP/H6iNRVNBzbKRI083EA71ZVknpnjHvAK7 gDCaadtezX0e1EVtcEDPJ+cjwWfjOUQ= X-Received: by 2002:a17:902:e752:b0:198:999e:4f8 with SMTP id p18-20020a170902e75200b00198999e04f8mr6272511plf.5.1675307394306; Wed, 01 Feb 2023 19:09:54 -0800 (PST) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:b3b:c1d9:ca39:b405]) by smtp.gmail.com with ESMTPSA id i18-20020a17090332d200b0018963b8e131sm12446494plr.290.2023.02.01.19.09.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 19:09:53 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 5B177114267E; Thu, 2 Feb 2023 13:39:51 +1030 (ACDT) Date: Thu, 2 Feb 2023 13:39:51 +1030 To: binutils@sourceware.org Subject: ld-elf/merge test update Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-3035.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Alan Modra via Binutils From: Alan Modra Reply-To: Alan Modra Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756687137721020281?= X-GMAIL-MSGID: =?utf-8?q?1756687137721020281?= The merge test fais on numerous targets because they don't support the necessary pc-relative relocs. This patch removes that part of the merge test, and makes references to the merged strings from .data rather than .text to better support targets that relax text by default. diff --git a/ld/testsuite/ld-elf/merge.d b/ld/testsuite/ld-elf/merge.d index a62711c485f..d31b6e8f9a8 100644 --- a/ld/testsuite/ld-elf/merge.d +++ b/ld/testsuite/ld-elf/merge.d @@ -1,16 +1,13 @@ #source: merge.s #ld: -T merge.ld #objdump: -s -#xfail: bfin-*-* cr16-*-* cris*-*-* crx-*-* d10v-*-* d30v-*-* dlx-*-* -#xfail: fr30-*-* frv-*-* ft32-*-* h8300-*-* hppa*64*-*-* ip2k-*-* iq2000-*-* -#xfail: lm32-*-* m68hc11-*-* mcore-*-* mep-*-* metag-*-* mn102*-*-* moxie-*-* -#xfail: mt-*-* nds32*-*-* nios2-*-* pj-*-* pru-*-* s12z-*-* score-*-* -#xfail: tic6x-*-* vax-*-* xgate-*-* xstormy16-*-* xtensa*-*-* +#xfail: [is_generic] hppa64-*-* ip2k-*-* nds32*-*-* .*: file format .*elf.* -Contents of section .text: - 1000 (1010)?0000(1010)? (1210)?0000(1012)? (0c)?000000(0c)? (0e)?000000(0e)? .* Contents of section .rodata: - 1010 61626300 .* + 1100 61626300 .* + +Contents of section .data: + 1200 (0011)?0000(1100)? (0211)?0000(1102)? (04)?000000(04)? (02)?000000(02)? .* #pass diff --git a/ld/testsuite/ld-elf/merge.ld b/ld/testsuite/ld-elf/merge.ld index dce91bb40db..6bcea50b31f 100644 --- a/ld/testsuite/ld-elf/merge.ld +++ b/ld/testsuite/ld-elf/merge.ld @@ -1,7 +1,8 @@ SECTIONS { - . = 0x1000; - .text : { *(.text .text.* .gnu.linkonce.t.*) } + . = 0x1100; .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } + . = 0x1200; + .data : { *(.data .data.* .gnu.linkonce.d.*) } .junk : { *(*) } } diff --git a/ld/testsuite/ld-elf/merge.s b/ld/testsuite/ld-elf/merge.s index 1e6e0e3494f..88eeebd9df9 100644 --- a/ld/testsuite/ld-elf/merge.s +++ b/ld/testsuite/ld-elf/merge.s @@ -3,12 +3,10 @@ .asciz "abc" .LC1: .asciz "c" +.LC2: - .text - .global _start -_start: + .data .long .LC0 -.LT0: .long .LC1 - .long .LC0-.LT0 - .long .LC1-.LT0 + .long .LC1-.LC0 + .long .LC2-.LC1 diff --git a/ld/testsuite/ld-elf/merge2.d b/ld/testsuite/ld-elf/merge2.d index 500ac770413..27cc4d3d62a 100644 --- a/ld/testsuite/ld-elf/merge2.d +++ b/ld/testsuite/ld-elf/merge2.d @@ -5,12 +5,13 @@ .*: file format .*elf.* -Contents of section .text: - 1000 (3010)?0000(1030)? (3210)?0000(1032)? (3110)?0000(1031)? (3410)?0000(1034)? .* - 1010 (4010)?0000(1040)? (3810)?0000(1038)? (4810)?0000(1048)? (3c10)?0000(103c)? .* - 1020 (5010)?0000(1050)? (5410)?0000(1054)? (5810)?0000(1058)? (5010)?0000(1050)? .* Contents of section .rodata: - 1030 61626300 62000000 (78563412|12345678) 99999999 .* - 1040 (78563412|12345678) 00000000 99999999 00000000 .* - 1050 (78563412|12345678) 99999999 00000000 .* + 1100 61626300 62000000 (78563412|12345678) 99999999 .* + 1110 (78563412|12345678) 00000000 99999999 00000000 .* + 1120 (78563412|12345678) 99999999 00000000 .* + +Contents of section .data: + 1200 (0011)?0000(1100)? (0211)?0000(1102)? (0111)?0000(1101)? (0411)?0000(1104)? .* + 1210 (1011)?0000(1110)? (0811)?0000(1108)? (1811)?0000(1118)? (0c11)?0000(110c)? .* + 1220 (2011)?0000(1120)? (2411)?0000(1124)? (2811)?0000(1128)? (2011)?0000(1120)? .* #pass diff --git a/ld/testsuite/ld-elf/merge2.s b/ld/testsuite/ld-elf/merge2.s index 41d066ab9c7..1c384b539ff 100644 --- a/ld/testsuite/ld-elf/merge2.s +++ b/ld/testsuite/ld-elf/merge2.s @@ -39,12 +39,8 @@ .LC11: .long 0x12345678 - - .text - .global _start -_start: + .data .long .LC0 -.LT0: .long .LC1 .long .LC2 .long .LC3 diff --git a/ld/testsuite/ld-elf/merge3.d b/ld/testsuite/ld-elf/merge3.d index de6584ca881..692db73609b 100644 --- a/ld/testsuite/ld-elf/merge3.d +++ b/ld/testsuite/ld-elf/merge3.d @@ -5,9 +5,10 @@ .*: file format .*elf.* -Contents of section \.text: - 1000 (20100000|00001020) (10100000|00001010) (18100000|00001018) .* Contents of section \.rodata: - 1010 64656667 00000000 30313233 34353637 defg....01234567 - 1020 61626364 65666700 abcdefg. + 1100 64656667 00000000 30313233 34353637 defg....01234567 + 1110 61626364 65666700 abcdefg. + +Contents of section \.data: + 1200 (10110000|00001110) (00110000|00001100) (08110000|00001108) .* #pass diff --git a/ld/testsuite/ld-elf/merge3.s b/ld/testsuite/ld-elf/merge3.s index 9328d4dd32f..d9caa1789f4 100644 --- a/ld/testsuite/ld-elf/merge3.s +++ b/ld/testsuite/ld-elf/merge3.s @@ -9,9 +9,7 @@ .LC2: .asciz "01234567abcdefg" - .text - .global _start -_start: + .data .long .LC0 .long .LC1 .long .LC2