if (is_rela)
{
- bfd_signed_vma off = rels[i].r_addend;
+ bfd_vma off = rels[i].r_addend;
- /* PR 17531: file: 2e63226f. */
- if (off == ((bfd_signed_vma) 1) << ((sizeof (bfd_signed_vma) * 8) - 1))
- printf (" + %" BFD_VMA_FMT "x", off);
- else if (off < 0)
+ if ((bfd_signed_vma) off < 0)
printf (" - %" BFD_VMA_FMT "x", - off);
else
printf (" + %" BFD_VMA_FMT "x", off);
}
else if (is_rela)
{
- bfd_signed_vma off = rels[i].r_addend;
+ bfd_vma off = rels[i].r_addend;
printf ("%*c", is_32bit_elf ? 12 : 20, ' ');
- /* PR 17531: file: 2e63226f. */
- if (off == ((bfd_signed_vma) 1) << ((sizeof (bfd_signed_vma) * 8) - 1))
- printf ("%" BFD_VMA_FMT "x", off);
- else if (off < 0)
+ if ((bfd_signed_vma) off < 0)
printf ("-%" BFD_VMA_FMT "x", - off);
else
printf ("%" BFD_VMA_FMT "x", off);
case DT_MIPS_GOTSYM: return "MIPS_GOTSYM";
case DT_MIPS_HIPAGENO: return "MIPS_HIPAGENO";
case DT_MIPS_RLD_MAP: return "MIPS_RLD_MAP";
+ case DT_MIPS_RLD_MAP_REL: return "MIPS_RLD_MAP_REL";
case DT_MIPS_DELTA_CLASS: return "MIPS_DELTA_CLASS";
case DT_MIPS_DELTA_CLASS_NO: return "MIPS_DELTA_CLASS_NO";
case DT_MIPS_DELTA_INSTANCE: return "MIPS_DELTA_INSTANCE";
might not have the luxury of section headers. Look for the DT_NULL
terminator to determine the number of entries. */
for (ext = edyn, dynamic_nent = 0;
- (char *) ext < (char *) edyn + dynamic_size - sizeof (* entry);
+ (char *) (ext + 1) <= (char *) edyn + dynamic_size;
ext++)
{
dynamic_nent++;
might not have the luxury of section headers. Look for the DT_NULL
terminator to determine the number of entries. */
for (ext = edyn, dynamic_nent = 0;
- /* PR 17533 file: 033-67080-0.004 - do not read off the end of the buffer. */
- (char *) ext < ((char *) edyn) + dynamic_size - sizeof (* ext);
+ /* PR 17533 file: 033-67080-0.004 - do not read past end of buffer. */
+ (char *) (ext + 1) <= (char *) edyn + dynamic_size;
ext++)
{
dynamic_nent++;
unsigned int compression_header_size
= get_compression_header (& chdr, (unsigned char *) start);
- if (chdr.ch_type == ELFCOMPRESS_ZLIB
- && chdr.ch_addralign == section->sh_addralign)
+ if (chdr.ch_type != ELFCOMPRESS_ZLIB)
+ {
+ warn (_("section '%s' has unsupported compress type: %d\n"),
+ printable_section_name (section), chdr.ch_type);
+ return;
+ }
+ else if (chdr.ch_addralign != section->sh_addralign)
{
- uncompressed_size = chdr.ch_size;
- start += compression_header_size;
- new_size -= compression_header_size;
+ warn (_("compressed section '%s' is corrupted\n"),
+ printable_section_name (section));
+ return;
}
+ uncompressed_size = chdr.ch_size;
+ start += compression_header_size;
+ new_size -= compression_header_size;
}
else if (new_size > 12 && streq ((char *) start, "ZLIB"))
{
unsigned int compression_header_size
= get_compression_header (& chdr, start);
- if (chdr.ch_type == ELFCOMPRESS_ZLIB
- && chdr.ch_addralign == section->sh_addralign)
+ if (chdr.ch_type != ELFCOMPRESS_ZLIB)
+ {
+ warn (_("section '%s' has unsupported compress type: %d\n"),
+ printable_section_name (section), chdr.ch_type);
+ return;
+ }
+ else if (chdr.ch_addralign != section->sh_addralign)
{
- uncompressed_size = chdr.ch_size;
- start += compression_header_size;
- new_size -= compression_header_size;
+ warn (_("compressed section '%s' is corrupted\n"),
+ printable_section_name (section));
+ return;
}
+ uncompressed_size = chdr.ch_size;
+ start += compression_header_size;
+ new_size -= compression_header_size;
}
else if (new_size > 12 && streq ((char *) start, "ZLIB"))
{
Elf_Internal_Chdr chdr;
unsigned int compression_header_size
= get_compression_header (&chdr, start);
- if (chdr.ch_type != ELFCOMPRESS_ZLIB
- || chdr.ch_addralign != sec->sh_addralign)
- return 0;
+ if (chdr.ch_type != ELFCOMPRESS_ZLIB)
+ {
+ warn (_("section '%s' has unsupported compress type: %d\n"),
+ section->name, chdr.ch_type);
+ return 0;
+ }
+ else if (chdr.ch_addralign != sec->sh_addralign)
+ {
+ warn (_("compressed section '%s' is corrupted\n"),
+ section->name);
+ return 0;
+ }
uncompressed_size = chdr.ch_size;
start += compression_header_size;
size -= compression_header_size;
case Val_GNU_MIPS_ABI_FP_64A:
printf (_("Hard float compat (32-bit CPU, 64-bit FPU)\n"));
break;
+ case Val_GNU_MIPS_ABI_FP_NAN2008:
+ printf (_("NaN 2008 compatibility\n"));
+ break;
default:
printf ("??? (%d)\n", val);
break;
len = sizeof (* eopt);
while (len < option->size)
{
- char datum = * ((char *) eopt + offset + len);
+ unsigned char datum = * ((unsigned char *) eopt + offset + len);
if (ISPRINT (datum))
printf ("%c", datum);