summaryrefslogtreecommitdiffstats
path: root/bfd/elfcode.h
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2009-09-09 15:03:54 +0000
committerNick Clifton <nickc@redhat.com>2009-09-09 15:03:54 +0000
commitcfcac11dc826f830a5ca9a7265ad5e2ecd14e92f (patch)
tree61359fd7d4d1adacb8558d014145b96165b70922 /bfd/elfcode.h
parentad86f1fb4da4f0b049bfd5f9fb05dcd52124ad33 (diff)
downloadppe42-binutils-cfcac11dc826f830a5ca9a7265ad5e2ecd14e92f.tar.gz
ppe42-binutils-cfcac11dc826f830a5ca9a7265ad5e2ecd14e92f.zip
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 10aa13140e..889d25ab73 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
OpenPOWER on IntegriCloud