On 28.01.2026 15:35, Jason Andryuk wrote:
> On 2025-04-01 06:58, Jan Beulich wrote:
>> Leverage the new infrastructure in xen/linkage.h to also switch to per-
>> function sections (when configured), deriving the specific name from the
>> "base" section in use at the time FUNC() is invoked.
>>
>> Signed-off-by: Jan Beulich <[email protected]>
>> Tested-by: Luca Fancellu <[email protected]> # arm
> 
> Reviewed-by: Jason Andryuk <[email protected]>

Thanks, but ...

> Though I have two suggestions below.

... at least the latter really needs addressing.

>> --- a/Config.mk
>> +++ b/Config.mk
>> @@ -102,7 +102,7 @@ cc-option = $(shell if $(1) $(2:-Wno-%=-
>>   # Usage: $(call cc-option-add CFLAGS,CC,-march=winchip-c6)
> 
> Maybe expand to illustrate extra flags will also be passed 
> (-DHAVE_AS_SECTNAME_SUBST)?

I'm not sure here, but I can certainly add another example.

>> --- a/xen/arch/arm/arm32/head.S
>> +++ b/xen/arch/arm/arm32/head.S
>> @@ -48,6 +48,13 @@
>>   
>>           .section .text.header, "ax", %progbits
>>           .arm
>> +/*
>> + * Code below wants to all live in the section established above.  
>> 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)
> 
> I put this through CI and it passed as-is, so it doesn't need to change. 
>   However, included in a different branch with some --gc-sections 
> experiments, I needed to add SYM_PUSH_SECTION re-definitions like above to:
> 
> xen/arch/ppc/ppc64/head.S
> 
> or ppc failed the linker script
> ASSERT(_stext_exceptions == EXCEPTION_VECTORS_START);

Yes, and exceptions-asm.S as well, to keep the code in .text.exceptions.

> And these:
> 
> xen/arch/riscv/riscv64/head.S
> xen/arch/arm/arm64/mmu/head.S
> 
> riscv and arm64 built, but hung when booting in CI tests.
> 
> There are also these:
> xen/arch/arm/arm32/mpu/head.S
> xen/arch/arm/arm64/mpu/head.S

Yeah, I need to re-scan the tree for all .section directives in *.S files.

This is getting out of hand, I fear, so rather than putting such overrides
in perhaps dozens of places I shall try to think of some less intrusive
approach.

I further think I need another prereq change. Right now e.g. PPC64's
.text.exceptions would collide with the code generated for a hypothetical
function named exceptions(). I don't like Linux'es .text..* etc very much,
but unless I can think of anything better we may need to follow that model.

Jan

Reply via email to