Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

um: vdso: Always reject undefined references in during linking

Instead of using a custom script to detect and fail on undefined
references, use --no-undefined for all VDSO linker invocations.

Drop the now unused checkundef.sh script.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Link: https://patch.msgid.link/20241011-vdso-checkundef-v1-2-1a46e0352d20@linutronix.de
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Thomas Weißschuh and committed by
Johannes Berg
90daca7c b9ee5fc8

+2 -14
+2 -3
arch/x86/um/vdso/Makefile
··· 56 56 quiet_cmd_vdso = VDSO $@ 57 57 cmd_vdso = $(CC) -nostdlib -o $@ \ 58 58 $(CC_FLAGS_LTO) $(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \ 59 - -Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) && \ 60 - sh $(src)/checkundef.sh '$(NM)' '$@' 59 + -Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) 61 60 62 - VDSO_LDFLAGS = -fPIC -shared -Wl,--hash-style=sysv -z noexecstack 61 + VDSO_LDFLAGS = -fPIC -shared -Wl,--hash-style=sysv -z noexecstack -Wl,--no-undefined
-11
arch/x86/um/vdso/checkundef.sh
··· 1 - #!/bin/sh 2 - # SPDX-License-Identifier: GPL-2.0 3 - nm="$1" 4 - file="$2" 5 - $nm "$file" | grep '^ *U' > /dev/null 2>&1 6 - if [ $? -eq 1 ]; then 7 - exit 0 8 - else 9 - echo "$file: undefined symbols found" >&2 10 - exit 1 11 - fi