Skip to content

Commit 07015d7

Browse files
committed
MIPS: Disable VDSO time functionality on microMIPS
A check we're about to add to pick up on function calls that depend on bogus use of the GOT in the VDSO picked up on instances of such function calls in microMIPS builds. Since the code appears genuinely problematic, and given the relatively small amount of use & testing that microMIPS sees, go ahead & disable the VDSO for microMIPS builds. Signed-off-by: Paul Burton <[email protected]>
1 parent d3f703c commit 07015d7

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

arch/mips/vdso/Makefile

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ endif
5252

5353
CFLAGS_REMOVE_vgettimeofday.o = -pg
5454

55+
DISABLE_VDSO := n
56+
5557
#
5658
# For the pre-R6 code in arch/mips/vdso/vdso.h for locating
5759
# the base address of VDSO, the linker will emit a R_MIPS_PC32
@@ -65,11 +67,24 @@ CFLAGS_REMOVE_vgettimeofday.o = -pg
6567
ifndef CONFIG_CPU_MIPSR6
6668
ifeq ($(call ld-ifversion, -lt, 225000000, y),y)
6769
$(warning MIPS VDSO requires binutils >= 2.25)
68-
obj-vdso-y := $(filter-out vgettimeofday.o, $(obj-vdso-y))
69-
ccflags-vdso += -DDISABLE_MIPS_VDSO
70+
DISABLE_VDSO := y
7071
endif
7172
endif
7273

74+
#
75+
# GCC (at least up to version 9.2) appears to emit function calls that make use
76+
# of the GOT when targeting microMIPS, which we can't use in the VDSO due to
77+
# the lack of relocations. As such, we disable the VDSO for microMIPS builds.
78+
#
79+
ifdef CONFIG_CPU_MICROMIPS
80+
DISABLE_VDSO := y
81+
endif
82+
83+
ifeq ($(DISABLE_VDSO),y)
84+
obj-vdso-y := $(filter-out vgettimeofday.o, $(obj-vdso-y))
85+
ccflags-vdso += -DDISABLE_MIPS_VDSO
86+
endif
87+
7388
# VDSO linker flags.
7489
VDSO_LDFLAGS := \
7590
-Wl,-Bsymbolic -Wl,--no-undefined -Wl,-soname=linux-vdso.so.1 \

0 commit comments

Comments
 (0)