Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/libexec/ld.elf_so Build less of the test code if there...



details:   https://anonhg.NetBSD.org/src/rev/e26232ee66e6
branches:  trunk
changeset: 828777:e26232ee66e6
user:      maya <maya%NetBSD.org@localhost>
date:      Mon Jan 01 06:34:13 2018 +0000

description:
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

diffstat:

 tests/libexec/ld.elf_so/t_ifunc.c |  20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diffs (67 lines):

diff -r f5a13ce46635 -r e26232ee66e6 tests/libexec/ld.elf_so/t_ifunc.c
--- a/tests/libexec/ld.elf_so/t_ifunc.c Mon Jan 01 01:26:06 2018 +0000
+++ b/tests/libexec/ld.elf_so/t_ifunc.c Mon Jan 01 06:34:13 2018 +0000
@@ -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 @@
        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 @@
        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 @@
            "ifunc functions are resolved in the executable");
 }
 
+#if LINKER_SUPPORT
 static unsigned int
 ifunc_helper(void)
 {
@@ -175,11 +177,13 @@
        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);
 }
 



Home | Main Index | Thread Index | Old Index