While executing the recipe for arch/x86/entry/vdso/vdsox32.so: gcc -nostdlib -o arch/x86/entry/vdso/vdsox32.so.dbg -fPIC -shared -Wl,--hash-style=both -Wl,--build-id -Wl,-Bsymbolic -Wl,-m,elf32_x86_64 -Wl,-soname=linux-vdso.so.1 -Wl,-z,max-page-size=4096 -Wl,-z,common-page-size=4096 -Wl,-T,arch/x86/entry/vdso/vdsox32.lds arch/x86/entry/vdso/vdso-note-x32.o arch/x86/entry/vdso/vclock_gettime-x32.o arch/x86/entry/vdso/vgetcpu-x32.o && sh ./arch/x86/entry/vdso/checkundef.sh 'nm' 'arch/x86/entry/vdso/vdsox32.so.dbg' arch/x86/entry/vdso/vclock_gettime-x32.o:vclock_gettime.c:function __vdso_clock_gettime: error: relocation overflow: reference to 'vvar_vsyscall_gtod_data' arch/x86/entry/vdso/vclock_gettime-x32.o:vclock_gettime.c:function __vdso_gettimeofday: error: relocation overflow: reference to 'vvar_vsyscall_gtod_data' arch/x86/entry/vdso/vclock_gettime-x32.o:vclock_gettime.c:function __vdso_time: error: relocation overflow: reference to 'vvar_vsyscall_gtod_data' collect2: error: ld returned 1 exit status This error causes the subsequent call to objcopy to fail, thus aborting the build. objcopy -S arch/x86/entry/vdso/vdsox32.so.dbg arch/x86/entry/vdso/vdsox32.so objcopy: 'arch/x86/entry/vdso/vdsox32.so.dbg': No such file make[3]: *** [arch/x86/entry/vdso/Makefile:124: arch/x86/entry/vdso/vdsox32.so] Error 1 $ ld --version | head -n1 GNU gold (Gentoo 2.27 p1.0 2.27) 1.12 A workaround is to force usage of the BFD linker when linking the x32 VDSO: --- arch/x86/entry/vdso/Makefile~ 2016-10-02 23:24:33.000000000 +0000 +++ arch/x86/entry/vdso/Makefile 2016-11-16 09:35:13.406216597 +0000 @@ -97,6 +97,7 @@ CPPFLAGS_vdsox32.lds = $(CPPFLAGS_vdso.lds) VDSO_LDFLAGS_vdsox32.lds = -Wl,-m,elf32_x86_64 \ + -fuse-ld=bfd \ -Wl,-soname=linux-vdso.so.1 \ -Wl,-z,max-page-size=4096 \ -Wl,-z,common-page-size=4096 Then vdsox32.so.dbg links without error. This problem just started happening upon upgrading from binutils 2.26.1 to 2.27.
See: https://sourceware.org/bugzilla/show_bug.cgi?id=20833
same problem. same solution gentoo-sources-4.14.56
The workaround in Comment #0 is no longer sufficient as of Linux 4.19. Now I additionally must specify "LD=ld.bfd" on the 'make' command line.
with 4.20 i couldn't even do that, i had to temporarily change default linker
With 5.1 I am using the following hack: --- linux/Makefile.orig +++ linux/Makefile @@ -393,7 +393,7 @@ # Make variables (CC, etc...) AS = $(CROSS_COMPILE)as -LD = $(CROSS_COMPILE)ld +LD = $(CROSS_COMPILE)ld.bfd CC = $(CROSS_COMPILE)gcc CPP = $(CC) -E AR = $(CROSS_COMPILE)ar Please note this is for .config with # CONFIG_X86_X32 is not set So may be #0 is additionally needed.