2000-10-19  H.J. Lu  <hjl@gnu.org>

	* elf/Makefile (distribute): Add neededtest.c, neededobj1.c,
	neededobj2.c and neededobj3.c.
	(tests): Add neededtest.
	(modules-names): Add neededobj1, neededobj2 and neededobj3.
	($(objpfx)neededobj1.so): New target.
	($(objpfx)neededobj2.so): Likewise.
	($(objpfx)neededobj3.so): Likewise.
	($(objpfx)neededtest): Likewise.
	($(objpfx)neededtest.out): Likewise.
	* elf/neededtest.c: New. Based on the bug report from
	Allen Bauer <kylix_rd@hotmail.com>.
	* elf/neededobj1.c: Likewise.
	* elf/neededobj2.c: Likewise.
	* elf/neededobj3.c: Likewise.

2000-10-20  Ulrich Drepper  <drepper@redhat.com>

	* elf/dl-close.c (_dl_close): Decrement reference counter for all
	dependencies even if the DSO does not get unloaded.

	* elf/dl-load.c (_dl_map_object_from_fd): Pass pointer to ELF header
	to elf_machine_matches_host.
	* sysdeps/alpha/dl-machine.h (elf_machine_matches_host): Parameter
	is now pointer to ELF header.
	* sysdeps/arm/dl-machine.h: Likewise.
	* sysdeps/generic/dl-machine.h: Likewise.
	* sysdeps/hppa/dl-machine.h: Likewise.
	* sysdeps/i386/dl-machine.h: Likewise.
	* sysdeps/ia64/dl-machine.h: Likewise.
	* sysdeps/m68k/dl-machine.h: Likewise.
	* sysdeps/mips/dl-machine.h: Likewise.
	* sysdeps/mips/mips64/dl-machine.h: Likewise.
	* sysdeps/powerpc/dl-machine.h: Likewise.
	* sysdeps/s390/dl-machine.h: Likewise.
	* sysdeps/sh/dl-machine.h: Likewise.
	* sysdeps/sparc/sparc32/dl-machine.h: Likewise.
	* sysdeps/sparc/sparc64/dl-machine.h: Likewise.
	Patch by Martin Schwidefsksy <schwidefsky@de.ibm.com>.

2000-10-20  Jakub Jelinek  <jakub@redhat.com>

	* include/limits.h: Include bits/wordsize.h, use #if __WORDSIZE == 64
	check instead of #ifdef __alpha__.
	* include/bits/xopen_lim.h (WORD_BIT, LONG_BIT): Don't count on
	INT_MAX, __INT_MAX__, LONG_MAX or __LONG_MAX__ being defined when
	this is included.

	* posix/wordexp-tst.sh (testout): Place output file in build
	directory.  Patch by Joseph S. Myers <jsm28@cam.ac.uk>.
This commit is contained in:
Ulrich Drepper 2000-10-21 00:02:39 +00:00
parent 2a0dcb7c16
commit ceb579a3f8
26 changed files with 299 additions and 103 deletions

View File

