From patchwork Fri Mar 11 13:28:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 12777998 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 134FFC433F5 for ; Fri, 11 Mar 2022 13:29:03 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.289032.490322 (Exim 4.92) (envelope-from ) id 1nSfK4-0007Ft-58; Fri, 11 Mar 2022 13:28:48 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 289032.490322; Fri, 11 Mar 2022 13:28:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nSfK4-0007Fm-1x; Fri, 11 Mar 2022 13:28:48 +0000 Received: by outflank-mailman (input) for mailman id 289032; Fri, 11 Mar 2022 13:28:47 +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 1nSfK3-0007Fg-HP for xen-devel@lists.xenproject.org; Fri, 11 Mar 2022 13:28:47 +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 2d68e693-a13f-11ec-8eba-a37418f5ba1a; Fri, 11 Mar 2022 14:28:46 +0100 (CET) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01lp2057.outbound.protection.outlook.com [104.47.0.57]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-39-yCitXWhaNTaPuZK36NXK1Q-1; Fri, 11 Mar 2022 14:28:45 +0100 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by HE1PR0401MB2569.eurprd04.prod.outlook.com (2603:10a6:3:7c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.22; Fri, 11 Mar 2022 13:28:43 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::e8ce:db1c:5bb0:af0]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::e8ce:db1c:5bb0:af0%6]) with mapi id 15.20.5061.022; Fri, 11 Mar 2022 13:28:42 +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: 2d68e693-a13f-11ec-8eba-a37418f5ba1a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1647005326; 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=oB9UyoUTlYD7+jOARvtGocxIQ/b7yV0YHAi0kIcsud0=; b=bjjeT33WbtJms+PnDPcFu3LUPsPFlUeFCu3lDTEBTUGxUfLDAeUQLbCWbZSmhH528fm8/i 0LdtX3CzFrn6Rsf5HSsr0gwiGGJ3cAT/IAo6A7gJo5Q5/Ll0Xwl9MXyev+3sGCBbeEKpma NKfsUwtQHJAm8+DgmkY4hjKmWG4cGt0= X-MC-Unique: yCitXWhaNTaPuZK36NXK1Q-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nYJVjNXBBJdwj6kC0B8Yr+BQgQ6HAllLUvQufDBT0YFZcG6q6mMNCst+fFchvjHGQvb76Fit5p9+9+Wd1MyNkmui0AjaPlg4g8UgbhXXvYqkMy2ulCbYqhWE0hyvotHh/e/uRUoAxibTxEzQn40TGZej0Zjx9h/fpIMqjkBdvvGipnezDwD0p3m91kwlTFjL4GkzCSqBA8T7r6TuDtKSOXbMwbtlt374YhVxQGc4nXsWl4NlHKyoe+EL3p4JXsmijncPgOxXFSSkAzuE7d2V5EZp3KqLSouxaBiW3oGWencgrTW47Obyj0Lz/PGH8rKlEizDrPv7w4m208G5pXnOaA== 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=oB9UyoUTlYD7+jOARvtGocxIQ/b7yV0YHAi0kIcsud0=; b=kZb+zeekyDAP+0pZOtfPEYcRrszixBEJe+WcyhTxpESxrsxed/P+tR3CBs1y4ni37odAbyG1KuphjAjDPt6nuFbtRmR2fsi0uujk2paSfGlK853+CO6CBX0t7KeaPvId0VFGQvtKo0QupMxlYShfJrsFXFdkOcVuXuP7Pdg4kEiykVBdCAdYa4FM/KmyBqNrVf1sk0PlCCF7FUKMEwvdk8IvkDRTJWPVIY5hqaKBAszItZlpg2ZQ3iv8lTQbpcuu2OyCkhrPeICX1eY25rEb9Lmo6+CMCZ4Y8SAJn01I0+D1oYqZ4DSONVozXoLv4vvrKwZ7JVc3+2N/pqT/dl+CEQ== 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: <97bebbfa-b5e8-4c57-162f-2a052de92f02@suse.com> Date: Fri, 11 Mar 2022 14:28:40 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 From: Jan Beulich Subject: [PATCH v2] x86: avoid SORT_BY_INIT_PRIORITY with old GNU ld To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Content-Language: en-US X-ClientProxiedBy: AS9PR0301CA0056.eurprd03.prod.outlook.com (2603:10a6:20b:469::34) 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: 7b981e2d-df7d-4d32-3c5e-08da03630f95 X-MS-TrafficTypeDiagnostic: HE1PR0401MB2569: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: rlaI/TW7tj8+B7Hz4DCXnyYmnVoVbVYY8WXTSatMoAwkthNjV+Lpj2zcuyF0mVdCdY29eiNrVtyM5xxFs5pM+MPXvr84L4W0GHL/Lj8QnUOIdMBPQSI/MQYJUd4prNrfvW402g0tN/c4k4A4S7jQD2zEhSqzjkGksrEtatTN5mZ5iNbHRlhN/SrpWO7Q1vGdzOlaWznwR3ss3ppH+w6aaczWj3IQ/l6TV5Az8FHr/eCy2eIwzYQJc8w9LjvPS6jhSvVn2MjZAO5UA4VjC+xlOmmvlhF2rSrtofDjllDTHa3QEUh4SYaKnGeEsiEGHQUi+OlLg99z4mU1MutHcb9OTsPOgDZk99U/nPfHmzWFwRKlUQF0344NLsggZptYojGLJu/zKmY7GzzMmPJ3s0OpzNbxQJOrji7xiPpIWJwWUDnIiuXB4lPorKjD2eyK1+HWsRt+kpTtVKNl7wq4ClUgDSfwzzhlQU/rLFJ4yWrEaqaO6ZEYu8jere+9RUaVm7KIpquhykkB0vm1DWv20yNbniPNcZ65b5mgimis/5BYdq948Dc8xrEgQdX9s4wRoEko7Oz0tqwjTxCIBL8RMrq+O0RLdsehKeMGwTuMEf29RHUcHNmBsLGLHTXqis3Or9j1StnChTfO2PGvUN4QuRzfDHdWcF3gW3detbV8ebVsI5sdoBYx4A5qz46hYJ71ugiXO5t0wJG95LZ8Rri6aqD0EgTCdvXVEuq1cVL/xy2GCa8= 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)(6486002)(6506007)(316002)(508600001)(38100700002)(8676002)(66476007)(66556008)(86362001)(66946007)(31696002)(5660300002)(4326008)(8936002)(54906003)(6916009)(2906002)(2616005)(186003)(26005)(31686004)(36756003)(6512007)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?V2HAvLZ9IyJY2X/RmND9C3Y2Ztb6?= =?utf-8?q?NImAzlI01TPE7bhuqcr8DSN6gjdFVKzBwOgEhXuNbrLKRscrXpQziN2FLzKzS/PJd?= =?utf-8?q?rZiuqEG71hhBDpwBm+ocwREM5yTmT6GDTme8iowJbB06pBhLT/HiKrUGw/Sa3ydQI?= =?utf-8?q?5JAOrxZ3mYj1EQGEwPqV7e8tttE+GJkNL9pARJxnpLkIAxfrb3YFqeEZRTSJeYGjQ?= =?utf-8?q?CV55ug6I2k9yBNRzWEEK0QG5XOKRlRtYVyKoG0R3imNWi0wf7MWF0KK+iIzef87Nr?= =?utf-8?q?4vHWHQ6XKBP6GHaj4D36ZItZbEsT4cSUMSrelYGYJ2Oqx6Vys1x/3NZde4EmWFG0L?= =?utf-8?q?MlOs6ir4yHvjnpy4zCWuQXBGpmAUUUeg4gEb9KuuIzYPmvcMHJGFVZ53bYiBicj6p?= =?utf-8?q?LpDBWnkbzAk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k7X/FMApBT3zUAAq4QYz0SMjAjfltz4C6RXqcNvuM7/ShSqcP2avOb34qweDJlXtD?= =?utf-8?q?nrzykhd4n070LAOXHp+LijqqqYjxuudbeuqIsxbn5hH4Y4jDG1+pXOz+JR0KC7JRO?= =?utf-8?q?GmkdruTxVDp1+q?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7b981e2d-df7d-4d32-3c5e-08da03630f95 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Mar 2022 13:28:42.6461 (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: hW8KFbyFTHy17yP0bUWSwmmVPEu8eZWf2y/Y9lREPLxEXhSnmdIpup3ex8hDSpVZV9znSrQ9IqgGAvs7336Dew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0401MB2569 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 --- v2: Always define HAVE_LD_SORT_BY_INIT_PRIORITY when using LLVM ld. --- a/xen/arch/x86/arch.mk +++ b/xen/arch/x86/arch.mk @@ -73,6 +73,16 @@ ifeq ($(CONFIG_UBSAN),y) $(call cc-option-add,CFLAGS_UBSAN,CC,-fno-sanitize=alignment) endif +ifeq ($(call success,$(LD) --version | head -n 1 | grep -q "GNU ld"),y) +# 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 +else +# Assume all versions of LLD support this. +AFLAGS += -DHAVE_LD_SORT_BY_INIT_PRIORITY +endif + 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)