On 05.12.2025 23:28, Jason Andryuk wrote:
> --- a/xen/arch/x86/xen.lds.S
> +++ b/xen/arch/x86/xen.lds.S
> @@ -76,7 +76,7 @@ SECTIONS
>    _start = .;
>    DECL_SECTION(.text) {
>          _stext = .;            /* Text and read-only data */
> -       *(.text.header)
> +       KEEP(*(.text.header))

Andrew already commented on the KEEP()s, yet I'd like to extend on that. The
one above looks to be necessary (from an abstract pov; in practice it shouldn't
be necessary due the entry point being there), but ...

> @@ -98,7 +98,7 @@ SECTIONS
>  #endif
>         *(.text.__x86_indirect_thunk_*)
>  
> -       *(.fixup)
> +       KEEP(*(.fixup))
>         *(.gnu.warning)
>         _etext = .;             /* End of text section */
>    } PHDR(text) = 0x9090
> @@ -116,12 +116,12 @@ SECTIONS
>         . = ALIGN(8);
>         /* Exception table */
>         __start___ex_table = .;
> -       *(.ex_table)
> +       KEEP(*(.ex_table))

... these two for example should be strictly be omitted (as Andrew also hinted
at). I think more preparatory work is necessary here: We may need to use
section groups to associate auxiliary sections with their main ones. Otherwise,
by pulling in full .fixup or .ex_table from an object file, technically unused
.text.* would also need to be retained (due to .fixup / .ex_table having
references into there).

Jan

Reply via email to