Module Name:    src
Committed By:   martin
Date:           Sat Dec 30 16:53:34 UTC 2017

Modified Files:
        src/tests/libexec/ld.elf_so: t_ifunc.c

Log Message:
Skip all tests on architectures w/o ifunc linker/ld.elf_so support.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/libexec/ld.elf_so/t_ifunc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/libexec/ld.elf_so/t_ifunc.c
diff -u src/tests/libexec/ld.elf_so/t_ifunc.c:1.5 src/tests/libexec/ld.elf_so/t_ifunc.c:1.6
--- src/tests/libexec/ld.elf_so/t_ifunc.c:1.5	Mon Nov  6 21:16:03 2017
+++ src/tests/libexec/ld.elf_so/t_ifunc.c	Sat Dec 30 16:53:34 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ifunc.c,v 1.5 2017/11/06 21:16:03 joerg Exp $	*/
+/*	$NetBSD: t_ifunc.c,v 1.6 2017/12/30 16:53:34 martin Exp $	*/
 
 /*
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -35,6 +35,13 @@
 
 #include "h_macros.h"
 
+#if !defined( __arm__) && !defined(__i386__) && !defined(__x86_64__) && !defined(__powerpc__) && !defined(__sparc__)
+#define	LINKER_SUPPORT()	\
+	atf_tc_skip("Missing linker support for ifunc relocations")
+#else
+#define	LINKER_SUPPORT()	/* yes */
+#endif
+
 ATF_TC(rtld_ifunc);
 
 ATF_TC_HEAD(rtld_ifunc, tc)
@@ -56,9 +63,7 @@ ATF_TC_BODY(rtld_ifunc, tc)
 	const char *error;
 	size_t i;
 
-#if !defined( __arm__) && !defined(__i386__) && !defined(__x86_64__) && !defined(__powerpc__) && !defined(__sparc__)
-	atf_tc_expect_fail("Missing linker support for hidden ifunc relocations");
-#endif
+	LINKER_SUPPORT();
 
 	for (i = 0; i < __arraycount(envstr); ++i) {
 		setenv("USE_IFUNC2", envstr[i], 1);
@@ -111,6 +116,8 @@ ATF_TC_BODY(rtld_hidden_ifunc, tc)
 	const char *error;
 	size_t i;
 
+	LINKER_SUPPORT();
+
 	for (i = 0; i < __arraycount(envstr); ++i) {
 		setenv("USE_IFUNC2", envstr[i], 1);
 
@@ -172,6 +179,7 @@ unsigned int ifunc(void);
 
 ATF_TC_BODY(rtld_main_ifunc, tc)
 {
+	LINKER_SUPPORT();
 	ATF_CHECK(ifunc() == 0xdeadbeef);
 }
 

Reply via email to