While the change[1] didn't go in yet, there is the intention for the ELF
metadata annotations from xen/linkage.h to also effect honoring of
CONFIG_CC_SPLIT_SECTIONS. In code that's placement / ordering sensitive,
these annotations therefore need using with some care.

[1] https://lists.xen.org/archives/html/xen-devel/2024-02/msg00470.html

Fixes: fba250ae604e ("xen/arm64: head: Add missing code symbol annotations")
Signed-off-by: Jan Beulich <jbeul...@suse.com>
---
An alternative would be to use LABEL{,_LOCAL}() instead of FUNC{,_LOCAL}().
That would avoid the need for any override, but would also lose the type
information. Question is whether the annotated ranges really are
"functions" in whichever wide or narrow sense.

The Fixes: tag is slightly questionable, seeing that the patch actually
adding section switching didn't go in yet; the issue right now is a
latent one only. Whichever form of an adjustment we'll settle on will
likely want to become part of [1] above. Hence the RFC.

--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -28,6 +28,14 @@
 #include <asm/arm64/efibind.h>
 #endif
 
+/*
+ * Code here is, at least in part, ordering sensitive.  Annotations
+ * from xen/linkage.h therefore may not switch sections (honoring
+ * CONFIG_CC_SPLIT_SECTIONS).  Override the respective macro.
+ */
+#undef SYM_PUSH_SECTION
+#define SYM_PUSH_SECTION(name, attr)
+
 #define __HEAD_FLAG_PAGE_SIZE   ((PAGE_SHIFT - 10) / 2)
 
 #define __HEAD_FLAG_PHYS_BASE   1

Reply via email to