(elf_machine_matches_host): Parameter is now pointer to ELF header.
authorUlrich Drepper <drepper@redhat.com>
Fri, 20 Oct 2000 17:04:28 +0000 (17:04 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 20 Oct 2000 17:04:28 +0000 (17:04 +0000)
sysdeps/alpha/dl-machine.h
sysdeps/arm/dl-machine.h
sysdeps/hppa/dl-machine.h
sysdeps/m68k/dl-machine.h
sysdeps/mips/dl-machine.h
sysdeps/mips/mips64/dl-machine.h

index 69845b4..d9aeb18 100644 (file)
 #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
index cbef92f..9b40e6f 100644 (file)
                    : "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;
 }
 
 
@@ -491,7 +485,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
 
             newvalue = value - (Elf32_Addr)reloc_addr + (addend << 2);
             if (newvalue & 0xfc000003)
-              newvalue = fix_bad_pc24(reloc_addr, value) 
+              newvalue = fix_bad_pc24(reloc_addr, value)
                 - (Elf32_Addr)reloc_addr + (addend << 2);
 
             newvalue = newvalue >> 2;
index e6782b3..89ad542 100644 (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;
 }
 
 
@@ -252,7 +252,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
        .text
        .globl _start
        .type _start,@function
-_start:        
+_start:
        /* The kernel does not give us an initial stack frame. */
        ldo     64(%sp),%sp
        /* Save the relevant arguments (yes, those are the correct
@@ -357,7 +357,7 @@ _dl_start_user:
        ldw     RT'_dl_loaded(%r1),%r26
        ldw     0(%r26),%r26
        /* envp = argv + argc + 1 */
-       sh2add  %r25,%r24,%r23  
+       sh2add  %r25,%r24,%r23
        bl      _dl_init,%r2
        ldo     4(%r23),%r23    /* delay slot */
 
index 06c9db6..3381d6f 100644 (file)
 
 #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;
 }
 
 
index c0ece38..8051dc6 100644 (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:
index 195a1d3..59bd581 100644 (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: