summaryrefslogtreecommitdiff
path: root/bfd/elfcode.h
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2009-09-09 15:03:51 +0000
committerNick Clifton <nickc@redhat.com>2009-09-09 15:03:51 +0000
commit27e200d1792d17772c81d4390d94a3bf9bc997ec (patch)
tree6a180752b6cc4c237705df0b0c6ec468ab6208a1 /bfd/elfcode.h
parent7b5a7da962b37c24a558b04091a9c80eb7fdf6a2 (diff)
downloadgdb-27e200d1792d17772c81d4390d94a3bf9bc997ec.tar.gz
PR 10478:
* elf.c (bfd_section_from_shdr): Do not reject sparc binaries with section headers containing sh_link values of SHN_BEFORE or SHN_AFTER. * elfcode.h (elf_object_p): Likewise. readelf.c (get_elf_section_flags): Add support for SHF_EXCLUDE and SHF_ORDERED. (process_section_headers): Warn about out of range sh_link values. When displaying detailed section header information annote the SHN_BEFORE and SHN_AFTER values.
Diffstat (limited to 'bfd/elfcode.h')
-rw-r--r--bfd/elfcode.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index 10aa13140e7..889d25ab736 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -760,7 +760,23 @@ elf_object_p (bfd *abfd)
/* Sanity check sh_link and sh_info. */
if (i_shdrp[shindex].sh_link >= num_sec)
- goto got_wrong_format_error;
+ {
+ /* PR 10478: Accept sparc binaries with a sh_link
+ field set to SHN_BEFORE or SHN_AFTER. */
+ switch (ebd->elf_machine_code)
+ {
+ case EM_OLD_SPARCV9:
+ case EM_SPARC32PLUS:
+ case EM_SPARCV9:
+ case EM_SPARC:
+ if (i_shdrp[shindex].sh_link == (SHN_LORESERVE & 0xffff) /* SHN_BEFORE */
+ || i_shdrp[shindex].sh_link == ((SHN_LORESERVE + 1) & 0xffff) /* SHN_AFTER */)
+ break;
+ /* Otherwise fall through. */
+ default:
+ goto got_wrong_format_error;
+ }
+ }
if (((i_shdrp[shindex].sh_flags & SHF_INFO_LINK)
|| i_shdrp[shindex].sh_type == SHT_RELA