summaryrefslogtreecommitdiff
path: root/elf/tst-ptrguard1.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2018-12-27 15:41:39 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-12-27 15:41:39 +0000
commit16c9ca827cd735002dec5689f93f22fc358d6f56 (patch)
treefbfaa8e020a3a762a96c4f219d4150e369e00099 /elf/tst-ptrguard1.c
parentdaa262720d3dc357a298b18a359551994082c9b3 (diff)
parent963c37d5c0eb62b38f8764b23931c0dcdd497a13 (diff)
Merge commit 'refs/top-bases/t/bits_atomic.h_multiple_threads' into t/bits_atomic.h_multiple_threadst/bits_atomic.h_multiple_threads
Diffstat (limited to 'elf/tst-ptrguard1.c')
-rw-r--r--elf/tst-ptrguard1.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/elf/tst-ptrguard1.c b/elf/tst-ptrguard1.c
index c9d80df758..78b78b8523 100644
--- a/elf/tst-ptrguard1.c
+++ b/elf/tst-ptrguard1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,6 +25,12 @@
#include <tls.h>
#include <unistd.h>
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+/* Requires _GNU_SOURCE */
+#include <getopt.h>
+
#ifndef POINTER_CHK_GUARD
extern uintptr_t __pointer_chk_guard;
# define POINTER_CHK_GUARD __pointer_chk_guard
@@ -191,12 +197,21 @@ do_test (void)
#define CMDLINE_OPTIONS \
{ "command", required_argument, NULL, OPT_COMMAND }, \
{ "child", no_argument, NULL, OPT_CHILD },
-#define CMDLINE_PROCESS \
- case OPT_COMMAND: \
- command = optarg; \
- break; \
- case OPT_CHILD: \
- child = true; \
- break;
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+
+static void __attribute((used))
+cmdline_process_function (int c)
+{
+ switch (c)
+ {
+ case OPT_COMMAND:
+ command = optarg;
+ break;
+ case OPT_CHILD:
+ child = true;
+ break;
+ }
+}
+
+#define CMDLINE_PROCESS cmdline_process_function
+
+#include <support/test-driver.c>