@ -1,5 +1,57 @@
2000-10-19 H.J. Lu <hjl@gnu.org>
* elf/Makefile (distribute): Add neededtest.c, neededobj1.c,
neededobj2.c and neededobj3.c.
(tests): Add neededtest.
(modules-names): Add neededobj1, neededobj2 and neededobj3.
($(objpfx)neededobj1.so): New target.
($(objpfx)neededobj2.so): Likewise.
($(objpfx)neededobj3.so): Likewise.
($(objpfx)neededtest): Likewise.
($(objpfx)neededtest.out): Likewise.
* elf/neededtest.c: New. Based on the bug report from
Allen Bauer <kylix_rd@hotmail.com>.
* elf/neededobj1.c: Likewise.
* elf/neededobj2.c: Likewise.
* elf/neededobj3.c: Likewise.
2000-10-20 Ulrich Drepper <drepper@redhat.com>
* elf/dl-close.c (_dl_close): Decrement reference counter for all
dependencies even if the DSO does not get unloaded.
* elf/dl-load.c (_dl_map_object_from_fd): Pass pointer to ELF header
to elf_machine_matches_host.
* sysdeps/alpha/dl-machine.h (elf_machine_matches_host): Parameter
is now pointer to ELF header.
* sysdeps/arm/dl-machine.h: Likewise.
* sysdeps/generic/dl-machine.h: Likewise.
* sysdeps/hppa/dl-machine.h: Likewise.
* sysdeps/i386/dl-machine.h: Likewise.
* sysdeps/ia64/dl-machine.h: Likewise.
* sysdeps/m68k/dl-machine.h: Likewise.
* sysdeps/mips/dl-machine.h: Likewise.
* sysdeps/mips/mips64/dl-machine.h: Likewise.
* sysdeps/powerpc/dl-machine.h: Likewise.
* sysdeps/s390/dl-machine.h: Likewise.
* sysdeps/sh/dl-machine.h: Likewise.
* sysdeps/sparc/sparc32/dl-machine.h: Likewise.
* sysdeps/sparc/sparc64/dl-machine.h: Likewise.
Patch by Martin Schwidefsksy <schwidefsky@de.ibm.com>.
2000-10-20 Jakub Jelinek <jakub@redhat.com>
* include/limits.h: Include bits/wordsize.h, use #if __WORDSIZE == 64
check instead of #ifdef __alpha__.
* include/bits/xopen_lim.h (WORD_BIT, LONG_BIT): Don't count on
INT_MAX, __INT_MAX__, LONG_MAX or __LONG_MAX__ being defined when
this is included.
2000-10-20 Ulrich Drepper <drepper@redhat.com>
* posix/wordexp-tst.sh (testout): Place output file in build
directory. Patch by Joseph S. Myers <jsm28@cam.ac.uk>.
* sysdeps/powerpc/fpu/bits/mathinline.h: Pretty print.
2000-10-19 Ulrich Drepper <drepper@redhat.com>

View File

@ -53,7 +53,8 @@ distribute := $(rtld-routines:=.c) dynamic-link.h do-rel.h dl-machine.h \
nodlopenmod.c nodelete.c nodelmod1.c nodelmod2.c \
nodelmod3.c nodelmod4.c nodlopen.c dl-osinfo.h \
reldepmod1.c reldepmod2.c reldepmod3.c reldepmod4.c \
nextmod1.c nextmod2.c
nextmod1.c nextmod2.c \
neededtest.c neededobj1.c neededobj2.c neededobj3.c
include ../Makeconfig
@ -95,7 +96,7 @@ ifeq (yes,$(build-shared))
tests = loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
constload1 order $(tests-vis-$(have-protected)) noload filter unload \
reldep reldep2 reldep3 next $(tests-nodelete-$(have-z-nodelete)) \
$(tests-nodlopen-$(have-z-nodlopen))
$(tests-nodlopen-$(have-z-nodlopen)) neededtest
tests-vis-yes = vismain
tests-nodelete-yes = nodelete
tests-nodlopen-yes = nodlopen
@ -105,7 +106,8 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
dep1 dep2 dep3 dep4 $(modules-vis-$(have-protected)) \
$(modules-nodelete-$(have-z-nodelete)) \
$(modules-nodlopen-$(have-z-nodlopen)) filtmod1 filtmod2 \
reldepmod1 reldepmod2 reldepmod3 reldepmod4 nextmod1 nextmod2
reldepmod1 reldepmod2 reldepmod3 reldepmod4 nextmod1 nextmod2 \
neededobj1 neededobj2 neededobj3
modules-vis-yes = vismod1 vismod2 vismod3
modules-nodelete-yes = nodelmod1 nodelmod2 nodelmod3 nodelmod4
modules-nodlopen-yes = nodlopenmod
@ -249,6 +251,10 @@ $(objpfx)dep4.so: $(objpfx)dep3.so
$(objpfx)nodelmod3.so: $(objpfx)nodelmod4.so
$(objpfx)nextmod1.so: $(libdl)
$(objpfx)neededobj1.so: $(libdl)
$(objpfx)neededobj2.so: $(objpfx)neededobj1.so $(libdl)
$(objpfx)neededobj3.so: $(objpfx)neededobj1.so $(objpfx)neededobj2.so $(libdl)
# filtmod1.so has a special rule
$(filter-out $(objpfx)filtmod1.so, $(test-modules)): $(objpfx)%.so: $(objpfx)%.os
$(build-module)
@ -258,6 +264,11 @@ LDFLAGS-loadtest = -rdynamic
$(objpfx)loadtest.out: $(test-modules)
$(objpfx)neededtest: $(libdl)
$(objpfx)neededtest.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \
$(objpfx)neededobj3.so
$(objpfx)restest1: $(objpfx)testobj1.so $(objpfx)testobj1_1.so $(libdl)
LDFLAGS-restest1 = -rdynamic

