aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2009-09-28 09:45:33 +0000
committerNick Clifton <nickc@redhat.com>2009-09-28 09:45:33 +0000
commitcaa83f8b08be81c0f5a93fd8beee392eeac826bc (patch)
tree938d28131809fc700206f5990d812e16a8f417ff /bfd
parentfc9f1df98e169c50b9cc1b7b016a3fb712c3af1f (diff)
downloadgdb-caa83f8b08be81c0f5a93fd8beee392eeac826bc.zip
gdb-caa83f8b08be81c0f5a93fd8beee392eeac826bc.tar.gz
gdb-caa83f8b08be81c0f5a93fd8beee392eeac826bc.tar.bz2
PR 10478
* 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.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/elf.c3
-rw-r--r--bfd/elfcode.h5
3 files changed, 13 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 860297b..3594e25 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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.
diff --git a/bfd/elf.c b/bfd/elf.c
index e7116d8..4a32929 100644
--- 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 */)
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index f539119..ecdc2de 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -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: