* elfcode.h (elf_sort_hdrs): Keep SHT_NOBITS sections after
authorDavid Edelsohn <dje.gcc@gmail.com>
Tue, 7 Mar 1995 07:34:21 +0000 (07:34 +0000)
committerDavid Edelsohn <dje.gcc@gmail.com>
Tue, 7 Mar 1995 07:34:21 +0000 (07:34 +0000)
!SHT_NOBITS ones.

bfd/ChangeLog
bfd/elfcode.h

index 541611d884bcb6c32458cf3f52ff002aa31485c8..fee1f1776c6a7e9cd15c17a627052db388e459f5 100644 (file)
@@ -1,3 +1,8 @@
+Mon Mar  6 23:31:36 1995  Doug Evans  <dje@chestnut.cygnus.com>
+
+       * elfcode.h (elf_sort_hdrs): Keep SHT_NOBITS sections after
+       !SHT_NOBITS ones.
+
 Mon Mar  6 09:53:08 1995  Jeff Law  (law@snake.cs.utah.edu)
 
        * cpu-hppa.c (arch_info_struct): Support both PA1.0 and PA1.1
index 36e2243dc7ad6daf5d32163e3de3400c7d53718f..72908ca582a4959b3ec1c1745c33fde070417ad8 100644 (file)
@@ -867,7 +867,9 @@ elf_object_p (abfd)
 
   /* Check that the ELF e_machine field matches what this particular
      BFD format expects.  */
-  if (ebd->elf_machine_code != i_ehdrp->e_machine)
+  if (ebd->elf_machine_code != i_ehdrp->e_machine
+      && (ebd->elf_machine_alt1 == 0 || i_ehdrp->e_machine != ebd->elf_machine_alt1)
+      && (ebd->elf_machine_alt2 == 0 || i_ehdrp->e_machine != ebd->elf_machine_alt2))
     {
       const bfd_target * const *target_ptr;
 
@@ -2265,8 +2267,21 @@ elf_sort_hdrs (arg1, arg2)
        return -1;
       else if (hdr1->sh_addr > hdr2->sh_addr)
        return 1;
+      if (hdr1->sh_size == 0)
+       {
+         if (hdr2->sh_size == 0)
+           {
+             /* Put !SHT_NOBITS sections before SHT_NOBITS ones.
+                The main loop in map_program_segments requires this. */
+             return (hdr1->sh_type == SHT_NOBITS) - (hdr2->sh_type == SHT_NOBITS);
+           }
+         else
+           return -1;
+       }
+      else if (hdr2->sh_size == 0)
+       return 1;
       /* Put !SHT_NOBITS sections before SHT_NOBITS ones.
-         The main loop in map_program_segments assumes this. */
+         The main loop in map_program_segments requires this. */
       return (hdr1->sh_type == SHT_NOBITS) - (hdr2->sh_type == SHT_NOBITS);
     }
   else
@@ -3764,7 +3779,9 @@ elf_core_file_p (abfd)
 
   /* Check that the ELF e_machine field matches what this particular
      BFD format expects.  */
-  if (ebd->elf_machine_code != i_ehdrp->e_machine)
+  if (ebd->elf_machine_code != i_ehdrp->e_machine
+      && (ebd->elf_machine_alt1 == 0 || i_ehdrp->e_machine != ebd->elf_machine_alt1)
+      && (ebd->elf_machine_alt2 == 0 || i_ehdrp->e_machine != ebd->elf_machine_alt2))
     {
       const bfd_target * const *target_ptr;
 
This page took 0.034229 seconds and 4 git commands to generate.