Skip to content

MIPS VDSO is not built when using LLD #785

Closed
ClangBuiltLinux/continuous-integration
#275
@tpimh

Description

@tpimh

When using lld to link MIPS kernel, the following warning is triggered:

arch/mips/vdso/Makefile:62: MIPS VDSO requires binutils >= 2.25

With with this segment removed, VDSO is built:

#
# For the pre-R6 code in arch/mips/vdso/vdso.h for locating
# the base address of VDSO, the linker will emit a R_MIPS_PC32
# relocation in binutils > 2.25 but it will fail with older versions
# because that relocation is not supported for that symbol. As a result
# of which we are forced to disable the VDSO symbols when building
# with < 2.25 binutils on pre-R6 kernels. For more references on why we
# can't use other methods to get the base address of VDSO please refer to
# the comments on that file.
#
ifndef CONFIG_CPU_MIPSR6
ifeq ($(call ld-ifversion, -lt, 225000000, y),y)
$(warning MIPS VDSO requires binutils >= 2.25)
obj-vdso-y := $(filter-out vgettimeofday.o, $(obj-vdso-y))
ccflags-vdso += -DDISABLE_MIPS_VDSO
endif
endif

R_MIPS_PC32 relocation is supported by LLD: https://reviews.llvm.org/rLLD259782.

Metadata

Metadata

Assignees

Labels

[ARCH] mipsThis bug impacts ARCH=mips[BUG] linuxA bug that should be fixed in the mainline kernel.[FIXED][LINUX] 5.8This bug was fixed in Linux 5.8[TOOL] lldThe issue is relevant to LLD linker

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions