From 05d0b0889ca9d033a960542af7f8a13b3ad4f630 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Fri, 18 Jun 2010 14:36:26 -0700 Subject: 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 LKML-Reference: Signed-off-by: H. Peter Anvin --- arch/x86/vdso/checkundef.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 arch/x86/vdso/checkundef.sh (limited to 'arch/x86/vdso/checkundef.sh') diff --git a/arch/x86/vdso/checkundef.sh b/arch/x86/vdso/checkundef.sh new file mode 100755 index 00000000000..490be1c38f9 --- /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 -- cgit v1.2.3-70-g09d2 From 18642a57df02a044b91219d3176128996ddc81a5 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 27 Jul 2010 23:52:29 -0700 Subject: x86, vdso: Don't quote $nm in the script for checking vdso references Don't quote $nm in the script for checking the vdso for external references. Doing so breaks multiword constructs, like using CROSS_COMPILE='ccache '. Reported-by: Stephen Rothwell Signed-off-by: H. Peter Anvin LKML-Reference: <20100728134252.2e4c27cf.sfr@canb.auug.org.au> --- arch/x86/vdso/checkundef.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/x86/vdso/checkundef.sh') diff --git a/arch/x86/vdso/checkundef.sh b/arch/x86/vdso/checkundef.sh index 490be1c38f9..7ee90a9b549 100755 --- a/arch/x86/vdso/checkundef.sh +++ b/arch/x86/vdso/checkundef.sh @@ -1,7 +1,7 @@ #!/bin/sh nm="$1" file="$2" -"$nm" "$file" | grep '^ *U' > /dev/null 2>&1 +$nm "$file" | grep '^ *U' > /dev/null 2>&1 if [ $? -eq 1 ]; then exit 0 else -- cgit v1.2.3-70-g09d2