[PATCH v2 2/2] arm64: vdso: enable orphan handling for VDSO

Vincenzo Frascino vincenzo.frascino at arm.com
Fri Apr 8 00:20:55 PDT 2022



On 4/7/22 11:13 AM, Joey Gouly wrote:
> Like vmlinux, enable orphan-handling for the VDSO. This can catch
> subtle errors that might arise from unexpected sections being included.
> 
> Signed-off-by: Joey Gouly <joey.gouly at arm.com>

Reviewed-by: Vincenzo Frascino <vincenzo.frascino at arm.com>

> Cc: Catalin Marinas <catalin.marinas at arm.com>
> Cc: Will Deacon <will at kernel.org>
> Cc: Masahiro Yamada <masahiroy at kernel.org>
> Cc: Vincenzo Frascino <vincenzo.frascino at arm.com>
> Cc: Kees Cook <keescook at chromium.org>
> ---
>  arch/arm64/kernel/vdso/Makefile | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makefile
> index 172452f79e46..623d9ad2c717 100644
> --- a/arch/arm64/kernel/vdso/Makefile
> +++ b/arch/arm64/kernel/vdso/Makefile
> @@ -24,7 +24,13 @@ btildflags-$(CONFIG_ARM64_BTI_KERNEL) += -z force-bti
>  # routines, as x86 does (see 6f121e548f83 ("x86, vdso: Reimplement vdso.so
>  # preparation in build-time C")).
>  ldflags-y := -shared -soname=linux-vdso.so.1 --hash-style=sysv	\
> -	     -Bsymbolic --build-id=sha1 -n $(btildflags-y) -T
> +	     -Bsymbolic --build-id=sha1 -n $(btildflags-y)
> +
> +ifdef CONFIG_LD_ORPHAN_WARN
> +  ldflags-y += --orphan-handling=warn
> +endif
> +
> +ldflags-y += -T
>  
>  ccflags-y := -fno-common -fno-builtin -fno-stack-protector -ffixed-x18
>  ccflags-y += -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO

-- 
Regards,
Vincenzo



More information about the linux-arm-kernel mailing list