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
This commit is contained in:
parent
a4d86e7ef5
commit
f076331dd4
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user