Hi Brian!

On 7/14/2026 2:28 AM, Brian Norris wrote:
> On Tue, May 19, 2026 at 01:05:23PM +0200, Jens Remus wrote:

> I also work at the same company as Dylan and Mostafa, and am therefore
> probably using the same company-maintained Linux distribution.
> 
>> On 5/18/2026 7:55 PM, Dylan Hatch wrote:
>>> On Fri, May 15, 2026 at 4:32 AM Mostafa Saleh <[email protected]> wrote:
>>>> Not sure if related, but after updating my toolchain
>>>> (aarch64-linux-gnu-gcc (Debian 15.2.0-4) 15.2.0), I hit link errors:
>>>> ld.lld: error: arch/arm64/kernel/vdso/vgettimeofday.o:(.sframe) is being 
>>>> placed in '.sframe'
>>>> ld.lld: error: arch/arm64/kernel/vdso/vgetrandom.o:(.sframe) is being 
>>>> placed in '.sframe`

My understanding of above message is that the linker complains that the
input object (e.g. vgettimeofday.o) has an .sframe section for which
the linker script does not have any rule, so that it defaults to place
it in .sframe in the output, which could not be the desired result.

> I've also been hitting this for some time, and I'd like to see if I can
> figure out what's going wrong. My current workaround is:
> 
> --- a/Makefile
> +++ b/Makefile
> @@ -946,6 +946,8 @@ ifdef CONFIG_CC_IS_GCC
>  KBUILD_CFLAGS        += $(call cc-option,--param=allow-store-data-races=0)
>  KBUILD_CFLAGS        += $(call cc-option,-fno-allow-store-data-races)
>  endif
> +# No sframe generation for kernel if enabled by default
> +KBUILD_CFLAGS        += $(call cc-option,-Xassembler --gsframe=no)
>  
>  ifdef CONFIG_READABLE_ASM
>  # Disable optimizations that make assembler listings hard to read.
> 
>>> Previously when developing against the SFrame V2 format, I had fixed
>>> these warnings with the VDSO Makefile change currently in this series:
>>>
>>> diff --git a/arch/arm64/kernel/vdso/Makefile 
>>> b/arch/arm64/kernel/vdso/Makefile
>>> index 7dec05dd33b7..c60ef921956f 100644
>>> --- a/arch/arm64/kernel/vdso/Makefile
>>> +++ b/arch/arm64/kernel/vdso/Makefile
>>> @@ -38,7 +38,7 @@ ccflags-y += -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO
>>>  CC_FLAGS_REMOVE_VDSO := $(CC_FLAGS_FTRACE) -Os $(CC_FLAGS_SCS) \
>>>                         $(RANDSTRUCT_CFLAGS) $(KSTACK_ERASE_CFLAGS) \
>>>                         $(GCC_PLUGINS_CFLAGS) \
>>> -                       $(CC_FLAGS_LTO) $(CC_FLAGS_CFI) \
>>> +                       $(CC_FLAGS_LTO) $(CC_FLAGS_CFI) $(CC_FLAGS_SFRAME) \
>>>                         -Wmissing-prototypes -Wmissing-declarations
>>>
>>>  CC_FLAGS_ADD_VDSO := -O2 -mcmodel=tiny -fasynchronous-unwind-tables
>>>
>>> But the warnings seem to have returned after upgrading my toolchain,
>>> possibly due to SFrame V3 or some confounding change in GCC. The
>>> --gsframe in the assembler should be set to 'no' by default, so
>>> perhaps GCC is providing an override --gsframe internally?
>>
>> Could it be that your build of binutils was configured with
>> --enable-default-sframe, so that the GNU assembler defaults to generate
>> .sframe?  AFAIK this configure option was meant for distributors and
>> package maintainers.
>>
>> You can check as follows whether --gsframe defaults to "no" or "yes":
>>
>> $ as --help | grep -A1 gsframe
>>   --gsframe[={no|yes}]    whether to generate SFrame stack trace information
>>                           (default: no)
>> ...
> 
> $ aarch64-linux-gnu-as --help | grep -A1 gsframe
>   --gsframe[={no|yes}]    whether to generate SFrame stack trace information
>                           (default: no)
> --
>   --gsframe-<N>           generate SFrame version <N> information. 3 == <N>
>   --scfi=experimental     Synthesize DWARF CFI for hand-written asm
> 
>> Maybe build the VDSO separately with V=1 to see what assembler/compiler
>> options are effectively used (e.g. for vgettimeofday.o and vgetrandom.o
>> mentioned in the linker error message above)?
> 
> A slightly tweaked version of my vgetrandom.o build line:
> 
> # CC      arch/arm64/kernel/vdso/vgetrandom.o
>   aarch64-linux-gnu-gcc -Wp,-MMD,arch/arm64/kernel/vdso/.vgetrandom.o.d 
> -nostdinc -I./arch/arm64/include -I./arch/arm64/include/generated -I./include 
> -I./include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi 
> -I./include/uapi -I./include/generated/uapi -include 
> ./include/linux/compiler-version.h -include ./include/linux/kconfig.h 
> -include ./include/linux/compiler_types.h -D__KERNEL__ -mlittle-endian 
> -DCC_USING_PATCHABLE_FUNCTION_ENTRY -DKASAN_SHADOW_SCALE_SHIFT= -Werror 
> -fshort-wchar -funsigned-char -fno-common -fno-PIE -fno-strict-aliasing 
> -std=gnu11 -fms-extensions -mgeneral-regs-only -DCONFIG_CC_HAS_K_CONSTRAINT=1 
> -Wno-psabi -mabi=lp64 -fno-asynchronous-unwind-tables -fno-unwind-tables 
> -mbranch-protection=pac-ret -Wa,-march=armv8.5-a 
> -DARM64_ASM_ARCH='"armv8.5-a"' -DKASAN_SHADOW_SCALE_SHIFT= 
> -fno-delete-null-pointer-checks -O2 -fno-allow-store-data-races 
> -fstack-protector-strong -fno-omit-frame-pointer -fno-optimize-sibling-calls 
> -ftrivial-auto-var-init=zero -fzero-init-padding-bits=all 
> -fno-stack-clash-protection -fno-inline-functions-called-once 
> -fmin-function-alignment=8 -fstrict-flex-arrays=3 -fno-strict-overflow 
> -fno-stack-check -fconserve-stack -fno-builtin-wcslen -Wall -Wextra -Wundef 
> -Werror=implicit-function-declaration -Werror=implicit-int 
> -Werror=return-type -Werror=strict-prototypes -Wno-format-security 
> -Wno-trigraphs -Wno-frame-address -Wno-address-of-packed-member 
> -Wframe-larger-than=2048 -Wno-main -Wno-type-limits -Wno-dangling-pointer 
> -Wvla-larger-than=1 -Wno-pointer-sign -Wcast-function-type 
> -Wno-unterminated-string-initialization -Wno-array-bounds 
> -Wno-stringop-overflow -Wno-alloc-size-larger-than -Wimplicit-fallthrough=5 
> -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init 
> -Wenum-conversion -Wunused -Wno-unused-but-set-variable 
> -Wno-unused-const-variable -Wno-packed-not-aligned -Wno-format-overflow 
> -Wno-format-truncation -Wno-stringop-truncation -Wno-override-init 
> -Wno-missing-field-initializers -Wno-shift-negative-value 
> -Wno-maybe-uninitialized -Wno-sign-compare -Wno-unused-parameter -g 
> -mstack-protector-guard=sysreg -mstack-protector-guard-reg=sp_el0 
> -mstack-protector-guard-offset=1344 -fno-common -fno-builtin 
> -fno-stack-protector -ffixed-x18 -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO -O2 
> -mcmodel=tiny -fasynchronous-unwind-tables -include ./lib/vdso/getrandom.c   
> -I./arch/arm64/kernel/vdso -Iarch/arm64/kernel/vdso    
> -DKBUILD_MODFILE='"arch/arm64/kernel/vdso/vgetrandom"' 
> -DKBUILD_BASENAME='"vgetrandom"' -DKBUILD_MODNAME='"vgetrandom"' 
> -D__KBUILD_MODNAME=vgetrandom -c -o arch/arm64/kernel/vdso/vgetrandom.o 
> ./arch/arm64/kernel/vdso/vgetrandom.c

