summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2017-08-01 13:05:56 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2017-08-01 13:05:56 +0000
commit6684fb01ec8e789d4a50c7efd4eb9d3a52c02a74 (patch)
treec9004203d3d7a0de7d69519ad2fb75d5229d00bf
parent4cc041cc02bb053e1a4553936f37ff6ec823252c (diff)
A fix is coming in the future, but in the meantime we should never declare
a section(".openbsd.randomdata") variable as static or const, because the compiler optimizes out access.
-rw-r--r--regress/libexec/ld.so/randomdata/libaa/aa.c4
-rw-r--r--regress/libexec/ld.so/randomdata/prog/prog.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/regress/libexec/ld.so/randomdata/libaa/aa.c b/regress/libexec/ld.so/randomdata/libaa/aa.c
index c0bd2bc64bc..e03ba31b121 100644
--- a/regress/libexec/ld.so/randomdata/libaa/aa.c
+++ b/regress/libexec/ld.so/randomdata/libaa/aa.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: aa.c,v 1.2 2015/01/20 04:41:01 krw Exp $ */
+/* $OpenBSD: aa.c,v 1.3 2017/08/01 13:05:55 deraadt Exp $ */
#include <sys/types.h>
-static int64_t aavalue __attribute__((section(".openbsd.randomdata")));
+int64_t aavalue __attribute__((section(".openbsd.randomdata")));
int64_t
getaavalue()
diff --git a/regress/libexec/ld.so/randomdata/prog/prog.c b/regress/libexec/ld.so/randomdata/prog/prog.c
index 34b8f3ed382..c7ef24ce610 100644
--- a/regress/libexec/ld.so/randomdata/prog/prog.c
+++ b/regress/libexec/ld.so/randomdata/prog/prog.c
@@ -1,10 +1,10 @@
-/* $OpenBSD: prog.c,v 1.2 2015/01/20 04:41:01 krw Exp $ */
+/* $OpenBSD: prog.c,v 1.3 2017/08/01 13:05:55 deraadt Exp $ */
#include <sys/types.h>
#include <assert.h>
extern int64_t getaavalue(void);
-static int64_t progvalue __attribute__((section(".openbsd.randomdata")));
+int64_t progvalue __attribute__((section(".openbsd.randomdata")));
int
main()