[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] xen/linker: be more selective about defining LLVM_COV_*


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Wed, 26 Nov 2025 09:16:17 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=nN9FU3YhwW41N/ZD5R9CGRBkchKUcXTc79nVWn3IZwQ=; b=rNkDzL7imVEZ02SvAnSdEz22qeoL493pA3ihy3CHxEVi8b98Nq5SBsniGkJL/oASm7RYWV28rCkmDhEDOlRYiNyKIKyZvvSrPGTaGvYRZMa/D/bdZ/ZeHhb1YBFqqMLXsEUhT8fyQuWzHraqrhLQaWpk45i2scv3slX1oYa5OLQfQzgeIq1NllJ9RGnfeZZn86cUviizpVKCrg5YfWodk03kgctb65VvE8RJoa5TNf6OM07f+aLuodvUBq0hWJ91SGTOVumcQ5MwOO7SIBTlgp5JOWuv2N5vPJL8euAWDM4qIMkjAeQOBZlic5I7c1XcoSJYz7RVarfmdsBfsHRHAQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=px1jTPRgQxohkjDYTbc3bYyK5hVoFC662fBth/zyhmHF8t1WbvSlBM48NDcP3WwAWoYkso2hsQTJfJKZ30FiSu9AAkWwA5mStKvI6+50VtlvKZMVgdONZnLbUDcYbUHdNxaIxS5IngAQb54T9LhtAi9M8zGZaqL6IBUPt+tExOOeDD88GHO6kESAB1G4Az+c6dprS3Js42NryLClalJh4QdRkpm67Fr+JI2E0QxKCQrL7RiuSvsO0TuKz4UOuIIfurSIlrUYpUVpHIEh1XfVGAXK/uSFUxGigVJLK7jp2pEQz3N/b0+psJN6pWpsXVfirHn8XzXusAOtAdpWiUhQTA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Saman Dehghan <samaan.dehghan@xxxxxxxxx>
  • Delivery-date: Wed, 26 Nov 2025 08:17:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

There's no need to place the LLVM coverage sections in the linker script if
not building with clang, or if code coverage is not enabled.

No functional change intended.

Fixes: 186c02e85961 ('xen: Support LLVM raw profile versions 5, 6, 7, 8, 9, and 
10')
Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/include/xen/xen.lds.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/include/xen/xen.lds.h b/xen/include/xen/xen.lds.h
index d80c89595979..f54fb2d15290 100644
--- a/xen/include/xen/xen.lds.h
+++ b/xen/include/xen/xen.lds.h
@@ -81,6 +81,7 @@
   .stab.index 0 : { *(.stab.index) }         \
   .stab.indexstr 0 : { *(.stab.indexstr) }
 
+#if defined(CONFIG_CC_IS_CLANG) && defined(CONFIG_COVERAGE)
 /* Clang coverage sections. */
 #define LLVM_COV_RW_DATA                                   \
     DECL_SECTION(__llvm_prf_cnts) { *(__llvm_prf_cnts) }   \
@@ -93,6 +94,11 @@
 #define LLVM_COV_DEBUG                                     \
     DECL_DEBUG(__llvm_covfun, 8)                           \
     DECL_DEBUG(__llvm_covmap, 8)
+#else
+#define LLVM_COV_RW_DATA
+#define LLVM_COV_RO_DATA
+#define LLVM_COV_DEBUG
+#endif
 
 /*
  * ELF sections.
-- 
2.51.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.