Module Name:    src
Committed By:   maya
Date:           Mon Jan  1 06:34:13 UTC 2018

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

Log Message:
Build less of the test code if there's no linker ifunc support.

r1.6 changed the code in such a way that it was hitting a BFD assert on
MIPS, causing the builds to fail.

we were hitting the assert at binutils/dist/bfd/elfxx-mips.c:10879


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 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.6 src/tests/libexec/ld.elf_so/t_ifunc.c:1.7
--- src/tests/libexec/ld.elf_so/t_ifunc.c:1.6	Sat Dec 30 16:53:34 2017
+++ src/tests/libexec/ld.elf_so/t_ifunc.c	Mon Jan  1 06:34:13 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ifunc.c,v 1.6 2017/12/30 16:53:34 martin Exp $	*/
+/*	$NetBSD: t_ifunc.c,v 1.7 2018/01/01 06:34:13 maya Exp $	*/
 
 /*
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -35,11 +35,10 @@
 
 #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")
+#if defined( __arm__) || defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__sparc__)
+#define	LINKER_SUPPORT 1
 #else
-#define	LINKER_SUPPORT()	/* yes */
+#define	LINKER_SUPPORT 0
 #endif
 
 ATF_TC(rtld_ifunc);
@@ -63,7 +62,8 @@ ATF_TC_BODY(rtld_ifunc, tc)
 	const char *error;
 	size_t i;
 
-	LINKER_SUPPORT();
+	if (!LINKER_SUPPORT)
+		atf_tc_skip("Missing linker support for ifunc relocations");
 
 	for (i = 0; i < __arraycount(envstr); ++i) {
 		setenv("USE_IFUNC2", envstr[i], 1);
@@ -116,7 +116,8 @@ ATF_TC_BODY(rtld_hidden_ifunc, tc)
 	const char *error;
 	size_t i;
 
-	LINKER_SUPPORT();
+	if (!LINKER_SUPPORT)
+		atf_tc_skip("Missing linker support for ifunc relocations");
 
 	for (i = 0; i < __arraycount(envstr); ++i) {
 		setenv("USE_IFUNC2", envstr[i], 1);
@@ -163,6 +164,7 @@ ATF_TC_HEAD(rtld_main_ifunc, tc)
 	    "ifunc functions are resolved in the executable");
 }
 
+#if LINKER_SUPPORT
 static unsigned int
 ifunc_helper(void)
 {
@@ -175,11 +177,13 @@ unsigned int (*resolve_ifunc(void))(void
 	return ifunc_helper;
 }
 __hidden_ifunc(ifunc, resolve_ifunc);
+#endif
 unsigned int ifunc(void);
 
 ATF_TC_BODY(rtld_main_ifunc, tc)
 {
-	LINKER_SUPPORT();
+	if (!LINKER_SUPPORT)
+		atf_tc_skip("Missing linker support for ifunc relocations");
 	ATF_CHECK(ifunc() == 0xdeadbeef);
 }
 

Reply via email to