#define PRI_CU "CU 0x%" PRIx64
#define PRI_DIE "DIE 0x%" PRIx64
#define PRI_NOT_ENOUGH ": not enough data for %s.\n"
-#define PRI_LACK_RELOCATION ": seems to lack a relocation.\n"
+#define PRI_LACK_RELOCATION ": %s seems to lack a relocation.\n"
struct sec
{
/* Functions for checking of structural integrity. */
-static struct cu * check_debug_info_structural (struct section_data *data,
- struct abbrev_table *abbrev_chain,
- Elf_Data *strings);
+static struct cu * check_info_structural (struct section_data *data,
+ struct abbrev_table *abbrev_chain,
+ Elf_Data *strings);
static bool check_aranges_structural (struct section_data *data,
struct cu *cu_chain);
{
if (info_data.data != NULL)
{
- cu_chain = check_debug_info_structural (&info_data, abbrev_chain, str_data.data);
+ cu_chain = check_info_structural (&info_data, abbrev_chain, str_data.data);
if (cu_chain != NULL)
check_expected_trees (hlctx);
}
&addr, &where, sec_str, NULL);
else if (type_is_rel)
wr_message (mc_impact_2 | mc_die_other | mc_reloc | mc_strings,
- &where, PRI_LACK_RELOCATION);
+ &where, PRI_LACK_RELOCATION, "DW_FORM_strp");
if (strings == NULL)
wr_error (&where,
|| form == DW_FORM_ref_addr)
&& addr != 0)
wr_message (mc_impact_2 | mc_die_rel | mc_reloc, &where,
- PRI_LACK_RELOCATION);
+ PRI_LACK_RELOCATION, dwarf_form_string (form));
if (form == DW_FORM_ref_addr)
record_ref (addr, &where, false);
&& (check_locptr || check_rangeptr))
wr_message (mc_impact_2 | mc_die_other | mc_reloc
| (check_rangeptr ? mc_ranges : mc_loc),
- &where, PRI_LACK_RELOCATION);
+ &where, PRI_LACK_RELOCATION,
+ dwarf_form_string (form));
}
if (it->name == DW_AT_sibling)
&& (check_locptr || check_rangeptr))
wr_message (mc_impact_2 | mc_die_other | mc_reloc
| (check_rangeptr ? mc_ranges : mc_loc),
- &where, PRI_LACK_RELOCATION);
+ &where, PRI_LACK_RELOCATION,
+ dwarf_form_string (form));
}
if (it->name == DW_AT_sibling)
&abbrev_offset, &cu->where, sec_abbrev, NULL);
else if (file->ehdr.e_type == ET_REL)
wr_message (mc_impact_2 | mc_info | mc_reloc, &cu->where,
- PRI_LACK_RELOCATION);
+ PRI_LACK_RELOCATION, "abbrev offset");
/* Address size. */
if (!read_ctx_read_ubyte (ctx, &address_size))
}
static struct cu *
-check_debug_info_structural (struct section_data *data,
- struct abbrev_table *abbrev_chain,
- Elf_Data *strings)
+check_info_structural (struct section_data *data,
+ struct abbrev_table *abbrev_chain,
+ Elf_Data *strings)
{
struct read_ctx ctx;
read_ctx_init (&ctx, data->file->dwarf, data->data);
&cu_offset, &where, sec_info, NULL);
else if (data->file->ehdr.e_type == ET_REL)
wr_message (mc_impact_2 | mc_aranges | mc_reloc, &where,
- PRI_LACK_RELOCATION);
+ PRI_LACK_RELOCATION, "debug info offset");
struct cu *cu = NULL;
if (cu_chain != NULL && (cu = cu_find_cu (cu_chain, cu_offset)) == NULL)
else if (data->file->ehdr.e_type == ET_REL
&& address != 0)
wr_message (mc_impact_2 | mc_aranges | mc_reloc, &where,
- PRI_LACK_RELOCATION);
+ PRI_LACK_RELOCATION, "address field");
/* Record length. */
uint64_t length;
&cu_offset, &where, sec_info, NULL);
else if (data->file->ehdr.e_type == ET_REL)
wr_message (mc_impact_2 | mc_pubtables | mc_reloc, &where,
- PRI_LACK_RELOCATION);
+ PRI_LACK_RELOCATION, "debug info offset");
struct cu *cu = NULL;
enum section_id sec = data_get_sec (data)->id;
&addr, &where, sec_text, NULL);
else
wr_message (mc_impact_2 | mc_line | mc_reloc, &where,
- PRI_LACK_RELOCATION);
+ PRI_LACK_RELOCATION, "DW_LNE_set_address");
break;
}
}
/* XXX overlaps in defined addresses are probably OK, one
- instruction can be derived from several statements. */
+ instruction can be derived from several statements. But
+ certain flags in table should be consistent in that case,
+ namely is_stmt, basic_block, end_sequence, prologue_end,
+ epilogue_begin, isa. */
next:
if (!read_ctx_skip (&ctx, size))