View File

@ -61,6 +61,9 @@ _dl_close (void *_map)
/* Acquire the lock. */
__libc_lock_lock (_dl_load_lock);
list = map->l_searchlist.r_list;
nsearchlist = map->l_searchlist.r_nlist;
/* Decrement the reference count. */
if (map->l_opencount > 1 || map->l_type != lt_loaded)
{
@ -78,14 +81,17 @@ _dl_close (void *_map)
"\n", NULL);
}
--map->l_opencount;
/* Even if we don't unload it now, we still have to decrement
`l_opencount' of the dependencies. Otherwise, they may not
get unloaded later. */
for (i = 0; i < nsearchlist; ++i)
if (! (list[i]->l_flags_1 & DF_1_NODELETE))
--list[i]->l_opencount;
__libc_lock_unlock (_dl_load_lock);
return;
}
list = map->l_searchlist.r_list;
nsearchlist = map->l_searchlist.r_nlist;
rellist = map->l_reldeps;
nrellist = map->l_reldepsact;

View File

@ -851,7 +851,7 @@ _dl_map_object_from_fd (const char *name, int fd, char *realname,
if (__builtin_expect (header->e_version, EV_CURRENT) != EV_CURRENT)
LOSE (0, N_("ELF file version does not match current one"));
if (! __builtin_expect (elf_machine_matches_host (header->e_machine), 1))
if (! __builtin_expect (elf_machine_matches_host (header), 1))
LOSE (0, N_("ELF file machine architecture does not match"));
if (__builtin_expect (header->e_phentsize, sizeof (ElfW(Phdr)))
!= sizeof (ElfW(Phdr)))

4
elf/neededobj1.c Normal file
View File

@ -0,0 +1,4 @@
void
c_function (void)
{
}

7
elf/neededobj2.c Normal file
View File

@ -0,0 +1,7 @@
extern void c_function (void);
void
b_function (void)
{
c_function();
}

9
elf/neededobj3.c Normal file
View File

@ -0,0 +1,9 @@
extern void b_function (void);
extern void c_function (void);
void
a_function (void)
{
b_function ();
c_function ();
}

104
elf/neededtest.c Normal file
View File

@ -0,0 +1,104 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dlfcn.h>
#include <link.h>
static int
check_loaded_objects (const char **loaded)
{
struct link_map *lm;
int n;
int *found = NULL;
int errors = 0;
for (n = 0; loaded[n]; n++)
/* NOTHING */;
if (n)
{
found = (int *) alloca (sizeof (int) * n);
memset (found, 0, sizeof (int) * n);
}
printf(" Name\n");
printf(" --------------------------------------------------------\n");
for (lm = _r_debug.r_map; lm; lm = lm->l_next)
{
if (lm->l_name && lm->l_name[0])
printf(" %s\n", lm->l_name);
if (lm->l_type == lt_loaded && lm->l_name)
{
int match = 0;
for (n = 0; loaded[n] != NULL; n++)
{
if (strcmp (basename (loaded[n]), basename (lm->l_name)) == 0)
{
found[n] = 1;
match = 1;
break;
}
}
if (match == 0)
{
++errors;
printf ("ERRORS: %s is not unloaded\n", lm->l_name);
}
}
}
for (n = 0; loaded[n] != NULL; n++)
{
if (found[n] == 0)
{
++errors;
printf ("ERRORS: %s is not loaded\n", loaded[n]);
}
}
return errors;
}
int
main (void)
{
void *obj2;
void *obj3;
const char *loaded[] = { NULL, NULL, NULL, NULL };
int errors = 0;
printf ("\nThis is what is in memory now:\n");
errors += check_loaded_objects (loaded);
printf( "Loading shared object neededobj3.so\n");
obj3 = dlopen( "neededobj3.so", RTLD_LAZY);
if (obj3 == NULL)
{
printf ("%s\n", dlerror ());
exit (1);
}
printf ("And this is what is now in memory\n");
loaded[0] = "neededobj1.so";
loaded[1] = "neededobj2.so";
loaded[2] = "neededobj3.so";
errors += check_loaded_objects (loaded);
printf ("Now loading shared object neededobj2.so\n");
obj2 = dlopen ("neededobj2.so", RTLD_LAZY);
if (obj2 == NULL)
{
printf ("%s\n", dlerror ());
exit (1);
}
printf ("Again, this is what is in memory\n");
errors += check_loaded_objects (loaded);
printf ("Closing neededobj2.so\n");
dlclose (obj2);
errors += check_loaded_objects (loaded);
printf ("Closing neededobj3.so\n");
dlclose (obj3);
loaded[0] = NULL;
errors += check_loaded_objects (loaded);
if (errors != 0)
printf ("%d errorss found\n", errors);
return errors;
}

View File

@ -92,6 +92,7 @@
/* Number of bits in a word of type `int'. */
#ifdef INT_MAX
# if INT_MAX == 32767
# define WORD_BIT 16
# else
@ -102,13 +103,43 @@
# define WORD_BIT 64
# endif
# endif
#elif defined __INT_MAX__
# if __INT_MAX__ == 32767
# define WORD_BIT 16
# else
# if __INT_MAX__ == 2147483647
# define WORD_BIT 32
# else
/* Safe assumption. */
# define WORD_BIT 64
# endif
# endif
#else
# define WORD_BIT 32
#endif
/* Number of bits in a word of type `long int'. */
#ifdef LONG_MAX
# if LONG_MAX == 2147483647
# define LONG_BIT 32
# else
/* Safe assumption. */
# define LONG_BIT 64
# endif
#elif defined __LONG_MAX__
# if __LONG_MAX__ == 2147483647
# define LONG_BIT 32
# else
/* Safe assumption. */
# define LONG_BIT 64
# endif
#else
# include <bits/wordsize.h>
# if __WORDSIZE == 64
# define LONG_BIT 64
# else
# define LONG_BIT 32
# endif
#endif
#endif /* bits/xopen_lim.h */

View File

@ -42,6 +42,8 @@
# ifndef _LIMITS_H
# define _LIMITS_H 1
#include <bits/wordsize.h>
/* We don't have #include_next.
Define ANSI <limits.h> for standard 32-bit words. */
@ -82,7 +84,7 @@
# define UINT_MAX 4294967295U
/* Minimum and maximum values a `signed long int' can hold. */
# ifdef __alpha__
# if __WORDSIZE == 64
# define LONG_MAX 9223372036854775807L
# else
# define LONG_MAX 2147483647L
@ -90,7 +92,7 @@
# define LONG_MIN (-LONG_MAX - 1L)
/* Maximum value an `unsigned long int' can hold. (Minimum is 0.) */
# ifdef __alpha__
# if __WORDSIZE == 64
# define ULONG_MAX 18446744073709551615UL
# else
# define ULONG_MAX 4294967295UL

View File

@ -245,6 +245,7 @@ collating-symbol <CYR-OUBRE>
collating-symbol <CYR-EF>
collating-symbol <CYR-HA>
collating-symbol <CYR-TSE>
collating-symbol <CYR-CHE>
collating-symbol <CYR-DCHE>
collating-symbol <CYR-SHA>
collating-symbol <CYR-SHTSHA>
@ -501,6 +502,7 @@ collating-symbol <CYR-YA>
<CYR-EF>
<CYR-HA>
<CYR-TSE>
<CYR-CHE>
<CYR-DCHE>
<CYR-SHA>
<CYR-SHTSHA>
@ -1428,7 +1430,7 @@ order_start <CYRIL>;forward;forward;forward;forward,position
<U0444> <CYR-EF>;<BAS>;<MIN>;IGNORE
<U0445> <CYR-HA>;<BAS>;<MIN>;IGNORE
<U0446> <CYR-TSE>;<BAS>;<MIN>;IGNORE
<U0447> <CYR-TSHE>;<BAS>;<MIN>;IGNORE
<U0447> <CYR-CHE>;<BAS>;<MIN>;IGNORE
<U045F> <CYR-DCHE>;<BAS>;<MIN>;IGNORE
<U0448> <CYR-SHA>;<BAS>;<MIN>;IGNORE
<U0449> <CYR-SHTSHA>;<BAS>;<MIN>;IGNORE
@ -1473,7 +1475,7 @@ order_start <CYRIL>;forward;forward;forward;forward,position
<U0424> <CYR-EF>;<BAS>;<CAP>;IGNORE
<U0425> <CYR-HA>;<BAS>;<CAP>;IGNORE
<U0426> <CYR-TSE>;<BAS>;<CAP>;IGNORE
<U0427> <CYR-TSHE>;<BAS>;<CAP>;IGNORE
<U0427> <CYR-CHE>;<BAS>;<CAP>;IGNORE
<U040F> <CYR-DCHE>;<BAS>;<CAP>;IGNORE
<U0428> <CYR-SHA>;<BAS>;<CAP>;IGNORE
<U0429> <CYR-SHTSHA>;<BAS>;<CAP>;IGNORE

View File

@ -7,10 +7,8 @@
common_objpfx=$1; shift
elf_objpfx=$1; shift
rtld_installed_name=$1; shift
logfile=$common_objpfx/posix/wordexp-tst.out
: ${TMPDIR=${common_objpfx}posix}
testout=$TMPDIR/wordexp-test-result
logfile=${common_objpfx}posix/wordexp-tst.out
testout=${common_objpfx}posix/wordexp-test-result
result=0
rm -f $logfile

View File

@ -29,11 +29,11 @@
#include <string.h>
/* Return nonzero iff E_MACHINE is compatible with the running host. */
/* Return nonzero iff ELF header is compatible with the running host. */
static inline int
elf_machine_matches_host (Elf64_Word e_machine)
elf_machine_matches_host (const Elf64_Ehdr *ehdr)
{
return e_machine == EM_ALPHA;
return ehdr->e_machine == EM_ALPHA;
}
/* Return the link-time address of _DYNAMIC. The multiple-got-capable

View File

@ -43,17 +43,11 @@
: "a1"); \
}
/* Return nonzero iff E_MACHINE is compatible with the running host. */
/* Return nonzero iff ELF header is compatible with the running host. */
static inline int __attribute__ ((unused))
elf_machine_matches_host (Elf32_Half e_machine)
elf_machine_matches_host (const Elf32_Ehdr *ehdr)
{
switch (e_machine)
{
case EM_ARM:
return 1;
default:
return 0;
}
return ehdr->e_machine == EM_ARM;
}

View File

@ -23,11 +23,11 @@
#include <link.h>
/* Return nonzero iff E_MACHINE is compatible with the running host. */
/* Return nonzero iff ELF header is compatible with the running host. */
static inline int
elf_machine_matches_host (Elf32_Half e_machine)
elf_machine_matches_host (const Elf32_Ehdr *ehdr)
{
switch (e_machine)
switch (ehdr->e_machine)
{
default:
return 0;

View File

@ -59,11 +59,11 @@ extern int __fptr_count;
extern Elf32_Addr __hppa_make_fptr (const struct link_map *, Elf32_Addr,
struct hppa_fptr **, struct hppa_fptr *);
/* Return nonzero iff E_MACHINE is compatible with the running host. */
/* Return nonzero iff ELF header is compatible with the running host. */
static inline int
elf_machine_matches_host (Elf32_Half e_machine)
elf_machine_matches_host (const Elf32_Ehdr *ehdr)
{
return e_machine == EM_PARISC;
return ehdr->e_machine == EM_PARISC;
}

View File

@ -24,17 +24,11 @@
#include <sys/param.h>
/* Return nonzero iff E_MACHINE is compatible with the running host. */
/* Return nonzero iff ELF header is compatible with the running host. */
static inline int __attribute__ ((unused))
elf_machine_matches_host (Elf32_Half e_machine)
elf_machine_matches_host (const Elf32_Ehdr *ehdr)
{
switch (e_machine)
{
case EM_386:
return 1;
default:
return 0;
}
return ehdr->e_machine == EM_386;
}

View File

@ -53,11 +53,11 @@ extern int __fptr_count;
extern Elf64_Addr __ia64_make_fptr (const struct link_map *, Elf64_Addr,
struct ia64_fptr **, struct ia64_fptr *);
/* Return nonzero iff E_MACHINE is compatible with the running host. */
/* Return nonzero iff ELF header is compatible with the running host. */
static inline int
elf_machine_matches_host (Elf64_Word e_machine)
elf_machine_matches_host (const Elf64_Ehdr *ehdr)
{
return e_machine == EM_IA_64;
return ehdr->e_machine == EM_IA_64;
}

View File

@ -24,17 +24,11 @@
#include <sys/param.h>
/* Return nonzero iff E_MACHINE is compatible with the running host. */
/* Return nonzero iff ELF header is compatible with the running host. */
static inline int
elf_machine_matches_host (Elf32_Half e_machine)
elf_machine_matches_host (const Elf32_Ehdr *ehdr)
{
switch (e_machine)
{
case EM_68K:
return 1;
default:
return 0;
}
return ehdr->e_machine == EM_68K;
}

View File

@ -86,11 +86,11 @@ do { if ((l)->l_info[DT_MIPS (RLD_MAP)]) \
(ElfW(Addr)) (r); \
} while (0)
/* Return nonzero iff E_MACHINE is compatible with the running host. */
/* Return nonzero iff ELF header is compatible with the running host. */
static inline int __attribute__ ((unused))
elf_machine_matches_host (ElfW(Half) e_machine)
elf_machine_matches_host (const ElfW(Ehdr) *ehdr)
{
switch (e_machine)
switch (ehdr->e_machine)
{
case EM_MIPS:
case EM_MIPS_RS3_LE:

View File

@ -77,11 +77,11 @@ do { if ((l)->l_info[DT_MIPS (RLD_MAP)]) \
(ElfW(Addr)) (r); \
} while (0)
/* Return nonzero iff E_MACHINE is compatible with the running host. */
/* Return nonzero iff ELF header is compatible with the running host. */
static inline int __attribute__ ((unused))
elf_machine_matches_host (ElfW(Half) e_machine)
elf_machine_matches_host (const ElfW(Ehdr) *ehdr)
{
switch (e_machine)
switch (ehdr->e_machine)
{
case EM_MIPS:
case EM_MIPS_RS3_LE:

View File

@ -25,11 +25,11 @@
#include <assert.h>
/* Return nonzero iff E_MACHINE is compatible with the running host. */
/* Return nonzero iff ELF header is compatible with the running host. */
static inline int
elf_machine_matches_host (Elf32_Half e_machine)
elf_machine_matches_host (const Elf32_Ehdr *ehdr)
{
return e_machine == EM_PPC;
return ehdr->e_machine == EM_PPC;
}

View File

@ -29,17 +29,11 @@
#include <link.h>
/* Return nonzero iff E_MACHINE is compatible with the running host. */
/* Return nonzero iff ELF header is compatible with the running host. */
static inline int
elf_machine_matches_host (Elf32_Half e_machine)
elf_machine_matches_host (const Elf32_Ehdr *ehdr)
{
switch (e_machine)
{
case EM_S390:
return 1;
default:
return 0;
}
return ehdr->e_machine == EM_S390;
}

View File

@ -28,17 +28,11 @@
#include <assert.h>
/* Return nonzero iff E_MACHINE is compatible with the running host. */
/* Return nonzero iff ELF header is compatible with the running host. */
static inline int __attribute__ ((unused))
elf_machine_matches_host (Elf32_Half e_machine)
elf_machine_matches_host (const Elf32_Ehdr *ehdr)
{
switch (e_machine)
{
case EM_SH:
return 1;
default:
return 0;
}
return ehdr->e_machine == EM_SH;
}

View File

@ -43,13 +43,13 @@
: "/etc/ld.so.preload")
/* Return nonzero iff E_MACHINE is compatible with the running host. */
/* Return nonzero iff ELF header is compatible with the running host. */
static inline int
elf_machine_matches_host (Elf32_Half e_machine)
elf_machine_matches_host (const Elf32_Ehdr *ehdr)
{
if (e_machine == EM_SPARC)
if (ehdr->e_machine == EM_SPARC)
return 1;
else if (e_machine == EM_SPARC32PLUS)
else if (ehdr->e_machine == EM_SPARC32PLUS)
{
unsigned long *hwcap;
weak_extern (_dl_hwcap);

View File

@ -27,11 +27,11 @@
#define ELF64_R_TYPE_ID(info) ((info) & 0xff)
#define ELF64_R_TYPE_DATA(info) ((info) >> 8)
/* Return nonzero iff E_MACHINE is compatible with the running host. */
/* Return nonzero iff ELF header is compatible with the running host. */
static inline int
elf_machine_matches_host (Elf64_Half e_machine)
elf_machine_matches_host (const Elf64_Ehdr *ehdr)
{
return e_machine == EM_SPARCV9;
return ehdr->e_machine == EM_SPARCV9;
}
/* Return the link-time address of _DYNAMIC. Conveniently, this is the