From patchwork Sun Aug 20 17:14:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: YunQiang Su X-Patchwork-Id: 136284 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp2573005vqi; Sun, 20 Aug 2023 10:15:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHFZcEB8rgqV7QiNfOfjM4zG8Nu1e+HWClsasP7hkMYr6awauMQj3lcn3Cl6amR7BLbcXEF X-Received: by 2002:a17:906:209d:b0:99e:f3:67ae with SMTP id 29-20020a170906209d00b0099e00f367aemr5167736ejq.31.1692551730952; Sun, 20 Aug 2023 10:15:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1692551730; cv=pass; d=google.com; s=arc-20160816; b=NDDXA8zHxbDaaB6VF659hcI+i6vFZp8NVuwkyYWosNCPUuMHfNh5X/3XSYQzD/oLCg GZl6yIjX/KLnj1m+B1j56tsk2HEZV0+jsqvR7h1nOgvw6uYqWNiqwFDtJZU5Cx6QhDHv abwmNt9LnEnA6aivZgQiMVHdVaPvklGCnrxa8fwso1lTwgXVFXeZKqPNLHxgHE5MnwY7 jrhJPvWz7yTs61hmWEtk40gdmyAJTdeMXOcz+1Btmmrfuab2hlkWgwiaytUQP6AEbMW/ J3NUK0RUja/S5IITWIO7gDnOEXuiFna3M47RBGZyY4F2fuGs5ZnUgMfBctEpXTKyN2R/ avSw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version :content-transfer-encoding:message-id:date:subject:cc:to:from :dkim-signature:dmarc-filter:delivered-to; bh=v5n28VGgwLanyC/mNF/Dez87kRdI1m0zppNoYR0EXrU=; fh=u04MZwxtCeDM//h4ecoAPfVUFamrfQCRZXnCusDEtwc=; b=LCBAWhYiyrUFibbrFq/KA1RXff52E5f6i0F4wGhV+Vqw3J5iULMVaD4IrnInumVG9B WWHpGnC5gowtsjbL+cjBv9dmTOxrx373jRzVdaIUY9AGwgv5Cq738Z7NUxnmODh0s2TB +hLyCLnlCgX1Z2VI6TXANKG3EFiWDBn4C9cp2ezseQcys0iD/pFJQTQdsuQ4MZOrcepd uWVhD21uxzxF3TNlaj/+uWIPyk5GtR5uM2GyMR0vu5BzbqaEqTbaFAg3VdMd6hrJe7zN qpDzoZrYWq4eYRV3Fgb5N+JBRi9Z5UKPQ4kqqmn9NS5FXKEvHdntJIz/02BaeEVUwLbL fdZg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cipunited.onmicrosoft.com header.s=selector1-cipunited-onmicrosoft-com header.b=G5coQTB5; arc=pass (i=1 spf=pass spfdomain=cipunited.com dkim=pass dkdomain=cipunited.com dmarc=pass fromdomain=cipunited.com); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id r16-20020a1709062cd000b0098283e90548si4298697ejr.570.2023.08.20.10.15.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Aug 2023 10:15:30 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@cipunited.onmicrosoft.com header.s=selector1-cipunited-onmicrosoft-com header.b=G5coQTB5; arc=pass (i=1 spf=pass spfdomain=cipunited.com dkim=pass dkdomain=cipunited.com dmarc=pass fromdomain=cipunited.com); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9260B385772B for ; Sun, 20 Aug 2023 17:15:28 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2102.outbound.protection.outlook.com [40.107.255.102]) by sourceware.org (Postfix) with ESMTPS id DDE333858D32 for ; Sun, 20 Aug 2023 17:15:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DDE333858D32 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=SV8dEM6kb89TQ2sbU5yNXqTeYS11T/f2U/jTIrbPDqJ5Zvu6ETZUkJQh3PJvu/U4daIKAttoG0X1cCbWhti9/5LEI1IioeJcn4j2uhhBpvb4YZ1ctKuzrkq7gFS1lJJaTf0AzzqiKWqOoG/1r+cHamCyPImVkp9kxDf3AG5MLSWHMN+msH8u77bxgasVmmRN7CEZDEs8G5j1GPiiwnlKhIeYQrQx+xeZutmOkQsl0a1AaGaFhk7znF5yDVouvasmOx+4CUsqvGpQjyuxUD/i+jtDZuyqJQV1qVZegaNTnyTtgk9MupmjX6LVzwFyBwgr0tVRcL4PtvUkDKW236ytHg== 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=v5n28VGgwLanyC/mNF/Dez87kRdI1m0zppNoYR0EXrU=; b=D/6XeaMvD+onNf9LrGVfnsuxtgxvpNaV/a1xrbL48cnvW7DivWQUCk3L9LoQugRdrMi4PliifcK7euL99zNkN1tDVJ4HbZI/s1OLQV+xfRnuuTxvHM7LIEfAnsw62ko5B+4MrwfqHVESVx22i5mWLq0ZlXG65jAzwh5oQBOpzNNueQB0TPhJz4ySaP2XwzYj3YWaPwyYANvogCI4DxngqFsopwL8sOWlDDa/HkLuzVCUwdBA6CcK5M59Os3Klf1VZZWLF/s3+EofHCs3EDiAKPr18+D9qS6j0tT23/jKyx/mt9MfHuwaocKiOOE6PG4bv0XavfhVww7fpqdoLzPWLA== 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=v5n28VGgwLanyC/mNF/Dez87kRdI1m0zppNoYR0EXrU=; b=G5coQTB51nM+llIsHXPmmP1n/QiHZpeJqwQckRXVV5Evd5B5m7o/UUQdPL3qvD/MpxHuGzDFwNro0xBbqNQZx7gFslBLyTDBWkJaPyeSfQAM8wl9O0tHvuPLub7dtlmvLtd6aCAoieRZqhLJwcML+Q69kllrIDfswWxFln6fTrE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=cipunited.com; Received: from TYZPR04MB6117.apcprd04.prod.outlook.com (2603:1096:400:25a::9) by TYSPR04MB7284.apcprd04.prod.outlook.com (2603:1096:400:475::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20; Sun, 20 Aug 2023 17:15:14 +0000 Received: from TYZPR04MB6117.apcprd04.prod.outlook.com ([fe80::b15:a53e:604e:a735]) by TYZPR04MB6117.apcprd04.prod.outlook.com ([fe80::b15:a53e:604e:a735%3]) with mapi id 15.20.6699.020; Sun, 20 Aug 2023 17:15:14 +0000 From: YunQiang Su To: macro@orcam.me.uk Cc: binutils@sourceware.org, iant@google.com, ccoutant@gmail.com, YunQiang Su Subject: [PATCH v3 1/2] Gold/MIPS: Improve MIPS support in configure.tgt Date: Mon, 21 Aug 2023 01:14:56 +0800 Message-Id: <20230820171457.1377429-1-yunqiang.su@cipunited.com> X-Mailer: git-send-email 2.30.2 X-ClientProxiedBy: SI1PR02CA0003.apcprd02.prod.outlook.com (2603:1096:4:1f7::20) To TYZPR04MB6117.apcprd04.prod.outlook.com (2603:1096:400:25a::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR04MB6117:EE_|TYSPR04MB7284:EE_ X-MS-Office365-Filtering-Correlation-Id: 58b07d83-dcbc-45b6-9e61-08dba1a1046f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ID0rWP+WvsaPs+uGnYG8hsbq1i8cOGnm5T5Hmx0irn6u3P6lvq01d1YPcmgW87+q0ktGhtqC+mFn3+u2PLb5i7/IDlxX+w2vi3jsQEDUs36wAx9U4MRA7i7KlqGQ1n77NCOhtKiI3v5dgXSlCtjGxPJjjr5bmshdQkXceFAlOsq6QNC/OiMpy/err0k4TyVwKylMzhXeOy+mpJJd9Nl2J2EaPkUhW/pHDUzaXTv9WhNEx+RrEWi4Wgud11XT3L96MdqKcnpIUakCdJ5yX/IuJa+hY4bSyVIceGW3CsdAMYxlNuyDcqwNp9Dyz+vT3/toRSHppbBwSd1p/5EI7n7u+135P2ZqGyZpXQLp4v8EIIoJSC9PY2019Tgr4gHfUdx7Ek3F4pIfQJz6jS9ark49HwIDOR+IIVQ0fEUzjmkGOxZKL8xK2AIKg3K5LX9vU332/lYQurVF7XyPFv6+qRuPph62YOEMVYFqpy4XTNHb42RafgdAJsCusI4cI9XGHf0Uh+ooVPOoZTV/ZhqCfnLQScDYHFGF2fydyvv8C2G9p/d5UA8FyldpW5rDK42eiIgboW0x0IUERqe4k233Yh99TXpdGs80p49xK8QxxahgBUk= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYZPR04MB6117.apcprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(396003)(376002)(39830400003)(136003)(346002)(451199024)(1800799009)(186009)(66556008)(66946007)(66476007)(2906002)(4326008)(8676002)(8936002)(41300700001)(316002)(6916009)(84970400001)(6666004)(6486002)(5660300002)(6506007)(52116002)(478600001)(6512007)(2616005)(1076003)(107886003)(26005)(83380400001)(38100700002)(38350700002)(86362001)(36756003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: E15r3gxQ6TiO7BNY0YemZvRCUVGSBxa0S4SN0BOFddRMSi408H4XNpgb3H0Uu/rRwV3bFZyutEiTvDbQRJY043Nhs3EEA/3o8BDDUlhd/YyWcrgWpJ45ZUmBXqqpm2EmFezn0QzWNA+I4gUMBeRiOYqFe9VvZzocbebSpoh6a/yN7IyWpVaWoIHuRj8FFKfiya+hGMah0KB/1aGBFRo1Hys44hnhy3E58CT38VuMEWcYy48hF3iXR7S1+r5DEURwY6uhVVfvdn3SieL+ObTOdMo/kl03G63IXRUC/JA/Kkf4mnlcfObBhHhjUKusOaEkKNB3zYRVSeLJr0wlOglWFGp8GP6gQNSoe54cqRJk05nN4aAweKQo981vQpnqXz1lxc4+u7IXncBYJRc6OSbH9gwvF45s7A/geg2g/y3B95BGtkQBDbT9MfgncLX5EwSajk35F6ZpxwN9sPfhwDlacbHQDFGEieexSTpu57F2lABIUVMXvMKHBppJoLXTC8+PaOlOVgf8xThibSVZ53dvy8hOUUIwy3rN4z2Zvn29WO7WXVAho+XwWnXvrAbcUfHwAy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Network-Message-Id: 58b07d83-dcbc-45b6-9e61-08dba1a1046f X-MS-Exchange-CrossTenant-AuthSource: TYZPR04MB6117.apcprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2023 17:15:14.2259 (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: FSs+EDdhtXyEUJd6awZJ6nvf6AQpEYkry3W8DfTpkRnORYczLWJEtoHFApazs4ASvYSdIg3tScmcAEGOzugpntS4ic01n+YkcV0u7zFK48c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYSPR04MB7284 X-Spam-Status: No, score=-13.2 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 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: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774769123704392891 X-GMAIL-MSGID: 1774769123704392891 1. Drop mips*le triple pattern, which will consider as big endian by other components of binutils. 2. Use EM_MIPS instead of EM_MIPS_RS3_LE for little endian. EM_MIPS_RS3_LE has been deprecated quite long ago, and in fact most of current LE ELF files are using EM_MIPS. 3. Add targ_extra_size=64 for mips32 triples. 4. Add targ_extra_little_endian=true for big endian triples. 5. Add mips64 triples support, and define targ_extra_little_endian/ targ_extra_big_endian, and targ_extra_size=32. Let's use `targ_extra_little_endian` in configure.ac/configure, so that littlen endian can be enabled if the targets are all big endian. --- gold/configure | 8 ++++++++ gold/configure.ac | 8 ++++++++ gold/configure.tgt | 24 +++++++++++++++++++++--- 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/gold/configure b/gold/configure index 5c6fe2a5607..ccb1f2269b2 100755 --- a/gold/configure +++ b/gold/configure @@ -5266,6 +5266,10 @@ for targ in $target $canon_targets; do -o "$targ_extra_big_endian" = "true"; then targ_32_big=yes fi + if test "$targ_little_endian" = "true" \ + -o "$targ_extra_little_endian" = "true"; then + targ_32_little=yes + fi if test "$targ_big_endian" = "false" \ -o "$targ_extra_big_endian" = "false"; then targ_32_little=yes @@ -5276,6 +5280,10 @@ for targ in $target $canon_targets; do -o "$targ_extra_big_endian" = "true"; then targ_64_big=yes fi + if test "$targ_little_endian" = "true" \ + -o "$targ_extra_little_endian" = "true"; then + targ_64_little=yes + fi if test "$targ_big_endian" = "false" \ -o "$targ_extra_big_endian" = "false"; then targ_64_little=yes diff --git a/gold/configure.ac b/gold/configure.ac index cafd3503b3b..e04e4086140 100644 --- a/gold/configure.ac +++ b/gold/configure.ac @@ -193,6 +193,10 @@ for targ in $target $canon_targets; do -o "$targ_extra_big_endian" = "true"; then targ_32_big=yes fi + if test "$targ_little_endian" = "true" \ + -o "$targ_extra_little_endian" = "true"; then + targ_32_little=yes + fi if test "$targ_big_endian" = "false" \ -o "$targ_extra_big_endian" = "false"; then targ_32_little=yes @@ -203,6 +207,10 @@ for targ in $target $canon_targets; do -o "$targ_extra_big_endian" = "true"; then targ_64_big=yes fi + if test "$targ_little_endian" = "true" \ + -o "$targ_extra_little_endian" = "true"; then + targ_64_little=yes + fi if test "$targ_big_endian" = "false" \ -o "$targ_extra_big_endian" = "false"; then targ_64_little=yes diff --git a/gold/configure.tgt b/gold/configure.tgt index 4b54e08d27f..e2e131bbd84 100644 --- a/gold/configure.tgt +++ b/gold/configure.tgt @@ -153,19 +153,37 @@ aarch64*-*) targ_big_endian=false targ_extra_big_endian=true ;; -mips*el*-*-*|mips*le*-*-*) +mips64*el-*-*) targ_obj=mips - targ_machine=EM_MIPS_RS3_LE + targ_machine=EM_MIPS + targ_size=64 + targ_extra_size=32 + targ_big_endian=false + targ_extra_big_endian=true + ;; +mips*el-*-*) + targ_obj=mips + targ_machine=EM_MIPS targ_size=32 + targ_extra_size=64 targ_big_endian=false targ_extra_big_endian=true ;; +mips64*-*-*) + targ_obj=mips + targ_machine=EM_MIPS + targ_size=64 + targ_extra_size=32 + targ_big_endian=true + targ_extra_little_endian=true + ;; mips*-*-*) targ_obj=mips targ_machine=EM_MIPS targ_size=32 + targ_extra_size=64 targ_big_endian=true - targ_extra_big_endian=false + targ_extra_little_endian=true ;; s390-*-*) targ_obj=s390