PR 10478
authorNick Clifton <nickc@redhat.com>
Mon, 28 Sep 2009 09:45:33 +0000 (09:45 +0000)
committerNick Clifton <nickc@redhat.com>
Mon, 28 Sep 2009 09:45:33 +0000 (09:45 +0000)
        * elf.c (bfd_section_from_shdr): Allow SHN_BEFORE and SHN_AFTER
        section link values in x86 binaries.
        * elfcode.h (elf_object_p): Likewise.
        * readelf.c (get_elf_section_flags): Allow SHN_BEFORE and
        SHN_AFTER section link values in x86 binaries.
        (process_section_headers): Likewise.

bfd/ChangeLog
bfd/elf.c
bfd/elfcode.h
binutils/ChangeLog
binutils/readelf.c

index 860297be5d719a35edd45ea1cc83baecab8e9e5f..3594e2550b5c70c836d6f317bb8fcf54950a3262 100644 (file)
@@ -1,3 +1,10 @@
+2009-09-28  Nick Clifton  <nickc@redhat.com>
+
+       PR 10478: Accepting Solaris binaries.
+       * elf.c (bfd_section_from_shdr): Allow SHN_BEFORE and SHN_AFTER
+       section link values in x86 binaries.
+       * elfcode.h (elf_object_p): Likewise.
+
 2009-09-28  Philippe De Muyter  <phdm@macqel.be>
 
        * elf32-m68k.c (elf_m68k_final_write_processing): New function.
index e7116d8994dbd0ddeb5d769a658eeadf7b5405bc..4a329294ce7c1645bbb4a881359cdd6b99316d9f 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -1518,10 +1518,11 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
        return FALSE;
       if (hdr->sh_link > elf_numsections (abfd))
        {
-         /* PR 10478: Accept sparc binaries with a sh_link
+         /* PR 10478: Accept Solaris binaries with a sh_link
             field set to SHN_BEFORE or SHN_AFTER.  */
          switch (bfd_get_arch (abfd))
            {
+           case bfd_arch_i386:
            case bfd_arch_sparc:
              if (hdr->sh_link == (SHN_LORESERVE & 0xffff) /* SHN_BEFORE */
                  || hdr->sh_link == ((SHN_LORESERVE + 1) & 0xffff) /* SHN_AFTER */)
index f5391194b686c30547879798a9d68ce448acdbe7..ecdc2de5b46b7c06ae098e480cefef77144c31b8 100644 (file)
@@ -761,10 +761,13 @@ elf_object_p (bfd *abfd)
          /* Sanity check sh_link and sh_info.  */
          if (i_shdrp[shindex].sh_link >= num_sec)
            {
-             /* PR 10478: Accept sparc binaries with a sh_link
+             /* PR 10478: Accept Solaris binaries with a sh_link
                 field set to SHN_BEFORE or SHN_AFTER.  */
              switch (ebd->elf_machine_code)
                {
+               case EM_386:
+               case EM_486:
+               case EM_X86_64:
                case EM_OLD_SPARCV9:
                case EM_SPARC32PLUS:
                case EM_SPARCV9:
index 04e553f296ed344c3c50dcdfaee227e9c8409859..b059f91e6301b581b710284b2ded0fe3cfc06b1d 100644 (file)
@@ -1,3 +1,10 @@
+2009-09-28  Nick Clifton  <nickc@redhat.com>
+
+       PR 10478
+       * readelf.c (get_elf_section_flags): Allow SHN_BEFORE and
+       SHN_AFTER section link values in x86 binaries.
+       (process_section_headers): Likewise.
+
 2009-09-25  Dimitry Gorbachev  <d.g.gorbachev@gmail.com>
 
        PR 10656
index 9c0982307d8604c4b123acbcc16c1d90210c37a9..a57b5ad63bc1bba5cc60643a24db5d2a51b149e3 100644 (file)
@@ -3971,6 +3971,9 @@ get_elf_section_flags (bfd_vma sh_flags)
 #endif
                  break;
 
+               case EM_386:
+               case EM_486:
+               case EM_X86_64:
                case EM_OLD_SPARCV9:
                case EM_SPARC32PLUS:
                case EM_SPARCV9:
@@ -4384,9 +4387,12 @@ process_section_headers (FILE * file)
            {
              link_too_big = "";
              /* The sh_link value is out of range.  Normally this indicates
-                an error but it can have special values in SPARC binaries.  */
+                an error but it can have special values in Solaris binaries.  */
              switch (elf_header.e_machine)
                {
+               case EM_386:
+               case EM_486:
+               case EM_X86_64:
                case EM_OLD_SPARCV9:
                case EM_SPARC32PLUS:
                case EM_SPARCV9: