On 28.11.2025 14:38, Juergen Gross wrote:
> Today the linker script of Mini-OS specifies to merge all .note*
> sections into a single section .note:
> 
>  .note : {
>           *(.note)
>           *(.note.*)
>   }
> 
> It seems as if ld will use the attributes of the first .note* segment
> found during the linking process for the final .note segment.
> 
> Somewhere between binutils 2.43 and 2.45 something changed resulting in
> .note.GNU-stack being the first .note* segment found. Unfortunately
> this segment has unusual attributes: it has PROGBITS instead of NOTE as
> type, resulting in the Xen ELF parsing to no longer look into it for
> finding the Xen ELF-notes. This in turn will result in failure while
> trying to parse the binary, which will let domain creation fail.
> 
> In order to avoid this issue, enhance the linker script to merge
> .note.Xen before other .note.* segments, resulting in the final .note
> segment to still have the NOTE type.
> 
> Fixes: 6d1cc81d049f ("x86: switch to use elfnote")
> Signed-off-by: Juergen Gross <[email protected]>

Reviewed-by: Jan Beulich <[email protected]>

I wonder though ...

> --- a/arch/x86/minios-x86.lds.S
> +++ b/arch/x86/minios-x86.lds.S
> @@ -33,6 +33,7 @@ SECTIONS
>  
>          .note : {
>                  *(.note)
> +                *(.note.Xen)
>                  *(.note.*)
>          }

... what use .note here is. Can't it be dropped in exchange?

Jan

Reply via email to