* is_signed = FALSE;
- if (data >= end)
- return;
-
abbrev_number = read_uleb128 (data, & bytes_read, end);
data += bytes_read;
NB/ We need to avoid infinite recursion. */
return;
}
+ if (uvalue >= (size_t) (end - start))
+ return;
get_type_signedness (start, start + uvalue, end, pointer_size,
offset_size, dwarf_version, is_signed, TRUE);
break;
switch (attribute)
{
case DW_AT_type:
- if (level >= 0 && level < MAX_CU_NESTING)
+ if (level >= 0 && level < MAX_CU_NESTING
+ && uvalue < (size_t) (end - start))
{
bfd_boolean is_signed = FALSE;
if (reg < (unsigned int) fc->ncols)
return 0;
- if (dwarf_regnames_count
+ if (dwarf_regnames_count > 0
&& reg > dwarf_regnames_count)
return -1;
return -1;
/* PR 17512: file: 2844a11d. */
- if (fc->ncols > 1024)
+ if (fc->ncols > 1024 && dwarf_regnames_count == 0)
{
error (_("Unfeasibly large register number: %u\n"), reg);
fc->ncols = 0;
}
void
-init_dwarf_regnames (unsigned int e_machine)
+init_dwarf_regnames_by_elf_machine_code (unsigned int e_machine)
{
switch (e_machine)
{
}
}
+/* Initialize the DWARF register name lookup state based on the
+ architecture and specific machine type of a BFD. */
+
+void
+init_dwarf_regnames_by_bfd_arch_and_mach (enum bfd_architecture arch,
+ unsigned long mach)
+{
+ switch (arch)
+ {
+ case bfd_arch_i386:
+ switch (mach)
+ {
+ case bfd_mach_x86_64:
+ case bfd_mach_x86_64_intel_syntax:
+ case bfd_mach_x86_64_nacl:
+ case bfd_mach_x64_32:
+ case bfd_mach_x64_32_intel_syntax:
+ case bfd_mach_x64_32_nacl:
+ init_dwarf_regnames_x86_64 ();
+ break;
+
+ default:
+ init_dwarf_regnames_i386 ();
+ break;
+ }
+ break;
+
+ case bfd_arch_iamcu:
+ init_dwarf_regnames_iamcu ();
+ break;
+
+ case bfd_arch_aarch64:
+ init_dwarf_regnames_aarch64();
+ break;
+
+ case bfd_arch_s390:
+ init_dwarf_regnames_s390 ();
+ break;
+
+ case bfd_arch_riscv:
+ init_dwarf_regnames_riscv ();
+ break;
+
+ default:
+ break;
+ }
+}
+
static const char *
regname (unsigned int regno, int row)
{