From patchwork Mon Mar 7 13:49:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 12771896 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6C2F8C433EF for ; Mon, 7 Mar 2022 13:49:52 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.286049.485379 (Exim 4.92) (envelope-from ) id 1nRDk0-0002Aj-52; Mon, 07 Mar 2022 13:49:36 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 286049.485379; Mon, 07 Mar 2022 13:49:36 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nRDk0-0002Ac-1p; Mon, 07 Mar 2022 13:49:36 +0000 Received: by outflank-mailman (input) for mailman id 286049; Mon, 07 Mar 2022 13:49:35 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nRDjz-0002AW-HC for xen-devel@lists.xenproject.org; Mon, 07 Mar 2022 13:49:35 +0000 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.109.102]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 6b45ce44-9e1d-11ec-8eba-a37418f5ba1a; Mon, 07 Mar 2022 14:49:33 +0100 (CET) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01lp2055.outbound.protection.outlook.com [104.47.2.55]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-41-RORnIGj0O8in5_hQ1D-G8Q-1; Mon, 07 Mar 2022 14:49:32 +0100 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by AM6PR04MB5749.eurprd04.prod.outlook.com (2603:10a6:20b:a8::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.15; Mon, 7 Mar 2022 13:49:30 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::d479:b728:345c:bd65]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::d479:b728:345c:bd65%6]) with mapi id 15.20.5038.026; Mon, 7 Mar 2022 13:49:30 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 6b45ce44-9e1d-11ec-8eba-a37418f5ba1a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1646660973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XPMDXJ8DEsGxfE6cWFy2tMlf7ejnDjisqhedDx6eHvE=; b=VDCkbYQCMO86bPJ1Ut5C9/JNsf5q/ClFBS5R8f40BSqWQ5dw+XzRFnzjBAaFqdqT032ZOj /8sJdRsn62cwSoIsYWKCaZFQvYCoOXxXCmtX+FZSSsaQlpSOh2mDMIhMG+B0e8sG8FZ2lg 3v+0YHT9M3uvcJjmNeTflQP66tbdYjE= X-MC-Unique: RORnIGj0O8in5_hQ1D-G8Q-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R5vUUEjT+CqY9fSKPmcYfMazJXfmZUx38Hfp4cgmYuJnnBZy6VtPeqgKrN3Yl1PYbaPF9R3FMWQIKe3NFkWRrRGULw5izrJIrgNi8yvlbhn8P27UjlY+n7lb1S0uVOnmZOCpA1TjbrIRyB4ViaFG2iveSnD2xaS5/qUHRJ2nyQOG1qCQ45vx/u3pTEWM2jnlDYdd0NpwcOdSZjWju8Wi/g72H3EX6Uapc3PmErH8ssbk4aF/G8aQrU4st2qlWXH8NtCCHTDEa/wYj5zcLfc7PCv1wqCImTVgr+nRnuuIMiQ4jOLsmZZcFqi9ytWtqcXXDvGsYDFXVx6TRu6cIjUuhw== 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=XPMDXJ8DEsGxfE6cWFy2tMlf7ejnDjisqhedDx6eHvE=; b=RSFvSbQ64v88UO8BcYy7tKxD94gdwwGL7KYVLi1LvQgat3ekbgoTWnJOI6xtkP1PD6n0dSYFVX2jK97H8pp2ChCuFzgGgE0b1NnVohYbkeXU5TQ1tVKwl1mNjPwUSPRkIQPP6YrE9vW+ZIRI3tCQ3wUyO4CsjKOKE3Sl3y39jE+pLCnVPgbv9N5vGTqUnyI+nLOedjsD0trrNFHQSvChy7nK5WvhFcTvI47GWBHvCtLyWjCJu3GlCzl+cNUa42uzrebMUTiQVqzoDTVayxMxDQgpeCDDdTCr5zi+evf0Y4rGVlwTrcaTTpEyRg9l3L6YfDZ1iZNLY+3IFhy6oZFRuQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: <8b982bab-9b16-61e7-620f-5a5b2be39588@suse.com> Date: Mon, 7 Mar 2022 14:49:32 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Content-Language: en-US To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= From: Jan Beulich Subject: [PATCH] x86: avoid SORT_BY_INIT_PRIORITY with old GNU ld X-ClientProxiedBy: AM6PR08CA0017.eurprd08.prod.outlook.com (2603:10a6:20b:b2::29) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 84970321-079e-4ff6-6f82-08da00414de3 X-MS-TrafficTypeDiagnostic: AM6PR04MB5749:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XnRueKY22NRlNU2WZ5BqQRaeN5jMHjK1eRyknDXESLsBJQ6CD2+lclq1ljeSlzg3cmpMEKvaFCCyu7f5f8jv+AvG8QyMphdUHZmtswIz9WrZ+V2VnejCPHMABN4KViihADd8+O8OK+AytOBHl2fwNN+/uSXn/NVcaUFNNtS30csE6lPSUsfgpUSLX5KySf6ehvqUmZP5IZ/ZQntnPbEgrfXFak1rO6gyiRStNOr3+GDgSB8IejyykIO40GzeXug3c/+IxwwIxKysRwXMnbgRK13/V2Mno8IC214uudloaIoSNFtzkXdwPNGYiR5VT6T8k8yHkSHr5jQE6ht29l/GhvZUlLrOdYDSTMupB/AJ2TVUS9ty4NeTiVFgoGJU5GtP4xaPGtSU6uFk8LNOF/+RMb4MOvlswbxd1aP6QmeoKG4AoZEuEKqaPRMnbBG2yJelRbjL2R38zuiqa4AQH/rLsyNKV6iV7wdPK+UO01uqnSnXROqy+vdQ/TCN9b3U5lOAJ+ZjaHbJ4ISDY6PF3cZail/pBZrsFOcvT3xzBjdHTT98b3HKvm3QeyH9fGhhwFNBXzwywWkkdk3hnjo4II9aDlgRNRlRNuoZ78dLbyMfNHh3ZdKK5pgtuoW4i6eQZQdWHaX3AH1FDAae/8Sk9eRXN52DNFhVt6QkTy5GqQ0ypX2x5Yq8kZerQoJ3EgV/vgaA2A8gVha1fVE3ZGTUPIpQxdqwJWLaboU9bcfMKOyReSyMQWPkLXpo8jj09Agr8lJh X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(38100700002)(6486002)(66946007)(2616005)(31686004)(8936002)(4326008)(8676002)(66556008)(508600001)(66476007)(31696002)(5660300002)(2906002)(86362001)(36756003)(26005)(316002)(6512007)(6506007)(186003)(54906003)(6916009)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?AzwjCjp88kT3PEQuGo/qVrmjIOPF?= =?utf-8?q?JqPaIpkgCQKg2v26vLAKEK2JoWEhnkt+Sl38yFrb0iSO7ucs2VqK7viLfi4ez3CXo?= =?utf-8?q?GbRCxDX7Ffvc1D7TEvpxv9oTl6+KozdUzALmxcQP5ZP4g8TF69IYNJEmfRwj4YTz3?= =?utf-8?q?G3pqsiKTts/HapwceEEXoxV7eMqvTOeIfZvqMCIO+Dqho3rvlIR69pntef6u2kcuC?= =?utf-8?q?xQpVbH5tiN68FYgpKMunnld4OnFZpcoMFP6wlLBqPoaQPQd4z1tqRSTgcb3T8N33P?= =?utf-8?q?2GZzy/4Ax8TJANVp2fBll+TU4i7Jkoijw7dS1BANH2dWSZvVZoopHFtXVaMp9wDG1?= =?utf-8?q?dGhiMyWe7tG+PrUo64Wad79YeNTUYlloomnbuJPOeziTi1THuAdUDvRQBFaDvc0OK?= =?ut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ps4cql0B?= =?utf-8?q?ulNV49l4ozOIXSAp05Ggr3JOPpQtoTKA4SfI9k4clIlOhnvE3YLs2lztw13mJ87mx?= =?utf-8?q?h2So4BRlmhlps5UutLdZFYkR/jSLwrgQQ279sZ3Lhbn3XoBGRgddB5PHh3p7XCKFW?= =?utf-8?q?MqjzBjvkrINs3dFLRTcIWMrmsT0mdJqRHvE0USoRBX3K1AfjuQaW/JQfhu7LEiQQj?= =?utf-8?q?glVskDWwVT/h6PKCZeGkNJ4j2KlN/lwCFZTFPZKqByXvMi5fWGW1A0z8Tvh3IC/yu?= =?utf-8?q?TTMalnPTyY2SovD+p8wj/cg+Kjr4wOlQm8E9gprZvmkFsCo5uWWMb0s=3D?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 84970321-079e-4ff6-6f82-08da00414de3 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2022 13:49:30.7377 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 15ZtFMbPGn4DlimpAuBBID8TYuVEPHZwYRPVDLXN1re2M0VplyUO+oMwN9heKg3GgA1Lzpoqam0sKZ2cQQthqA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB5749 Support for this construct was added in 2.22 only. Avoid the need to introduce logic to probe for linker script capabilities by (ab)using the probe for a command line option having appeared at about the same time. Fixes: 4b7fd8153ddf ("x86: fold sections in final binaries") Signed-off-by: Jan Beulich --- Obviously this doesn't take care of old LLVM ld yet, if any care is needed there in the first place. --- a/xen/arch/x86/arch.mk +++ b/xen/arch/x86/arch.mk @@ -70,6 +70,11 @@ ifeq ($(CONFIG_UBSAN),y) $(call cc-option-add,CFLAGS_UBSAN,CC,-fno-sanitize=alignment) endif +# While not much better than going by raw GNU ld version, utilize that the +# feature we're after has appeared in the same release as the +# --print-output-format command line option. +AFLAGS-$(call ld-option,--print-output-format) += -DHAVE_LD_SORT_BY_INIT_PRIORITY + ifneq ($(CONFIG_PV_SHIM_EXCLUSIVE),y) efi-check := arch/x86/efi/check --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -30,6 +30,10 @@ ENTRY(start_pa) # define SECTION_ALIGN PAGE_SIZE #endif +#ifndef HAVE_LD_SORT_BY_INIT_PRIORITY +# define SORT_BY_INIT_PRIORITY SORT +#endif + OUTPUT_FORMAT(FORMAT, FORMAT, FORMAT) OUTPUT_ARCH(i386:x86-64)