diff options
author | Matthew Dempsky <matthew@cvs.openbsd.org> | 2012-08-16 17:21:06 +0000 |
---|---|---|
committer | Matthew Dempsky <matthew@cvs.openbsd.org> | 2012-08-16 17:21:06 +0000 |
commit | 85affd9d803c374f5557e9321785447d1b89ec88 (patch) | |
tree | 8ead942d814df67a1eb45b51dd6942cf526bb3df /regress/libexec | |
parent | 84b09f519ccf91f8cd8e449da019a890de8b8fa0 (diff) |
basic randomdata regression tests
Diffstat (limited to 'regress/libexec')
-rw-r--r-- | regress/libexec/ld.so/randomdata/Makefile | 5 | ||||
-rw-r--r-- | regress/libexec/ld.so/randomdata/Makefile.inc | 8 | ||||
-rw-r--r-- | regress/libexec/ld.so/randomdata/libaa/Makefile | 6 | ||||
-rw-r--r-- | regress/libexec/ld.so/randomdata/libaa/aa.c | 9 | ||||
-rw-r--r-- | regress/libexec/ld.so/randomdata/libaa/shlib_version | 2 | ||||
-rw-r--r-- | regress/libexec/ld.so/randomdata/prog-dynamic/Makefile | 8 | ||||
-rw-r--r-- | regress/libexec/ld.so/randomdata/prog-static/Makefile | 9 | ||||
-rw-r--r-- | regress/libexec/ld.so/randomdata/prog/prog.c | 17 |
8 files changed, 64 insertions, 0 deletions
diff --git a/regress/libexec/ld.so/randomdata/Makefile b/regress/libexec/ld.so/randomdata/Makefile new file mode 100644 index 00000000000..d8600b4214f --- /dev/null +++ b/regress/libexec/ld.so/randomdata/Makefile @@ -0,0 +1,5 @@ +# $OpenBSD: Makefile,v 1.1 2012/08/16 17:21:05 matthew Exp $ + +SUBDIR+= libaa prog-dynamic prog-static + +.include <bsd.subdir.mk> diff --git a/regress/libexec/ld.so/randomdata/Makefile.inc b/regress/libexec/ld.so/randomdata/Makefile.inc new file mode 100644 index 00000000000..602187aad3d --- /dev/null +++ b/regress/libexec/ld.so/randomdata/Makefile.inc @@ -0,0 +1,8 @@ +.include <bsd.obj.mk> + +LIBAADIR!= if test -d ${.CURDIR}/../libaa/${__objdir} ; then \ + echo "${.CURDIR}/../libaa/${__objdir}" ; \ + else \ + echo "${.CURDIR}/../libaa" ; \ + fi +LIBAA= $(LIBAADIR)/libaa.a diff --git a/regress/libexec/ld.so/randomdata/libaa/Makefile b/regress/libexec/ld.so/randomdata/libaa/Makefile new file mode 100644 index 00000000000..493fa75e637 --- /dev/null +++ b/regress/libexec/ld.so/randomdata/libaa/Makefile @@ -0,0 +1,6 @@ +# $OpenBSD: Makefile,v 1.1.1.1 2012/08/16 17:21:05 matthew Exp $ + +LIB= aa +SRCS+= aa.c + +.include <bsd.lib.mk> diff --git a/regress/libexec/ld.so/randomdata/libaa/aa.c b/regress/libexec/ld.so/randomdata/libaa/aa.c new file mode 100644 index 00000000000..bc0047f4634 --- /dev/null +++ b/regress/libexec/ld.so/randomdata/libaa/aa.c @@ -0,0 +1,9 @@ +#include <sys/types.h> + +static int64_t aavalue __attribute__((section(".openbsd.randomdata"))); + +int64_t +getaavalue() +{ + return (aavalue); +} diff --git a/regress/libexec/ld.so/randomdata/libaa/shlib_version b/regress/libexec/ld.so/randomdata/libaa/shlib_version new file mode 100644 index 00000000000..97c9f92d6b8 --- /dev/null +++ b/regress/libexec/ld.so/randomdata/libaa/shlib_version @@ -0,0 +1,2 @@ +major=0 +minor=0 diff --git a/regress/libexec/ld.so/randomdata/prog-dynamic/Makefile b/regress/libexec/ld.so/randomdata/prog-dynamic/Makefile new file mode 100644 index 00000000000..f4d335023ff --- /dev/null +++ b/regress/libexec/ld.so/randomdata/prog-dynamic/Makefile @@ -0,0 +1,8 @@ +# $OpenBSD: Makefile,v 1.1.1.1 2012/08/16 17:21:05 matthew Exp $ + +PROG= prog +LDADD+= -Wl,-rpath,$(LIBAADIR) -L$(LIBAADIR) -laa +DPADD+= $(LIBAA) +.PATH: $(.CURDIR)/../prog + +.include <bsd.regress.mk> diff --git a/regress/libexec/ld.so/randomdata/prog-static/Makefile b/regress/libexec/ld.so/randomdata/prog-static/Makefile new file mode 100644 index 00000000000..0f44280a5ad --- /dev/null +++ b/regress/libexec/ld.so/randomdata/prog-static/Makefile @@ -0,0 +1,9 @@ +# $OpenBSD: Makefile,v 1.1 2012/08/16 17:21:05 matthew Exp $ + +PROG= prog +LDADD+= -L$(LIBAADIR) -laa +DPADD+= $(LIBAA) +LDFLAGS+= -static +.PATH: $(.CURDIR)/../prog + +.include <bsd.regress.mk> diff --git a/regress/libexec/ld.so/randomdata/prog/prog.c b/regress/libexec/ld.so/randomdata/prog/prog.c new file mode 100644 index 00000000000..c5f27a9c817 --- /dev/null +++ b/regress/libexec/ld.so/randomdata/prog/prog.c @@ -0,0 +1,17 @@ +#include <sys/types.h> +#include <assert.h> + +extern int64_t getaavalue(void); + +static int64_t progvalue __attribute__((section(".openbsd.randomdata"))); + +int +main() +{ + int64_t aavalue = getaavalue(); + + assert(progvalue != 0); + assert(aavalue != 0); + assert(progvalue != aavalue); + return (0); +} |