From patchwork Tue Apr 18 14:00:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: YunQiang Su X-Patchwork-Id: 84879 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2877942vqo; Tue, 18 Apr 2023 07:06:23 -0700 (PDT) X-Google-Smtp-Source: AKy350bZ2hnj8mLNJgaBWjduLwB6lqTvuRVVEA9ICglehR0NYtiH5awGBrPiMMEhjdHAl9847jDJ X-Received: by 2002:a17:906:2402:b0:94f:64c7:d7e2 with SMTP id z2-20020a170906240200b0094f64c7d7e2mr6750745eja.9.1681826782821; Tue, 18 Apr 2023 07:06:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1681826782; cv=pass; d=google.com; s=arc-20160816; b=Mpq6QEWVUNJep6Sxy+fPXRsFm1rdllwEgSlpMRGXEvDpE0TULwmUehIH023PFgRCUA DjYd0BmX66eEtab0L1oS1q1ZRnXhRF3OS4pxBvr/Eu1bBUVqO4hH66nebqVNo2wpFEwt Ok7tFY3clnx35T3A/XRsicJxWqy2qEqXhljV2nhA7iMIa4aEf6SzKFcUqa44vNdbMkdo 9KBvJ7jLTUgkbESj4BLUAtSz0CNojRkDcxsQfeFKJdYxo8WmITgcL9Eoylty42gAe9qx nadM7x4pjZRO+WLQMvPUvdeXdaIFrTnYJAo6zthQKPSPYm76eF+xagdlmQJFaG54mGbp hB2g== 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:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dmarc-filter:delivered-to; bh=A1KYNdpviDEdXRlhYJ/jNpDz0TKWx5d2AtdSGPPAXqo=; b=rxTixIgMrPfXC8mxRPaaw/UDckCjNdGYNywilgcT/1n9oHJG6jbJEb77pt2Oydk3gr lxEAtwptl8bELcK/ZXbz650ExPRaaMHyJtV2IdAQVN5O35Ps7PdzWtNZ3q5dM9gmTbHV tnLRQk2txU0U+CqYuEJ+KUhisKoqvaD2Y+s2G5Z4Ms5lnio3TPqXChngHvYGXsE6NfVU 02hxsAFjdkx+JY0lxctJ4xTy/NBQ2rTjV3iVsb/pKtMhUFNoWEKaMXDv4C7zF6KauaOk sVSAWIXlznHkBR0epvSXtVcjolZpAX9ibdljTxfuctkARAmIEg4RgK22D3FLD8ZXHkH5 kdOg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cipunited.onmicrosoft.com header.s=selector1-cipunited-onmicrosoft-com header.b=hBfBvkTq; 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 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id ep17-20020a1709069b5100b0094f6cc79d1asi4830223ejc.556.2023.04.18.07.06.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Apr 2023 07:06:22 -0700 (PDT) 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=@cipunited.onmicrosoft.com header.s=selector1-cipunited-onmicrosoft-com header.b=hBfBvkTq; 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 8.43.85.97 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 264793857012 for ; Tue, 18 Apr 2023 14:00:55 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2124.outbound.protection.outlook.com [40.107.117.124]) by sourceware.org (Postfix) with ESMTPS id A97EE3858C2D for ; Tue, 18 Apr 2023 14:00:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A97EE3858C2D 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=fcYixoytuPcxKX2YMQxrgYRq4KbNFFJMJR/pnMRqti45PsX8gGPhjp30/86qvYNArcuGAyJKAwWMD+aqlFpU5dnxyRwSK4md0Eh9Pp9vy4UscP/ZMGWSezx16ivyoRjP6VkpaS4KI8D9YTPRz00yUW29Dn7ZmvGd8a5sSYyxk6pMg98qBBJm56o+BzHTuX64y97nqE4MEt8oey1G4i+XHUgjodMVnoIbmZ0hol7e/5522e1ia8wFAP8DJhWAmcNIzeOcgBaKfTAXbYG2fv/HN3/hZ+4C5HWQcT8x3nUAioH/sYzS0npZzAv+kt+sg2LWMGgboPLwacHfzTV7mPaXBQ== 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=A1KYNdpviDEdXRlhYJ/jNpDz0TKWx5d2AtdSGPPAXqo=; b=mLCmaQmVNm/qNMGzsSVjn6zH4xxPAYvg7oXvNuTpE9W4scqURLyv4dsotO9glByfL7m9pRPmLANYG7+kf2Zf0Van78RvYqYcPecYz5LYtMyyg/wkw0YR2kxXNlgxea9Djr5lzQaMbski5mxgqNjNBluIHi+Q5UDwv9C6IwrGtsh4W7K2ih3BKlgqicxlXr/gQspx9Z/g+qPOQ1aAeauUV0s+zOvkUhHI1I9geR1vVr87f/Miaz12WBKYIHMyDjqaPX7QfYvIo4kI+S3/UJrknqqRl13ZKBob2UOZstjzwZcrYVXcPUZ826+ElzwoLfolgL9RyXsH4zqJcsHU7BZi6A== 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=A1KYNdpviDEdXRlhYJ/jNpDz0TKWx5d2AtdSGPPAXqo=; b=hBfBvkTqiUZvG/c95St/aL5nVZAnjUmf+7E6nLX+Zba/M+u5kBW511FPsZK6/MlsLeKOQrPZtCi84pf1ji2QqoMRzyQD76cfFTsb7PeHIF4d44qUGvSqO55T1smm/ogIFPVWPOKsutw246r0IUk/Wqkg+PUpz+yI2m9Tb0k8gLo= 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 PUZPR04MB6674.apcprd04.prod.outlook.com (2603:1096:301:114::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.45; Tue, 18 Apr 2023 14:00:41 +0000 Received: from TYZPR04MB6117.apcprd04.prod.outlook.com ([fe80::4016:87b:f0d1:b150]) by TYZPR04MB6117.apcprd04.prod.outlook.com ([fe80::4016:87b:f0d1:b150%6]) with mapi id 15.20.6298.045; Tue, 18 Apr 2023 14:00:41 +0000 From: YunQiang Su To: binutils@sourceware.org Cc: syq@debian.org, macro@orcam.me.uk, xry111@xry111.site, richard.sandiford@arm.com, jiaxun.yang@flygoat.com, YunQiang Su Subject: [PATCH v4 1/2] MIPS: support mips*64 as CPU and gnuabi64 as ABI Date: Tue, 18 Apr 2023 22:00:18 +0800 Message-Id: <20230418140019.2195551-1-yunqiang.su@cipunited.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230414072046.1639896-1-yunqiang.su@cipunited.com> References: <20230414072046.1639896-1-yunqiang.su@cipunited.com> X-ClientProxiedBy: TY1PR01CA0191.jpnprd01.prod.outlook.com (2603:1096:403::21) To TYZPR04MB6117.apcprd04.prod.outlook.com (2603:1096:400:25a::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR04MB6117:EE_|PUZPR04MB6674:EE_ X-MS-Office365-Filtering-Correlation-Id: abe59830-ef18-4a8b-083c-08db40154b36 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eB/3PQAsRfxDPwVVjklWW5UfiUt6cpIrKPuKeBGw/C53e0MMD+PQfhPR6PBK2Pvpw2JtiSYHJQ/C8nJ0zEk3Hqzxd9fKjpBwP31SHSBlH8Owho+C3VhvM7swIxf9bq9pdjIqnwdInd4wgY0kdewARDzBwW3DjulMZWkW2HzGCR1P4M+vcjeP/dog6OIy90DUdDDmscTUZl/ZGXMBqkViYqhBEswLzA+OhrWRATp1Zqmsm81yRCCdVAn8brti/3yj7oA0HbE604tXHF72uLMOomr/RvbEjVCmgyZCCs09IDUO/UG9or0IOhaS/ZsSrRjs71pP79f4cLlb5/RvNKlllQntgbN4QQdMf5zjNp4aEOJ9ph6RFfDdngwuQPu/Mc6nwjvxkmhouKSmXtJINfA/Xl1h9wKxpG2Gr+A/aqAsc/kCFzvNS5NjY+IKJknAjH66BuzR352RAEJuY9AJUOSjmvyn/cfiNqDNFxgZdk0Fa6mu59qbH04Iea5a2Es8O6px7Z9XrKkezyxeErQiaO3/OEJeMhHGqZMWhVe3fVDgmV5HaPc1DJ+OR5iaXXV1taTJ2K9Oh/s9Za60zBnZUEGBjfBbQVXrLWRaBlDKr38TFbU1tuHHQfXSNAWsZ7fk1FDT 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:(13230028)(39830400003)(366004)(136003)(396003)(376002)(346002)(451199021)(2906002)(8676002)(5660300002)(8936002)(66556008)(66476007)(4326008)(41300700001)(6916009)(66946007)(6506007)(107886003)(186003)(26005)(1076003)(6512007)(6486002)(6666004)(52116002)(36756003)(38350700002)(38100700002)(2616005)(83380400001)(86362001)(316002)(478600001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: IxY1Rpkpr4I8mR+oTMbFQnhsKDA6akUzLOyLFAIbwaCV712zEMcS5wBqu/0TxtLmFcLmDCRpkqb/TutMRf8iPtP9skUbGvAbVD0Rx+5kR1sKblUqJBPjYFsTLUBELhRpyOkAChv+mQ01Zd9HuBIGKEMW27IJ1EFNA6EHODamEQebHQkXSdAH1loyPBZiYW91v46srA+IPC4mtduOn5Ae0drGqoDCXdIKZQ/qszzPzzgVtwNaICKtlgbv39taTLHFB47BvXVK9Ro/3m0KfoZMNkCYJ4rizzGqJVL3kCbQbtQZMFOd+GjA56ftE+dep/5tkHHQYiCQb5do4Zj4DVp8mYYccI3tBr5nHAn9QQdFuIRIsiueXTe+qHSvqvJm8+WSpdd7A3YBw7YMghIiMf0ZXkZUNz1rd/2c09JfAiEmkdLNiICzUS78EBWEl4mtu28WLegLAuLkX7rj7Vy298xjQRJKhQgcTfVliPy/toOCKR/76HLYVwrztSeaQhsQAurNEmTubBl6UeMhBKIAD9gaxidmpkX0XMKwxcqVhRPN1XOLUv3173eyYmGrRPrn0kG6CTvmbq6Ra8xFhYTKR1bwP06QfxKYwWPD0dVcS1ZhX9n5iItQguFwxFdmnAoH3AkX/zkp95kNvh6AmKsJIHQBbLPG8SDJShoxxRRGwhozOAqIIK+zp40WpDCYiA7wUtPIQlAh6PfN2P235/5vRHP2rbJrLnS3spJKnr3iSPSM/NmTfL6e1tEPyGrhVZN3XGDNTEDUJoZnY4yLwRCgzONbYDFt17cBTdZmukGBsAo27vauJLTDS9/Ajw99XWe9sOlz5tpp4MUzvBbuUfOKitjtLZqnkKkEsHsqjwZUFLp3hZPiKLF84msL3EgwjsthSSzrvkjiZRi4hBq87prDzLCSOIO07MrApYNV1VVFGBx/N7svPDdfJrNoqiESBEO24WCFV2bNyKnvND1irI0ru6LVQCDqjRpjc7pBJw+7i1q/5kwx7SCTCFQZbY0mvL6xZhdoCjTJZ7Tsvv+TRA49SDgq3Mqygf7+dkrkedwgnieoLAylXRK7P5OXtNAzFaVwFi2B8vZgNOBJ8fAIt4wBw8t7b9djj/lIwr7kJDlZ7ARB+HEuNAPwC9JxdT8SWqpkXNKEEPTM6HsV83JsAKE++xMWEsYrA71NHHhQRSQ1s/ovy7ZAhO3nd27Vwz0tYn1nkvQZFXzFcLQIfvMH9Zee7MnhkO5/+XT8mItVfqoxEVQfNx3teVxfU6Rc4c067DXBJ2cQaKRUiD1Ex1hEr8uWjgbZj5y13AJ0qDR4cR3U0LNQ0E65LaRkhfttmCJmitDI4/gXbfKb8CGOMmnGbYFs+o3UK5oIIIsC0QHyzuh0IWTL6BTz7HC1UqlHnTPqLVDG6YpcFhblHNEAAfSeAGhqc9vPoFlfOUjVUSVfNIvGTTNO71sl1cEA0fjdr8dMRIhzYP0ylsjpgrZxDJI8Y1mDAJPsk3DBLr86BLjcgWb5m8b+98UJcE7tDy2LCEUYSNVyuGUwZx+OB3K//y7hKF657L0LDAnzq9Bfb77rfi0MCmlKnj5wBbMONYm+6vGcxc7oWtMsY2EQITUZ2tibhTz0lQbVHQ== X-OriginatorOrg: cipunited.com X-MS-Exchange-CrossTenant-Network-Message-Id: abe59830-ef18-4a8b-083c-08db40154b36 X-MS-Exchange-CrossTenant-AuthSource: TYZPR04MB6117.apcprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Apr 2023 14:00:40.5939 (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: OksyD9TMqXjbcOIK0DB5TK381uYm5f7HY9QbuVtYzPRQN6LH7phCI2t1UQCveMihe/tXsRrsOR744qnz27HOuajC9JECxbcBP/hA1NyXeao= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR04MB6674 X-Spam-Status: No, score=-13.1 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 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763523201020018135?= X-GMAIL-MSGID: =?utf-8?q?1763523201020018135?= For MIPS64r6 ports, Debian as an example, `mipsisa64r6el` is used as the cpu name in triple. Let's recognize them by `mips*64*(el)`. For 64bit Ports, like Debian's mips64el and mips64r6el ports, `gnuabi64` is used as the abi section. Let's use N64 abi by default for the triple with gnuabi64. --- bfd/config.bfd | 14 ++++++++++++-- .../testsuite/binutils-all/mips/mips-note-2-n32.d | 1 + gas/configure | 5 ++++- gas/configure.ac | 5 ++++- gold/configure.tgt | 14 ++++++++++++++ ld/configure.tgt | 12 ++++++++++-- 6 files changed, 45 insertions(+), 6 deletions(-) diff --git a/bfd/config.bfd b/bfd/config.bfd index 7af481048db..1e4bea191dd 100644 --- a/bfd/config.bfd +++ b/bfd/config.bfd @@ -941,11 +941,21 @@ case "${targ}" in targ_defvec=mips_elf32_be_vec targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_be_vec mips_ecoff_le_vec" ;; - mips64*el-*-linux*) + mips*64*el-*-linux*-gnuabi64) + targ_defvec=mips_elf64_trad_le_vec + targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec" + want64=true + ;; + mips*64*-*-linux*-gnuabi64) + targ_defvec=mips_elf64_trad_be_vec + targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_le_vec" + want64=true + ;; + mips*64*el-*-linux*) targ_defvec=mips_elf32_ntrad_le_vec targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec" ;; - mips64*-*-linux*) + mips*64*-*-linux*) targ_defvec=mips_elf32_ntrad_be_vec targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec" ;; diff --git a/binutils/testsuite/binutils-all/mips/mips-note-2-n32.d b/binutils/testsuite/binutils-all/mips/mips-note-2-n32.d index c2a581858ed..5e24e7a115e 100644 --- a/binutils/testsuite/binutils-all/mips/mips-note-2-n32.d +++ b/binutils/testsuite/binutils-all/mips/mips-note-2-n32.d @@ -1,4 +1,5 @@ #PROG: objcopy +#as: -n32 #readelf: --notes --wide #objcopy: --merge-notes #name: MIPS merge notes section (n32) diff --git a/gas/configure b/gas/configure index b56836998ef..868f4a911a9 100755 --- a/gas/configure +++ b/gas/configure @@ -12223,7 +12223,10 @@ _ACEOF esac # Decide which ABI to target by default. case ${target} in - mips64*-linux* | mips-sgi-irix6* | mips64*-freebsd* \ + mips*64*-linux-gnuabi64) + mips_default_abi=N64_ABI + ;; + mips*64*-linux* | mips-sgi-irix6* | mips64*-freebsd* \ | mips64*-kfreebsd*-gnu | mips64*-ps2-elf*) mips_default_abi=N32_ABI ;; diff --git a/gas/configure.ac b/gas/configure.ac index 6a68fd7c4e6..03728ffce4d 100644 --- a/gas/configure.ac +++ b/gas/configure.ac @@ -392,7 +392,10 @@ changequote([,])dnl esac # Decide which ABI to target by default. case ${target} in - mips64*-linux* | mips-sgi-irix6* | mips64*-freebsd* \ + mips*64*-linux-gnuabi64) + mips_default_abi=N64_ABI + ;; + mips*64*-linux* | mips-sgi-irix6* | mips64*-freebsd* \ | mips64*-kfreebsd*-gnu | mips64*-ps2-elf*) mips_default_abi=N32_ABI ;; diff --git a/gold/configure.tgt b/gold/configure.tgt index 4b54e08d27f..ef47ce079f1 100644 --- a/gold/configure.tgt +++ b/gold/configure.tgt @@ -153,6 +153,13 @@ aarch64*-*) targ_big_endian=false targ_extra_big_endian=true ;; +mips*64*el*-*-*|mips*64*le*-*-*) + targ_obj=mips + targ_machine=EM_MIPS_RS3_LE + targ_size=64 + targ_big_endian=false + targ_extra_big_endian=true + ;; mips*el*-*-*|mips*le*-*-*) targ_obj=mips targ_machine=EM_MIPS_RS3_LE @@ -160,6 +167,13 @@ mips*el*-*-*|mips*le*-*-*) targ_big_endian=false targ_extra_big_endian=true ;; +mips*64*-*-*) + targ_obj=mips + targ_machine=EM_MIPS + targ_size=64 + targ_big_endian=true + targ_extra_big_endian=false + ;; mips*-*-*) targ_obj=mips targ_machine=EM_MIPS diff --git a/ld/configure.tgt b/ld/configure.tgt index 34c9d67c365..4a71f679e29 100644 --- a/ld/configure.tgt +++ b/ld/configure.tgt @@ -580,11 +580,19 @@ mips*-*-vxworks*) targ_emul=elf32ebmipvxworks ;; mips*-*-windiss) targ_emul=elf32mipswindiss ;; -mips64*el-*-linux-*) targ_emul=elf32ltsmipn32 +mips*64*el-*-linux-gnuabi64) targ_emul=elf64ltsmip + targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32ltsmip elf32btsmip elf64btsmip" + targ_extra_libpath=$targ_extra_emuls + ;; +mips*64*el-*-linux-*) targ_emul=elf32ltsmipn32 targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip" targ_extra_libpath=$targ_extra_emuls ;; -mips64*-*-linux-*) targ_emul=elf32btsmipn32 +mips*64*-*-linux-gnuabi64) targ_emul=elf64btsmip + targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip" + targ_extra_libpath=$targ_extra_emuls + ;; +mips*64*-*-linux-*) targ_emul=elf32btsmipn32 targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip" targ_extra_libpath=$targ_extra_emuls ;; From patchwork Tue Apr 18 14:00:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: YunQiang Su X-Patchwork-Id: 84880 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2878062vqo; Tue, 18 Apr 2023 07:06:31 -0700 (PDT) X-Google-Smtp-Source: AKy350bQmr1me+TnNi5oJmze4AfCABPFbXZzKnmdM+g4L1G1Wa5Cs8s3roMDdKsMmN9OHHRoUnhz X-Received: by 2002:a05:6402:556:b0:506:be49:243a with SMTP id i22-20020a056402055600b00506be49243amr1608344edx.15.1681826791233; Tue, 18 Apr 2023 07:06:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1681826791; cv=pass; d=google.com; s=arc-20160816; b=XUiV0RjbLcZv6zaupiUzfwWFDBwz8m/xhyZnOuuNbps52FQRoUce+B23dpqEoDkg7O Pnth9bRxdJSuDSFnQcGjI3SRs8SQdA+dRQmK2ohEKcx8m1WUn+kKX7cPky8BpB3Re/Ku VjbZxalu2wdctpskIJdtdxIXBGf+BOnG+7GGjPBr/i9F/0ILnUIKTDb1C6PFuhBO11at zUf+r738T47T/+Gm7rVX6HYTPxpzzAtIbYAjuSuaw/cwhFriX4Q7lWEzqFY7adT9D9+A X0e7k7ufhnzqnGH71oFEq/iPJJYan3iGGZ/hPJgHfOnQuk485k3hgBZit/RH1pXMF+4z PENw== 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:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dmarc-filter:delivered-to; bh=83M2zSwkwKDXCSKArU0Hq0Onj8gmInma9ecRvjzZ9aA=; b=GHOp/HtdBjPJNRuvetO0UGBkxUxCL6heg2ySksfHUcDQlC5asNzS6LSGEK6jZuEnSV jOlkILUdPrgWDm+HcUysZOB2MwxMZCEMylwZTYAXGRaOPSrd7VV287kbyl07+SFZToyl d7AGnRAdgXq8BafnCtoaBo9mEhP2JGXfikIkoMy4NPZP0W0B721jxRRFisUiapuGmkSJ zmeaBg9oALot6aMQ4Am3cUlbs31xDl0dYuL1Wh6onYS/c2pmmtkKHfgux0tho70DhDt1 ExLBicSGDvFKIFIGK4eF5REzyDJ0A2PP8AXyTA4IJl/DgSIocRvXuchNWxexzQX+MtRv rIzw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cipunited.onmicrosoft.com header.s=selector1-cipunited-onmicrosoft-com header.b=BjgR5yK8; 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 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id dy2-20020a05640231e200b004bbceaaceafsi12711736edb.170.2023.04.18.07.06.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Apr 2023 07:06:31 -0700 (PDT) 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=@cipunited.onmicrosoft.com header.s=selector1-cipunited-onmicrosoft-com header.b=BjgR5yK8; 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 8.43.85.97 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 29C1938768B9 for ; Tue, 18 Apr 2023 14:00:59 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2124.outbound.protection.outlook.com [40.107.117.124]) by sourceware.org (Postfix) with ESMTPS id 33F293858412 for ; Tue, 18 Apr 2023 14:00:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 33F293858412 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=Ya2j41eBLET1uJJjIujcyvhtDrT49Lo0q0j/eJEdcezhMeOByhyCeizvmjumhvNMWwUplDANokp6y0ItQl7tztxNPlD6tn6Uj0c7YjXDc0KZtH/PDgKWb7b9geQCy1hNYgbi2xRPL+JxhuUywoBMlNJPU5Kb3IosvphZAM/2YIQEmZxavamQl8mdo/MXR3p+5d6BNc11kL/hXRPoaeYjHyeRs09+YaLSDYkAEcwY8UtQPCtuPuVL1J+wOoXZkEnrH9A1VabMHv491cxk5Ig9k4bRkXO5sYrbfDiBxKA5ggQBs6csbIgbj1sw3NNzWwJr6M4y6TcsRMfHLW6eKRL1XQ== 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=83M2zSwkwKDXCSKArU0Hq0Onj8gmInma9ecRvjzZ9aA=; b=k5aArftq1VQ/86d8Nrtbkson+d3Kk+wygVpf3dSvkXCo9SKUyEihIMieDx+gC/cOt/5Ao/QHfmh+8eWHlf4H8ROTaF6pTBjQ3RRFeJqgS8EBccX6Siq9v5NJXCtsH8nZUvee0WZtm1dT/3zJ4VrLENaOmIYtRyzLK2Z/xXkH1+azItaMXSF4TVUUE7XXupeFwImf+ZssK+0uzRHd7Q1BZl51VClN+l3OqxvLeSQ0gMIWiuyV2u3v09KCCps/RLEAF/4DSpwuVEQ2RIDe7rTsqPTU1tCcYpENT3MKvuceahseEdq/rwAMBEANa7IESpdePZGmHfiXyS8sjwSErg7gnQ== 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=83M2zSwkwKDXCSKArU0Hq0Onj8gmInma9ecRvjzZ9aA=; b=BjgR5yK8czIPsG63hmLJzwgMymfZFPNotBWYWZyq8PIY/p4kPipksAgHdLszrr5P/UwZUiKY/EDLnYhWeerFTygcVksoAWpy/oQCUGWgK6Bo8IMGSleA/N71xQuZ2bjDwaB7w3bennYZKWU65k0Sp7CyW3n2oVpFyFCBOL6Rb80= 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 PUZPR04MB6674.apcprd04.prod.outlook.com (2603:1096:301:114::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.45; Tue, 18 Apr 2023 14:00:45 +0000 Received: from TYZPR04MB6117.apcprd04.prod.outlook.com ([fe80::4016:87b:f0d1:b150]) by TYZPR04MB6117.apcprd04.prod.outlook.com ([fe80::4016:87b:f0d1:b150%6]) with mapi id 15.20.6298.045; Tue, 18 Apr 2023 14:00:45 +0000 From: YunQiang Su To: binutils@sourceware.org Cc: syq@debian.org, macro@orcam.me.uk, xry111@xry111.site, richard.sandiford@arm.com, jiaxun.yang@flygoat.com, YunQiang Su Subject: [PATCH v4 2/2] MIPS: default output r6 obj if the triple is r6 Date: Tue, 18 Apr 2023 22:00:19 +0800 Message-Id: <20230418140019.2195551-2-yunqiang.su@cipunited.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230418140019.2195551-1-yunqiang.su@cipunited.com> References: <20230414072046.1639896-1-yunqiang.su@cipunited.com> <20230418140019.2195551-1-yunqiang.su@cipunited.com> X-ClientProxiedBy: TY1PR01CA0191.jpnprd01.prod.outlook.com (2603:1096:403::21) To TYZPR04MB6117.apcprd04.prod.outlook.com (2603:1096:400:25a::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR04MB6117:EE_|PUZPR04MB6674:EE_ X-MS-Office365-Filtering-Correlation-Id: 92286160-4acf-4e4a-01f0-08db40154ddb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: As2JKUN8ZTz1m0ZGg5N9nW1aUfpz+RLScjtrsFp1KzJBxpDqrV8ZPcBsUTxx7SCVTi5yXugLMKJw7URtw6vxcnNpI8+fqGe075pfhjMaYQev3SMVKrH2yCP1JcDinbpQxA27e23JpSPmljhreAvgsW75nlVuxrmuiExhX8wPRpqT60CQvbmVioiyHcP3CyOcTaBXSrjnDg4l8z2OKLmj0bgr8Z+D2BLWhaKwEc1w7IKvxtJVAXdz6qy/aHaERaD+Ln6YJstYbVhku9sz4JjaenJNV+tczncDkguRFKXb8AD1RVjbOaY+UehaJ/deh6ZdJiTrU62HafjbbLZCQOpRWjz3dk+CplhkMtvc4+g/iPZ05XPLqXoy6zBeYhsgiT6cAAcskmchViuwa3RaTG9X07xK8Fib8Cx2J2Dq27lYPFsfqbz8ZCiPmru89AFavjyLwnfEHVhm4Zh77zMaF4NU0gs50+ib/svcbJZ0TGgaZc1vvBJJFFb0lFnmMrcvXhWA26ISOlSx7gMk3zRF0ZsX4dGKvAGepEJZOZUoI2kIGvNhXwnQ1UdqI1HUIIDRPu5kTiEeMjyFxbP9EZBTlgaOE+57NQP9RWceEEjaPKRUiiQcXWIDMYM+Y6aizgOdGBek 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:(13230028)(39830400003)(366004)(136003)(396003)(376002)(346002)(451199021)(2906002)(8676002)(5660300002)(8936002)(66556008)(66476007)(4326008)(41300700001)(6916009)(66946007)(6506007)(107886003)(186003)(26005)(1076003)(6512007)(6486002)(6666004)(52116002)(36756003)(38350700002)(38100700002)(2616005)(86362001)(316002)(478600001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9jqOSNKka8Kx6MzDV4BvGQnZul4gkvUTjfiuGM5A9hElzyl5qYpJ8211UNBUoqXbrTkB0rlGwxJRz5I3jSgZ67OJSPK614b/hNFwWd8F6+ykS2mky2zZa8zps57FLfCMkyYg6re+xGuGqEjIxq9JdgLqNyMCKNpfQsnpcB6kVNRd5DgQ06qTcu99J2OSfCaRmKH0b/m+sFZxJEu18laCEEHCRnZJJJS0Dp1HqsIP//vvsaj+ziE8os1hmLdK1PdbCIDRr6sY393/OPh3bQYWxmo37vipSaUKtmi+COCAHOhElfMRtvAktNLX4sc/C4wNRuvwAlLGPMdanuJh1ccd77q1HyuymJpFpmV81v/wIEkH9nxnq31y119+CCXJw/q+8p0aA898LR+itaMUwIzd0CzPJ+ohOsUx0a9EgblOx50VLfI77+97rsaXl7ZHSS6gup5G4KaIyhwEAyXkzAFYcg5ZtiQ4nrN+baq+H26ZYNMeY1tJo5+T3a8z39yuTCwW7k0bG68Dhxrb6EV8mV8BOrCH19dJYk0WJVwmgCKwcLJI6+gGDW9U0EKyroHHR/epKTA+kL8doIWPOxMCXd1LSZL3HpnVZhIhkkShkeG39iLU2D3fbznvJOLPbOB5B8z1n3Nx+66cnO23bZOaTwNkqnC8rLDDoesDyHRo2GGNAF0rWhSMiUr5Z7tBD8mdkPac0uAFcKOs2YkwYVmJlLKYDBCC2FaDlfBShdb2rxiDUl/zrg7BK9gHSYFJuzGIdIMjvMaipzep2n/prlYO6/yEZgOsM5SUasmhqmSjk+az6hy22y+fkI/Dw5iCAu8VXwaNaqDrvdhmGvftPlGe6gwcNogLI8hPBz6WkFj0qsBSsJgpclME6BDTjecHlnEdaVvKabcSzd1lIPscomycH1qiZtzd08pc6GKtHg8O6HzUyX+q9QUGRZVRpfKvoSK4d2rA7r0Zs/xNQBtzk3IwSBmq7n79tGARqcD9ZZPQRFBlJyiUT1XrBqgu5Dz2r7MAy6Fmbe/zgzmNkg+d1ca5I2NB1GQNzKlIUedazKJYeLr7RhxFOD2o7BkR656ZM9fmk5nP3dFrQ0f/EeJkZP2ZnIqkytdaLUlXCvn2ldYYPiUWsk7e+0MYQVXIf3/xB0QbDnHZfJjf4CNB2kCEVVxBBPDb3tzEZzx5aPdHJiiWxMCcmcuaEFEE+lRbe6dXJki+xR3zx5yon8LuBwrU7C7Zdp6E17JiySplFP/q49IwxgfilfcdLg5wjnpXYcv6xsxsOG+Xt7saXyi660hCQbc4vkFO+d3plqGvEDVCA2X1dvxVHGjAAIE1Yd5qDXmrnxwj7oTHuanoiK7gCrrcLJdLPsOUKhVitxLJeTbBK0usTVxCJLjVDqr9+sA7XGwh8MsUwpb1QFJWXTQA3kXvmtzAQNF8cygr3upif7F5ITVzwwGL/utqqEggP5cqH9W7jtxWcrdc5J9wrOxS3JWp/U+pNGfa+lUxHdC/h9Iofxi8R7HJcuz9ACaPSiW08NDk9enh3DTFwmTr48cirJ2E5zROjNq0xXJFK9Dfd96Qy8Z3QC2JH+tGHFJU/oFn4BKSVLcJAqfhDtWjHlCEtuJKwDvc6XHeBQ== X-OriginatorOrg: cipunited.com X-MS-Exchange-CrossTenant-Network-Message-Id: 92286160-4acf-4e4a-01f0-08db40154ddb X-MS-Exchange-CrossTenant-AuthSource: TYZPR04MB6117.apcprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Apr 2023 14:00:45.1422 (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: vvBmL9JgsSNZ9hipVj/bMtVW5ORz9mdc0COlYef3EYX/2W65v+D039/MpZ7cVSbEumx9lj6ogO+u/tAQ2x0jYNwbjKBp/HICwf8U/o4oVqQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR04MB6674 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_NUMSUBJECT, 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 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763523209248696759?= X-GMAIL-MSGID: =?utf-8?q?1763523209248696759?= If the triple is mipsisa32r6* or mipsisa64r6*, ld/as should output r6 objects by default. The triples with vendor `img` should do same. The examples include: as xx.s -o xx.o ld -r -b binary xx.dat -o xx.o --- bfd/config.bfd | 6 ++++++ bfd/elfxx-mips.c | 6 ++++++ gas/configure | 9 +++++++++ gas/configure.ac | 9 +++++++++ 4 files changed, 30 insertions(+) diff --git a/bfd/config.bfd b/bfd/config.bfd index 1e4bea191dd..78752994456 100644 --- a/bfd/config.bfd +++ b/bfd/config.bfd @@ -1535,3 +1535,9 @@ case "${targ_defvec} ${targ_selvecs}" in targ_archs="$targ_archs bfd_iamcu_arch" ;; esac + +case "${targ}" in + mipsisa32r6* | mipsisa64r6* | mips*-img-*) + targ_cflags="$targ_cflags -DMIPS_DEFAULT_R6=1" + ;; +esac diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 13a89953293..0b0ea11bfb5 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -12327,9 +12327,15 @@ mips_set_isa_flags (bfd *abfd) { default: if (ABI_N32_P (abfd) || ABI_64_P (abfd)) +#ifdef MIPS_DEFAULT_R6 + val = E_MIPS_ARCH_64R6; + else + val = E_MIPS_ARCH_32R6; +#else val = E_MIPS_ARCH_3; else val = E_MIPS_ARCH_1; +#endif break; case bfd_mach_mips3000: diff --git a/gas/configure b/gas/configure index 868f4a911a9..0daa80d5b4c 100755 --- a/gas/configure +++ b/gas/configure @@ -12211,6 +12211,15 @@ _ACEOF use_e_mips_abi_o32=1 ;; esac + # If Vendor is IMG, then MIPSr6 is used + case ${target} in + mips*64*-img-*) + mips_cpu=mips64r6 + ;; + mips*-img-*) + mips_cpu=mips32r6 + ;; + esac # Decide whether to generate 32-bit or 64-bit code by default. # Used to resolve -march=from-abi when an embedded ABI is selected. case ${target} in diff --git a/gas/configure.ac b/gas/configure.ac index 03728ffce4d..2b91f9ec616 100644 --- a/gas/configure.ac +++ b/gas/configure.ac @@ -380,6 +380,15 @@ changequote([,])dnl use_e_mips_abi_o32=1 ;; esac + # If Vendor is IMG, then MIPSr6 is used + case ${target} in + mips*64*-img-*) + mips_cpu=mips64r6 + ;; + mips*-img-*) + mips_cpu=mips32r6 + ;; + esac # Decide whether to generate 32-bit or 64-bit code by default. # Used to resolve -march=from-abi when an embedded ABI is selected. case ${target} in