From patchwork Sat Oct 22 12:56:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Lapshin X-Patchwork-Id: 7886 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1192480wrr; Sat, 22 Oct 2022 05:56:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6gJD1nrrMs3cmx2WJ4hVMD4fPRmAja3GhkcjpjJ0bdZlXyiFzdQK/gOTdR1+g6y//9Ewjy X-Received: by 2002:a17:906:4795:b0:794:8b93:2e43 with SMTP id cw21-20020a170906479500b007948b932e43mr14580003ejc.184.1666443377794; Sat, 22 Oct 2022 05:56:17 -0700 (PDT) Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id z12-20020a05640240cc00b004596c812fb7si22891868edb.50.2022.10.22.05.56.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Oct 2022 05:56:17 -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=@sourceware.org header.s=default header.b=Onm+NFGG; arc=fail (signature failed); 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"; 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 83E42385843D for ; Sat, 22 Oct 2022 12:56:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 83E42385843D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666443375; bh=egIXV+4p0gsCKEkC/77v6w8P7SG3NpHblRJuXOptd8M=; h=To:Subject:Date:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Onm+NFGG7znKJRJSpAAT/Lkc7R0ZVkSMfbq/ee/yYCHbDsKZOMPABVZQVmxN6qca/ oYBTGU9RwxD7nZ0g0WeF8CwLM5DU+MjUhTB2vITmZJ97Kba9bqxdK4SYAZSzlDg5xA 5LVqxPYlq4nLFP2/+cylAaoqgkU+AaPF+aXu+Sbc= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2104.outbound.protection.outlook.com [40.107.117.104]) by sourceware.org (Postfix) with ESMTPS id 2AEAB3858292 for ; Sat, 22 Oct 2022 12:56:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2AEAB3858292 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nZuEJqTqTWWOjq/7R2Jqx1KMOCVojQ1nDuYmHHQNs2FRv5UFYVvU4wQOzCN49wDA691KtZXDLFCbgFBsnbmBqu0J/CoBsvdxLSkpbO3O7LPUOavSKKE9uJSQHYERtBwi62RxJbtFxjtWwS5qbwz3AJXk6mwy4lCs5APAuYow6UybDDyGDpRU+iR9HFm3XEalR/WmG6RDEkyspNVBpUZJJ21AW6jXibRtZ+Wdjwj6rYMSPmWHbHQGETJMDbM2ohJA+9X7oKIgQh4VSKAH2Y3SjB64Dn5pZ5n0ocpVNNE/ti5b5LmrES2rdmOQa3L0BQI3dxLe4vmCcAyrILRWGtbajA== 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=egIXV+4p0gsCKEkC/77v6w8P7SG3NpHblRJuXOptd8M=; b=QZ2AwMJrKwO3qIlq0KrH72xLV/CH7lXLawdTZ2ufsf+5+YBrzGvDYcWpChDBgHiFM8z7c+A28+AHwybWRJVK72Sry8VEuBoUmYEvTU2PxFus+IdlWQywhzFsFJ3QRLfD7a/8OSVVIpdP+QLdsfRdW3PBH0ggtLEQg3ELpYQdJiteiXNcSitwQIucdwI9cisg/PeuP6GtAta1iVvADRTeJkmiHGeX4/teFm2E6q1JvBk55ttT1qQTrgbIpSrS6i+wVAiVC6IHcvkcpcx3OXh1mMGn1z5VBBZEnOm4PuQ8uF4TCMFDo4McmPR4GrCKvaLfolCrMqapW4vx8/pMSclYDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=espressif.com; dmarc=pass action=none header.from=espressif.com; dkim=pass header.d=espressif.com; arc=none Received: from TYZPR04MB5736.apcprd04.prod.outlook.com (2603:1096:400:1fa::7) by SEYPR04MB5908.apcprd04.prod.outlook.com (2603:1096:101:68::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.35; Sat, 22 Oct 2022 12:56:02 +0000 Received: from TYZPR04MB5736.apcprd04.prod.outlook.com ([fe80::e64d:5c85:a83c:5898]) by TYZPR04MB5736.apcprd04.prod.outlook.com ([fe80::e64d:5c85:a83c:5898%4]) with mapi id 15.20.5723.032; Sat, 22 Oct 2022 12:56:02 +0000 To: "binutils@sourceware.org" Subject: [PATCH 3/5] ld: xtensa: use default LD command line options for endianness Thread-Topic: [PATCH 3/5] ld: xtensa: use default LD command line options for endianness Thread-Index: AQHY5hWjXHrETW659k2hQSb8NF7Wzg== Date: Sat, 22 Oct 2022 12:56:02 +0000 Message-ID: <34d2f747237aeeda595560cfded8096d9bd1c28c.camel@espressif.com> References: <94fd668465b77e94f3c000982c694e7da8f828f1.camel@espressif.com> In-Reply-To: <94fd668465b77e94f3c000982c694e7da8f828f1.camel@espressif.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: TYZPR04MB5736:EE_|SEYPR04MB5908:EE_ x-ms-office365-filtering-correlation-id: e88d94a6-3328-42c6-1143-08dab42cc66e x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: sR8+NW0NFsw7GeHLqMuekaBhincFLx3VkbixyyYjT9EZfFiaC3UHQorw6UapZ1f4cbphaLFpBVV3YVZQ3f84hSI/kQabSpgQ2XjG5wXCHEo2R6aXMrci+bIwOAvnOSQPhUTNAuRgv45WI8jAKo41pZTCA0Gh4bxJ6xfFRYlDxNg6rEGrIag0/8qs+XCk+VqZU1p72hYM3ncoNctVAiirCfu9nnRJSUzi/rfQvJp6KAlqMGMlNEocV2NmQ+CMGS20ayYso+pGqHqahEUicmVN4/EEkD8smnElRDe9m59zUpfWvpdw9ZeultP0F90/n68CjdIQ6a2zXA/GTUPvTOW6gHYr8SaGhAKg+/xdxrgPUWZPlKvh9WCI9ry1IIPCr8Jv8q/n7tf6gJ7wbjAzH+ixrQLr7AlV8IS6tNf6GOV6BP8T+oDKyDI5rz4XNpM+nui+XzOLClcoiB2keROwqW6g4pez0C0CGyGsX8tObnnWk7b67qa6jKx6A8dkyfF37mRJoRQygXXSyqTxS6312yoSp5s/YdZGFDvq0jjBkObojb5es4honsdQi7E3Owz5BXHSnRBGgIx9/uGMLPEQUXyNoG7ujSrUsDFTu1f+uO7+/yMnxWVw76u1WlK8M0pohhKkAZy0HF7IGszcQ9J6yF+RbeYRcHcFFfiy1yQMdNlCyw59Mu8EkjCJPMFw5romYNGjLB8gOiU7b6KXyS0tYqf/JVRYbUF1CUg/qrPDsZ9U5dAm8KtV+XkbpExZ+q8C8WAhgeCerqGtZHMOp6KnRHxA/g== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYZPR04MB5736.apcprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(376002)(39840400004)(136003)(366004)(396003)(346002)(451199015)(91956017)(2906002)(107886003)(8676002)(38070700005)(5660300002)(76116006)(4326008)(66476007)(66446008)(6506007)(122000001)(54906003)(66556008)(6916009)(38100700002)(64756008)(66946007)(86362001)(83380400001)(6512007)(8936002)(26005)(36756003)(41300700001)(186003)(2616005)(6486002)(44832011)(478600001)(316002)(71200400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?ou0EqyiiR1pp1YiO4T9APsCNEaEl?= =?utf-8?q?ITcb2Fjp/gjmwnaOSdKtgUeb8sz9TZqOiwMEfmwQdvEF070I2jnUPKT2TfE2/YT1/?= =?utf-8?q?3XkDXAAoYKPckpMV4y2CXzpz+CCReECG+pvTz8sHaCmaAhIoFwnMn8L13OU9724Gx?= =?utf-8?q?YZuPgknRBLOBPzHa+p9+tKwd/5ZhzpO5a/pqZxhtkv1DtQA9Z5YSkaN6grj95OnoY?= =?utf-8?q?s511w9dBmOH7fWmt0yfA9Ryb6+ZKvDV9Vd1gE+Dlb+S5dSriH6H9d7lc9OHUHVCvY?= =?utf-8?q?ykb05QPc95szkw7ebwmX8RTQOpa8orBPGpq956ulKv0A11yzm6q2TWeXgArdZILFQ?= =?utf-8?q?T+fHIp7YRAs+m5g6ov0eFd2R7UUGleDOzU0VTzveIlp8SXlfEHNIZrnMYUIHijXk5?= =?utf-8?q?I1mB3LbrsTXFS2WVHV9ya/KMez6VdsaiuiWcrEKOHCwzRUfi/Bpuw8QEshAAL3n5o?= =?utf-8?q?IQ1g1Z9YCrxRPtk/HkWq5xCGS/U6xRkPT0GAREYwEANhImy3Gju+rMyiBqZxLsN/o?= =?utf-8?q?Df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f-8?q?/IpjxbP4CTqc9Gr7aRukMEQLM7H0uUjffNnPp5bckpBJ1YQpY66uzwtVWzS7zhuH5?= =?utf-8?q?FSbqSYzffljM6qebYfOnTKrv16rUBSJss1mv370ee/vwOMnwLyw7jsMHg+GuRmOfe?= =?utf-8?q?tfWc+SAZHALjMcKrBbvTumomZL2jzX5X0YN/yQYQo0aw0yOMbmJgeIA=3D?= Content-ID: <4A51266DCEA9594198517C97D6598B55@apcprd04.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: espressif.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TYZPR04MB5736.apcprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e88d94a6-3328-42c6-1143-08dab42cc66e X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Oct 2022 12:56:02.6384 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 5faf27fd-3557-4294-9545-8ea74a409f39 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 31Qt0eAaKGIATp8oqcuK0xgQDlhJQxd+L3FKANF5jbCR3PGj4BPMLoeUR6QOl4MYMKs0xYeEJDp1EwIyj4HG2TPK+O/h6P/izHhimlhfYhg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR04MB5908 X-Spam-Status: No, score=-13.3 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: , X-Patchwork-Original-From: Alexey Lapshin via Binutils From: Alexey Lapshin Reply-To: Alexey Lapshin Cc: Anton Maklakov , Alexey Gerenkov , Ivan Grokhotkov 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?1747392531299195830?= X-GMAIL-MSGID: =?utf-8?q?1747392531299195830?= Use --EB, --EL ld options instead of hardcoded macro definition. --- ld/emultempl/xtensaelf.em | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) -- 2.34.1 diff --git a/ld/emultempl/xtensaelf.em b/ld/emultempl/xtensaelf.em index ed2945b850d..f06bcb97daa 100644 --- a/ld/emultempl/xtensaelf.em +++ b/ld/emultempl/xtensaelf.em @@ -66,7 +66,8 @@ static char * elf_xtensa_choose_target (int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { - if (XCHAL_HAVE_BE) + if (command_line.endian == ENDIAN_BIG || + (command_line.endian == ENDIAN_UNSET && XCHAL_HAVE_BE)) return "${BIG_OUTPUT_FORMAT}"; else return "${LITTLE_OUTPUT_FORMAT}"; @@ -343,27 +344,6 @@ elf_xtensa_before_allocation (void) xtensa_info_entries xtensa_info; asection *info_sec, *first_info_sec; bfd *first_bfd; - bool is_big_endian = XCHAL_HAVE_BE; - - /* Check that the output endianness matches the Xtensa - configuration. The BFD library always includes both big and - little endian target vectors for Xtensa, but it only supports the - detailed instruction encode/decode operations (such as are - required to process relocations) for the selected Xtensa - configuration. */ - - if (is_big_endian - && link_info.output_bfd->xvec->byteorder == BFD_ENDIAN_LITTLE) - { - einfo (_("%F%P: little endian output does not match " - "Xtensa configuration\n")); - } - if (!is_big_endian - && link_info.output_bfd->xvec->byteorder == BFD_ENDIAN_BIG) - { - einfo (_("%F%P: big endian output does not match " - "Xtensa configuration\n")); - } /* Keep track of the first input .xtensa.info section, and as a fallback, the first input bfd where a .xtensa.info section could be created. @@ -378,8 +358,7 @@ elf_xtensa_before_allocation (void) The merge_private_bfd_data hook has already reported any mismatches as errors, but those errors are not fatal. At this point, we cannot go any further if there are any mismatches. */ - if ((is_big_endian && f->the_bfd->xvec->byteorder == BFD_ENDIAN_LITTLE) - || (!is_big_endian && f->the_bfd->xvec->byteorder == BFD_ENDIAN_BIG)) + if (link_info.output_bfd->xvec->byteorder != f->the_bfd->xvec->byteorder) einfo (_("%F%P: cross-endian linking for %pB not supported\n"), f->the_bfd);