Commit 89ff7131 authored by Masahiro Yamada's avatar Masahiro Yamada
Browse files

kbuild: add --hash-style= and --build-id unconditionally



As commit 1e022137 ("mips: vdso: drop unnecessary cc-ldoption")
explained, these flags are supported by the minimal required version
of binutils. They are supported by ld.lld too.

Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: default avatarNathan Chancellor <natechancellor@gmail.com>
Tested-by: default avatarNathan Chancellor <natechancellor@gmail.com>
parent 5ef87263
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -900,10 +900,8 @@ KBUILD_CPPFLAGS += $(ARCH_CPPFLAGS) $(KCPPFLAGS)
KBUILD_AFLAGS   += $(ARCH_AFLAGS)   $(KAFLAGS)
KBUILD_CFLAGS   += $(ARCH_CFLAGS)   $(KCFLAGS)

# Use --build-id when available.
LDFLAGS_BUILD_ID := $(call ld-option, --build-id)
KBUILD_LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID)
LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID)
KBUILD_LDFLAGS_MODULE += --build-id
LDFLAGS_vmlinux += --build-id

ifeq ($(CONFIG_STRIP_ASM_SYMS),y)
LDFLAGS_vmlinux	+= $(call ld-option, -X,)
+1 −2
Original line number Diff line number Diff line
@@ -13,8 +13,7 @@ ccflags-y += -DDISABLE_BRANCH_PROFILING
ldflags-$(CONFIG_CPU_ENDIAN_BE8) := --be8
ldflags-y := -Bsymbolic --no-undefined -soname=linux-vdso.so.1 \
	    -z max-page-size=4096 -nostdlib -shared $(ldflags-y) \
	    $(call ld-option, --hash-style=sysv) \
	    $(call ld-option, --build-id) \
	    --hash-style=sysv --build-id \
	    -T

obj-$(CONFIG_VDSO) += vdso.o
+2 −2
Original line number Diff line number Diff line
@@ -96,8 +96,8 @@ VDSO_LDFLAGS := $(VDSO_CPPFLAGS)
VDSO_LDFLAGS += -Wl,-Bsymbolic -Wl,--no-undefined -Wl,-soname=linux-vdso.so.1
VDSO_LDFLAGS += -Wl,-z,max-page-size=4096 -Wl,-z,common-page-size=4096
VDSO_LDFLAGS += -nostdlib -shared -mfloat-abi=soft
VDSO_LDFLAGS += $(call cc32-ldoption,-Wl$(comma)--hash-style=sysv)
VDSO_LDFLAGS += $(call cc32-ldoption,-Wl$(comma)--build-id)
VDSO_LDFLAGS += -Wl,--hash-style=sysv
VDSO_LDFLAGS += -Wl,--build-id
VDSO_LDFLAGS += $(call cc32-ldoption,-fuse-ld=bfd)


+1 −2
Original line number Diff line number Diff line
@@ -115,8 +115,7 @@ quiet_cmd_vdso = VDSO $@
		       -T $(filter %.lds,$^) $(filter %.o,$^) && \
		sh $(srctree)/$(src)/checkundef.sh '$(OBJDUMP)' '$@'

VDSO_LDFLAGS = -shared $(call ld-option, --hash-style=both) \
	$(call ld-option, --build-id) -Bsymbolic
VDSO_LDFLAGS = -shared --hash-style=both --build-id -Bsymbolic
GCOV_PROFILE := n

#
+2 −3
Original line number Diff line number Diff line
@@ -176,9 +176,8 @@ quiet_cmd_vdso = VDSO $@
		       -T $(filter %.lds,$^) $(filter %.o,$^) && \
		 sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'

VDSO_LDFLAGS = -shared $(call ld-option, --hash-style=both) \
	$(call ld-option, --build-id) $(call ld-option, --eh-frame-hdr) \
	-Bsymbolic
VDSO_LDFLAGS = -shared --hash-style=both --build-id \
	$(call ld-option, --eh-frame-hdr) -Bsymbolic
GCOV_PROFILE := n

quiet_cmd_vdso_and_check = VDSO    $@