]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(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 69845b4b0164de75bd4c7580f14a3c101f72dbe2..d9aeb18764d9b2a16dccb3ceb034f00ab5eb7bc6 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 cbef92f3ae327808897e051a4c020c3e015e4314..9b40e6f98b70ddb4f284e20b97a0019bd0fadfe0 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 e6782b348197dd43bc9c57ccf9ada9f189d28315..89ad542cdde03d13cf41031bc36efad39087526b 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 06c9db64a824a18e05947d34e07a28ce230c225b..3381d6f25ee584e44f86351d5563127efebe7edd 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 c0ece38719919e9c75da76805b7f2640197f1593..8051dc670cecbd9aa52943249632863d54f9fbc1 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 195a1d36341d15c9ff30db2220cd505e0e0a4544..59bd581eaeae11738f15df3f43342440ee7ad764 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: