| .. | .. |
|---|
| 19 | 19 | $(CLANG_FLAGS) \ |
|---|
| 20 | 20 | -D__VDSO__ |
|---|
| 21 | 21 | |
|---|
| 22 | +ifndef CONFIG_64BIT |
|---|
| 23 | +ccflags-vdso += -DBUILD_VDSO32 |
|---|
| 24 | +endif |
|---|
| 25 | + |
|---|
| 22 | 26 | # |
|---|
| 23 | 27 | # The -fno-jump-tables flag only prevents the compiler from generating |
|---|
| 24 | 28 | # jump tables but does not prevent the compiler from emitting absolute |
|---|
| .. | .. |
|---|
| 26 | 30 | cflags-vdso := $(ccflags-vdso) \ |
|---|
| 27 | 31 | $(filter -W%,$(filter-out -Wa$(comma)%,$(KBUILD_CFLAGS))) \ |
|---|
| 28 | 32 | -O3 -g -fPIC -fno-strict-aliasing -fno-common -fno-builtin -G 0 \ |
|---|
| 33 | + -mrelax-pic-calls $(call cc-option, -mexplicit-relocs) \ |
|---|
| 29 | 34 | -fno-stack-protector -fno-jump-tables -DDISABLE_BRANCH_PROFILING \ |
|---|
| 30 | | - $(call cc-option, -fno-asynchronous-unwind-tables) \ |
|---|
| 31 | | - $(call cc-option, -fno-stack-protector) |
|---|
| 35 | + $(call cc-option, -fno-asynchronous-unwind-tables) |
|---|
| 32 | 36 | aflags-vdso := $(ccflags-vdso) \ |
|---|
| 33 | 37 | -D__ASSEMBLY__ -Wa,-gdwarf-2 |
|---|
| 34 | 38 | |
|---|
| .. | .. |
|---|
| 44 | 48 | |
|---|
| 45 | 49 | CFLAGS_REMOVE_vgettimeofday.o = -pg |
|---|
| 46 | 50 | |
|---|
| 47 | | -# |
|---|
| 48 | | -# For the pre-R6 code in arch/mips/vdso/vdso.h for locating |
|---|
| 49 | | -# the base address of VDSO, the linker will emit a R_MIPS_PC32 |
|---|
| 50 | | -# relocation in binutils > 2.25 but it will fail with older versions |
|---|
| 51 | | -# because that relocation is not supported for that symbol. As a result |
|---|
| 52 | | -# of which we are forced to disable the VDSO symbols when building |
|---|
| 53 | | -# with < 2.25 binutils on pre-R6 kernels. For more references on why we |
|---|
| 54 | | -# can't use other methods to get the base address of VDSO please refer to |
|---|
| 55 | | -# the comments on that file. |
|---|
| 56 | | -# |
|---|
| 57 | | -ifndef CONFIG_CPU_MIPSR6 |
|---|
| 58 | | - ifeq ($(call ld-ifversion, -lt, 225000000, y),y) |
|---|
| 51 | +ifdef CONFIG_MIPS_DISABLE_VDSO |
|---|
| 52 | + ifndef CONFIG_MIPS_LD_CAN_LINK_VDSO |
|---|
| 59 | 53 | $(warning MIPS VDSO requires binutils >= 2.25) |
|---|
| 60 | | - obj-vdso-y := $(filter-out vgettimeofday.o, $(obj-vdso-y)) |
|---|
| 61 | | - ccflags-vdso += -DDISABLE_MIPS_VDSO |
|---|
| 62 | 54 | endif |
|---|
| 55 | + obj-vdso-y := $(filter-out vgettimeofday.o, $(obj-vdso-y)) |
|---|
| 63 | 56 | endif |
|---|
| 64 | 57 | |
|---|
| 65 | 58 | # VDSO linker flags. |
|---|
| 66 | | -VDSO_LDFLAGS := \ |
|---|
| 67 | | - -Wl,-Bsymbolic -Wl,--no-undefined -Wl,-soname=linux-vdso.so.1 \ |
|---|
| 68 | | - $(addprefix -Wl$(comma),$(filter -E%,$(KBUILD_CFLAGS))) \ |
|---|
| 69 | | - -nostdlib -shared \ |
|---|
| 70 | | - $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) \ |
|---|
| 71 | | - $(call cc-ldoption, -Wl$(comma)--build-id) |
|---|
| 59 | +ldflags-y := -Bsymbolic --no-undefined -soname=linux-vdso.so.1 \ |
|---|
| 60 | + $(filter -E%,$(KBUILD_CFLAGS)) -nostdlib -shared \ |
|---|
| 61 | + -G 0 --eh-frame-hdr --hash-style=sysv --build-id=sha1 -T |
|---|
| 72 | 62 | |
|---|
| 73 | 63 | CFLAGS_REMOVE_vdso.o = -pg |
|---|
| 74 | 64 | |
|---|
| 75 | 65 | GCOV_PROFILE := n |
|---|
| 66 | +UBSAN_SANITIZE := n |
|---|
| 67 | +KCOV_INSTRUMENT := n |
|---|
| 68 | + |
|---|
| 69 | +# Check that we don't have PIC 'jalr t9' calls left |
|---|
| 70 | +quiet_cmd_vdso_mips_check = VDSOCHK $@ |
|---|
| 71 | + cmd_vdso_mips_check = if $(OBJDUMP) --disassemble $@ | egrep -h "jalr.*t9" > /dev/null; \ |
|---|
| 72 | + then (echo >&2 "$@: PIC 'jalr t9' calls are not supported"; \ |
|---|
| 73 | + rm -f $@; /bin/false); fi |
|---|
| 76 | 74 | |
|---|
| 77 | 75 | # |
|---|
| 78 | 76 | # Shared build commands. |
|---|
| 79 | 77 | # |
|---|
| 80 | 78 | |
|---|
| 81 | 79 | quiet_cmd_vdsold_and_vdso_check = LD $@ |
|---|
| 82 | | - cmd_vdsold_and_vdso_check = $(cmd_vdsold); $(cmd_vdso_check) |
|---|
| 83 | | - |
|---|
| 84 | | -quiet_cmd_vdsold = VDSO $@ |
|---|
| 85 | | - cmd_vdsold = $(CC) $(c_flags) $(VDSO_LDFLAGS) \ |
|---|
| 86 | | - -Wl,-T $(filter %.lds,$^) $(filter %.o,$^) -o $@ |
|---|
| 80 | + cmd_vdsold_and_vdso_check = $(cmd_ld); $(cmd_vdso_check); $(cmd_vdso_mips_check) |
|---|
| 87 | 81 | |
|---|
| 88 | 82 | quiet_cmd_vdsoas_o_S = AS $@ |
|---|
| 89 | 83 | cmd_vdsoas_o_S = $(CC) $(a_flags) -c -o $@ $< |
|---|
| .. | .. |
|---|
| 93 | 87 | $(obj)/%.so.raw: $(obj)/%.so.dbg.raw FORCE |
|---|
| 94 | 88 | $(call if_changed,objcopy) |
|---|
| 95 | 89 | |
|---|
| 96 | | -hostprogs-y := genvdso |
|---|
| 90 | +hostprogs := genvdso |
|---|
| 97 | 91 | |
|---|
| 98 | 92 | quiet_cmd_genvdso = GENVDSO $@ |
|---|
| 99 | 93 | define cmd_genvdso |
|---|