(elf_machine_matches_host): Parameter is now pointer to ELF header.

This commit is contained in:
Ulrich Drepper 2000-10-20 17:04:28 +00:00
parent 8a02fd962e
commit f1dba30859
6 changed files with 21 additions and 33 deletions

View File

@ -29,11 +29,11 @@
#include <string.h> #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 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 /* Return the link-time address of _DYNAMIC. The multiple-got-capable

View File

@ -43,17 +43,11 @@
: "a1"); \ : "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)) static inline int __attribute__ ((unused))
elf_machine_matches_host (Elf32_Half e_machine) elf_machine_matches_host (const Elf32_Ehdr *ehdr)
{ {
switch (e_machine) return ehdr->e_machine == EM_ARM;
{
case EM_ARM:
return 1;
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, extern Elf32_Addr __hppa_make_fptr (const struct link_map *, Elf32_Addr,
struct hppa_fptr **, struct hppa_fptr *); 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 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> #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 static inline int
elf_machine_matches_host (Elf32_Half e_machine) elf_machine_matches_host (const Elf32_Ehdr *ehdr)
{ {
switch (e_machine) return ehdr->e_machine == EM_68K;
{
case EM_68K:
return 1;
default:
return 0;
}
} }

View File

@ -86,11 +86,11 @@ do { if ((l)->l_info[DT_MIPS (RLD_MAP)]) \
(ElfW(Addr)) (r); \ (ElfW(Addr)) (r); \
} while (0) } 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)) 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:
case EM_MIPS_RS3_LE: case EM_MIPS_RS3_LE:

View File

@ -77,11 +77,11 @@ do { if ((l)->l_info[DT_MIPS (RLD_MAP)]) \
(ElfW(Addr)) (r); \ (ElfW(Addr)) (r); \
} while (0) } 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)) 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:
case EM_MIPS_RS3_LE: case EM_MIPS_RS3_LE: