On 2026-02-06 11:36, Jens Remus wrote:
> From: Josh Poimboeuf <[email protected]>
>
> Enable sframe generation in the VDSO library so kernel and user space
> can unwind through it.
>
> SFrame isn't supported for x32 or x86-32. Discard .sframe sections for
> those VDSOs.
>
> [ Jens Remus: Add support for SFrame V3. Prevent GNU_SFRAME program
> table entry to empty .sframe section. ]
>
This will not break the x86-32 build if the assembler encounters .sframe?
> Notes (jremus):
> Changes in v8:
> - Discard .sframe for x32 and x86-32 VDSOs. (Josh/Indu)
> Note that the use of KEEP_SFRAME enables to define it for x86-64
> VDSO only. Unlike CONFIG_AS_SFRAME, which may also be defined
> for x32 and x86-32 VDSO. In x32 VDSO it would result in superfluous
> .sframe (copied from the x86-64 build - could be removed in X32
> build step). In x86-32 VDSO it would cause a bogus GNU_SFRAME
> program table entry.
For x32, this would be a "valid" sframe, right, even if the tools currently
don't know how to consume it (and potentially never will)? If so, is there
really any reason to explicitly remove it?
> /*
> * Text is well-separated from actual data: there's plenty of
> * stuff that isn't used at runtime in between.
> @@ -80,6 +87,10 @@ SECTIONS
> *(.discard)
> *(.discard.*)
> *(__bug_table)
> +#ifndef KEEP_SFRAME
> + *(.sframe)
> + *(.sframe.*)
> +#endif
This #ifndef is actually not necessary: if we have already "consumed" the
.sframe* sections they will not be encountered here.
I would prefer to have KEEP_SFRAME always defined (as true or false, and using
#if) instead of using #ifdef. I believe that also means you can do:
#define KEEP_SFRAME IS_ENABLED(CONFIG_AS_SFRAME)
... instead of #ifdef.
-hpa