Move vDSO tests from Documentation/vDSO to selftests/vDSO.
Signed-off-by: Shuah Khan
---
Documentation/vDSO/.gitignore | 2 -
Documentation/vDSO/Makefile| 17 --
Documentation/vDSO/parse_vdso.c| 269 -
Documentation/vDSO/vdso_standalone_test_x86.c | 128 --
Documentation/vDSO/vdso_test.c | 52
tools/testing/selftests/vDSO/.gitignore| 2 +
tools/testing/selftests/vDSO/Makefile | 17 ++
tools/testing/selftests/vDSO/parse_vdso.c | 269 +
.../selftests/vDSO/vdso_standalone_test_x86.c | 128 ++
tools/testing/selftests/vDSO/vdso_test.c | 52
10 files changed, 468 insertions(+), 468 deletions(-)
delete mode 100644 Documentation/vDSO/.gitignore
delete mode 100644 Documentation/vDSO/Makefile
delete mode 100644 Documentation/vDSO/parse_vdso.c
delete mode 100644 Documentation/vDSO/vdso_standalone_test_x86.c
delete mode 100644 Documentation/vDSO/vdso_test.c
create mode 100644 tools/testing/selftests/vDSO/.gitignore
create mode 100644 tools/testing/selftests/vDSO/Makefile
create mode 100644 tools/testing/selftests/vDSO/parse_vdso.c
create mode 100644 tools/testing/selftests/vDSO/vdso_standalone_test_x86.c
create mode 100644 tools/testing/selftests/vDSO/vdso_test.c
diff --git a/Documentation/vDSO/.gitignore b/Documentation/vDSO/.gitignore
deleted file mode 100644
index 133bf9e..000
--- a/Documentation/vDSO/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-vdso_test
-vdso_standalone_test_x86
diff --git a/Documentation/vDSO/Makefile b/Documentation/vDSO/Makefile
deleted file mode 100644
index b12e987..000
--- a/Documentation/vDSO/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-ifndef CROSS_COMPILE
-# vdso_test won't build for glibc < 2.16, so disable it
-# hostprogs-y := vdso_test
-hostprogs-$(CONFIG_X86) := vdso_standalone_test_x86
-vdso_standalone_test_x86-objs := vdso_standalone_test_x86.o parse_vdso.o
-vdso_test-objs := parse_vdso.o vdso_test.o
-
-# Tell kbuild to always build the programs
-always := $(hostprogs-y)
-
-HOSTCFLAGS := -I$(objtree)/usr/include -std=gnu99
-HOSTCFLAGS_vdso_standalone_test_x86.o := -fno-asynchronous-unwind-tables
-fno-stack-protector
-HOSTLOADLIBES_vdso_standalone_test_x86 := -nostdlib
-ifeq ($(CONFIG_X86_32),y)
-HOSTLOADLIBES_vdso_standalone_test_x86 += -lgcc_s
-endif
-endif
diff --git a/Documentation/vDSO/parse_vdso.c b/Documentation/vDSO/parse_vdso.c
deleted file mode 100644
index 1dbb4b8..000
--- a/Documentation/vDSO/parse_vdso.c
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- * parse_vdso.c: Linux reference vDSO parser
- * Written by Andrew Lutomirski, 2011-2014.
- *
- * This code is meant to be linked in to various programs that run on Linux.
- * As such, it is available with as few restrictions as possible. This file
- * is licensed under the Creative Commons Zero License, version 1.0,
- * available at http://creativecommons.org/publicdomain/zero/1.0/legalcode
- *
- * The vDSO is a regular ELF DSO that the kernel maps into user space when
- * it starts a program. It works equally well in statically and dynamically
- * linked binaries.
- *
- * This code is tested on x86. In principle it should work on any
- * architecture that has a vDSO.
- */
-
-#include
-#include
-#include
-#include
-#include
-
-/*
- * To use this vDSO parser, first call one of the vdso_init_* functions.
- * If you've already parsed auxv, then pass the value of AT_SYSINFO_EHDR
- * to vdso_init_from_sysinfo_ehdr. Otherwise pass auxv to vdso_init_from_auxv.
- * Then call vdso_sym for each symbol you want. For example, to look up
- * gettimeofday on x86_64, use:
- *
- * = vdso_sym("LINUX_2.6", "gettimeofday");
- * or
- * = vdso_sym("LINUX_2.6", "__vdso_gettimeofday");
- *
- * vdso_sym will return 0 if the symbol doesn't exist or if the init function
- * failed or was not called. vdso_sym is a little slow, so its return value
- * should be cached.
- *
- * vdso_sym is threadsafe; the init functions are not.
- *
- * These are the prototypes:
- */
-extern void vdso_init_from_auxv(void *auxv);
-extern void vdso_init_from_sysinfo_ehdr(uintptr_t base);
-extern void *vdso_sym(const char *version, const char *name);
-
-
-/* And here's the code. */
-#ifndef ELF_BITS
-# if ULONG_MAX > 0xUL
-# define ELF_BITS 64
-# else
-# define ELF_BITS 32
-# endif
-#endif
-
-#define ELF_BITS_XFORM2(bits, x) Elf##bits##_##x
-#define ELF_BITS_XFORM(bits, x) ELF_BITS_XFORM2(bits, x)
-#define ELF(x) ELF_BITS_XFORM(ELF_BITS, x)
-
-static struct vdso_info
-{
- bool valid;
-
- /* Load information */
- uintptr_t load_addr;
- uintptr_t load_offset; /* load_addr - recorded vaddr */
-
- /* Symbol table */
- ELF(Sym) *symtab;
- const char *symstrings;
- ELF(Word) *bucket, *chain;
- ELF(Word) nbucket, nchain;
-
- /* Version table */
- ELF(Versym) *ver