From 9f696f2cf9eb0bd5821e6e217c3a7594114761e4 Mon Sep 17 00:00:00 2001 From: Nick Desaulniers Date: Thu, 6 Dec 2018 19:12:00 +0000 Subject: [PATCH] vdso32: Drop implicit common-page-size linker flag These are implied by the target architecture and for x86_64 match the max-page-size. The default for non-NaCl x86_64 is 0x1000 (4096). In bfd the common page size is defined as 0x1000 (4096) for non-NaCl x86_64 targets: bfd/elf64-x86-64.c: 4998:#define ELF_COMMONPAGESIZE 0x1000 For gold, the common page size is defined as 0x1000 (4096) for non-NaCl x86_64 targets: gold/x86_64.cc: 1413: 0x1000, // common_pagesize (overridable by -z common-page-size) 1442: 0x1000, // common_pagesize (overridable by -z common-page-size) (ELF_COMMONPAGESIZE also defaults to ELF_MAXPAGESIZE when not set explicitly for a target architecture in bfd/elfxx-target.h, but that's not relevant for x86_64). Because it's implied by the target architecture, it's of questionable use to implement in LLD. This patch resolves one of the issues towards using LLD to link an x86_64 kernel. Fixes commit 2aae950b21e4 ("x86_64: Add vDSO for x86-64 with gettimeofday/clock_gettime/getcpu") Change-Id: If8c517223f705dc5d2dac43ebeb1fac1c6a9d484 Link: https://bugs.llvm.org/show_bug.cgi?id=38774 Link: https://github.com/ClangBuiltLinux/linux/issues/31 Cc: Fangrui Song Cc: Andi Kleen Cc: Andi Kleen Reported-by: Dmitry Golovin Reported-by: Bill Wendling Suggested-by: Dmitry Golovin Suggested-by: Rui Ueyama Signed-off-by: Nick Desaulniers Signed-off-by: Adam W. Willis Signed-off-by: mcdachpappe --- arch/arm/vdso/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm/vdso/Makefile b/arch/arm/vdso/Makefile index bcc46c378929..227691ea4e2a 100644 --- a/arch/arm/vdso/Makefile +++ b/arch/arm/vdso/Makefile @@ -10,8 +10,7 @@ ccflags-y := -fPIC -fno-common -fno-builtin -fno-stack-protector ccflags-y += -DDISABLE_BRANCH_PROFILING ldflags-y = -Bsymbolic --no-undefined -soname=linux-vdso.so.1 \ - -z max-page-size=4096 -z common-page-size=4096 \ - -nostdlib -shared \ + -z max-page-size=4096 -nostdlib -shared \ $(call ld-option, --hash-style=sysv) \ $(call ld-option, --build-id) \ -T