summaryrefslogtreecommitdiff
path: root/elf/tst-ptrguard1.c
diff options
context:
space:
mode:
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>