From: "tip-bot for H. Peter Anvin" <hpa@linux.intel.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
andi@firstfloor.org, tglx@linutronix.de, hpa@linux.intel.com
Subject: [tip:x86/build] x86, vdso: Error out if the vdso contains external references
Date: Fri, 18 Jun 2010 22:16:05 GMT [thread overview]
Message-ID: <tip-05d0b0889ca9d033a960542af7f8a13b3ad4f630@git.kernel.org> (raw)
In-Reply-To: <tip-*@vger.kernel.org>
Commit-ID: 05d0b0889ca9d033a960542af7f8a13b3ad4f630
Gitweb: http://git.kernel.org/tip/05d0b0889ca9d033a960542af7f8a13b3ad4f630
Author: H. Peter Anvin <hpa@linux.intel.com>
AuthorDate: Fri, 18 Jun 2010 14:36:26 -0700
Committer: H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Fri, 18 Jun 2010 14:46:21 -0700
x86, vdso: Error out if the vdso contains external references
The vdso is a piece of userspace code which is supposed to be fully
self-contained. Any external (undefined) reference is an error, and
should be caught at compile time. This was giving us trouble when
compiling with -Os on gcc 4.5.0, for example (failed inline).
The need to do a buildtime check was pointed out by Andi Kleen.
Reported-by: Andi Kleen <andi@firstfloor.org>
LKML-Reference: <tip-*@vger.kernel.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
arch/x86/vdso/Makefile | 3 ++-
arch/x86/vdso/checkundef.sh | 10 ++++++++++
2 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile
index 6b4ffed..4a2afa1 100644
--- a/arch/x86/vdso/Makefile
+++ b/arch/x86/vdso/Makefile
@@ -120,7 +120,8 @@ $(obj)/vdso32-syms.lds: $(vdso32.so-y:%=$(obj)/vdso32-%-syms.lds) FORCE
quiet_cmd_vdso = VDSO $@
cmd_vdso = $(CC) -nostdlib -o $@ \
$(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \
- -Wl,-T,$(filter %.lds,$^) $(filter %.o,$^)
+ -Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) && \
+ sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
GCOV_PROFILE := n
diff --git a/arch/x86/vdso/checkundef.sh b/arch/x86/vdso/checkundef.sh
new file mode 100755
index 0000000..490be1c
--- /dev/null
+++ b/arch/x86/vdso/checkundef.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+nm="$1"
+file="$2"
+"$nm" "$file" | grep '^ *U' > /dev/null 2>&1
+if [ $? -eq 1 ]; then
+ exit 0
+else
+ echo "$file: undefined symbols found" >&2
+ exit 1
+fi
next parent reply other threads:[~2010-06-18 22:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <tip-*@vger.kernel.org>
2010-06-18 22:16 ` tip-bot for H. Peter Anvin [this message]
2010-06-19 7:27 ` Andi Kleen
2010-06-19 15:44 ` H. Peter Anvin
2010-07-28 3:42 ` Stephen Rothwell
2010-07-28 5:25 ` H. Peter Anvin
2010-07-28 7:19 ` [tip:x86/build] x86, vdso: Don't quote $nm in the script for checking vdso references tip-bot for H. Peter Anvin
2010-07-08 7:18 ` [tip:x86/cpu] x86, cpu: Support the features flags in new CPUID leaf 7 tip-bot for H. Peter Anvin
2010-07-28 7:18 ` [tip:x86/asm] x86, asm: Clean up and simplify set_64bit() tip-bot for H. Peter Anvin
2010-08-03 14:09 ` [tip:x86/asm] um, x86: Cast to (u64 *) inside set_64bit() tip-bot for H. Peter Anvin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-05d0b0889ca9d033a960542af7f8a13b3ad4f630@git.kernel.org \
--to=hpa@linux.intel.com \
--cc=andi@firstfloor.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome