]> git.baikalelectronics.ru Git - kernel.git/commitdiff
kbuild: explicitly specify the build id style
authorBill Wendling <morbo@google.com>
Tue, 22 Sep 2020 23:21:40 +0000 (16:21 -0700)
committerMasahiro Yamada <masahiroy@kernel.org>
Fri, 9 Oct 2020 14:57:30 +0000 (23:57 +0900)
ld's --build-id defaults to "sha1" style, while lld defaults to "fast".
The build IDs are very different between the two, which may confuse
programs that reference them.

Signed-off-by: Bill Wendling <morbo@google.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Makefile
arch/arm/vdso/Makefile
arch/arm64/kernel/vdso/Makefile
arch/arm64/kernel/vdso32/Makefile
arch/mips/vdso/Makefile
arch/riscv/kernel/vdso/Makefile
arch/s390/kernel/vdso64/Makefile
arch/sparc/vdso/Makefile
arch/x86/entry/vdso/Makefile
tools/testing/selftests/bpf/Makefile

index e39ed7967cd6655e31f711cdbba3c176056f6749..088fb7d49dd797b09f51ec37e2aacb8b50abab56 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -982,8 +982,8 @@ KBUILD_CPPFLAGS += $(KCPPFLAGS)
 KBUILD_AFLAGS   += $(KAFLAGS)
 KBUILD_CFLAGS   += $(KCFLAGS)
 
-KBUILD_LDFLAGS_MODULE += --build-id
-LDFLAGS_vmlinux += --build-id
+KBUILD_LDFLAGS_MODULE += --build-id=sha1
+LDFLAGS_vmlinux += --build-id=sha1
 
 ifeq ($(CONFIG_STRIP_ASM_SYMS),y)
 LDFLAGS_vmlinux        += $(call ld-option, -X,)
index a54f70731d9f11bf11175d2afa168a757a0fe131..150ce6e6a5d31aa745e8a214857bb595256af560 100644 (file)
@@ -19,7 +19,7 @@ ccflags-y += -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO32
 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) \
-           --hash-style=sysv --build-id \
+           --hash-style=sysv --build-id=sha1 \
            -T
 
 obj-$(CONFIG_VDSO) += vdso.o
index 7cd8aafbe96ebf0ed0e082f7e310c22220c71bea..3dc4b65da99dc00636dbf71fa8941b3119888110 100644 (file)
@@ -24,7 +24,7 @@ btildflags-$(CONFIG_ARM64_BTI_KERNEL) += -z force-bti
 # routines, as x86 does (see 6f121e548f83 ("x86, vdso: Reimplement vdso.so
 # preparation in build-time C")).
 ldflags-y := -shared -nostdlib -soname=linux-vdso.so.1 --hash-style=sysv       \
-            -Bsymbolic $(call ld-option, --no-eh-frame-hdr) --build-id -n      \
+            -Bsymbolic $(call ld-option, --no-eh-frame-hdr) --build-id=sha1 -n \
             $(btildflags-y) -T
 
 ccflags-y := -fno-common -fno-builtin -fno-stack-protector -ffixed-x18
index 1259e5bd0fabb2b8ee235ff2d17d2def025be9a2..7f96a1a9f68c49a89dca13b8e8329113032c6c13 100644 (file)
@@ -128,7 +128,7 @@ 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 += -Wl,--hash-style=sysv
-VDSO_LDFLAGS += -Wl,--build-id
+VDSO_LDFLAGS += -Wl,--build-id=sha1
 VDSO_LDFLAGS += $(call cc32-ldoption,-fuse-ld=bfd)
 
 
index 57fe8323528193ba4326271ac00fa114403b3277..5810cc12bc1d926da0fe63972eb95208084e181b 100644 (file)
@@ -61,7 +61,7 @@ endif
 # VDSO linker flags.
 ldflags-y := -Bsymbolic --no-undefined -soname=linux-vdso.so.1 \
        $(filter -E%,$(KBUILD_CFLAGS)) -nostdlib -shared \
-       -G 0 --eh-frame-hdr --hash-style=sysv --build-id -T
+       -G 0 --eh-frame-hdr --hash-style=sysv --build-id=sha1 -T
 
 CFLAGS_REMOVE_vdso.o = -pg
 
index 478e7338ddc10efe033219acbb7fd847ea383435..7d6a94d45ec94190234f74994fffbf3491741732 100644 (file)
@@ -49,7 +49,7 @@ $(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso) FORCE
 # refer to these symbols in the kernel code rather than hand-coded addresses.
 
 SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \
-       -Wl,--build-id -Wl,--hash-style=both
+       -Wl,--build-id=sha1 -Wl,--hash-style=both
 $(obj)/vdso-dummy.o: $(src)/vdso.lds $(obj)/rt_sigreturn.o FORCE
        $(call if_changed,vdsold)
 
index d0d406cfffa905c678deb02dd227426b64a0b744..9acad762456d44ab36c7da0b0a63dd90ca90ad1f 100644 (file)
@@ -19,7 +19,7 @@ KBUILD_AFLAGS_64 += -m64 -s
 KBUILD_CFLAGS_64 := $(filter-out -m64,$(KBUILD_CFLAGS))
 KBUILD_CFLAGS_64 += -m64 -fPIC -shared -fno-common -fno-builtin
 ldflags-y := -fPIC -shared -nostdlib -soname=linux-vdso64.so.1 \
-            --hash-style=both --build-id -T
+            --hash-style=both --build-id=sha1 -T
 
 $(targets:%=$(obj)/%.dbg): KBUILD_CFLAGS = $(KBUILD_CFLAGS_64)
 $(targets:%=$(obj)/%.dbg): KBUILD_AFLAGS = $(KBUILD_AFLAGS_64)
index f44355e46f31f4bbbfc888b012d3f053a0ed45a9..469dd23887abbed928f88b64ca36fcf2549756ae 100644 (file)
@@ -115,7 +115,7 @@ quiet_cmd_vdso = VDSO    $@
                       -T $(filter %.lds,$^) $(filter %.o,$^) && \
                sh $(srctree)/$(src)/checkundef.sh '$(OBJDUMP)' '$@'
 
-VDSO_LDFLAGS = -shared --hash-style=both --build-id -Bsymbolic
+VDSO_LDFLAGS = -shared --hash-style=both --build-id=sha1 -Bsymbolic
 GCOV_PROFILE := n
 
 #
index 215376d975a29637ad9906c6889f154a867f1139..ebba25ed9a38602d7f57cfdc9060273f15a2b432 100644 (file)
@@ -176,7 +176,7 @@ quiet_cmd_vdso = VDSO    $@
                       -T $(filter %.lds,$^) $(filter %.o,$^) && \
                 sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
 
-VDSO_LDFLAGS = -shared --hash-style=both --build-id \
+VDSO_LDFLAGS = -shared --hash-style=both --build-id=sha1 \
        $(call ld-option, --eh-frame-hdr) -Bsymbolic
 GCOV_PROFILE := n
 
index fc946b7ac288df9064b551071fe2d7df22e06fe9..daf186f88a63612987d238acce70c8777b24225b 100644 (file)
@@ -133,7 +133,7 @@ $(OUTPUT)/%:%.c
 
 $(OUTPUT)/urandom_read: urandom_read.c
        $(call msg,BINARY,,$@)
-       $(Q)$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS) -Wl,--build-id
+       $(Q)$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS) -Wl,--build-id=sha1
 
 $(OUTPUT)/test_stub.o: test_stub.c $(BPFOBJ)
        $(call msg,CC,,$@)