That command line does not have any --gsframe[-3] (e.g. -Wa,--gsframe).
I am not aware of any binutils release / repository state where the
--gsframe default was broken.

@Indu: Do you have any idea what could be going on?

> I mostly don't know what I'm looking for w.r.t. gsframe features, but
> I'm willing to poke at my compiler/assembler/build-process.

Could it be that your gcc injects --gsframe e.g. via its spec file?
Maybe that would show up if you run above command manually and append
gcc option -v?

Does the intermediate source or assembler source have any
".cfi_section .sframe" statement?

$ make arch/arm64/kernel/vdso/vgetrandom.i
$ make arch/arm64/kernel/vdso/vgetrandom.s

Can you please verify that your arch/arm64/kernel/vdso/vgetrandom.o
actually contains an .sframe section:

$ readelf -WS arch/arm64/kernel/vdso/vgetrandom.o

Thanks and regards,
Jens
-- 
Jens Remus
Linux on Z Development (D3303)
[email protected] / [email protected]

IBM Deutschland Research & Development GmbH; Vorsitzender des Aufsichtsrats: 
Wolfgang Wendt; Geschäftsführung: David Faller; Sitz der Gesellschaft: 
Ehningen; Registergericht: Amtsgericht Stuttgart, HRB 243294
IBM Data Privacy Statement: https://www.ibm.com/privacy/


Reply via email to