static bool
read_size_extra (struct read_ctx *ctx, uint32_t size32, uint64_t *sizep,
- bool *dwarf_64p, struct where *wh)
+ bool *dwarf_64p, struct where *wh)
{
if (size32 == DWARF3_LENGTH_64_BIT)
{
/* Skip all the remaining relocations. */
static void
-relocation_skip_rest (struct relocation_data *reloc, enum section_id sec)
+relocation_skip_rest (struct section_data *data)
{
- if (reloc != NULL && reloc->rel != NULL)
- relocation_next (reloc, (uint64_t)-1, &WHERE (sec, NULL), skip_mismatched);
+ if (data->rel.rel != NULL)
+ relocation_next (&data->rel, (uint64_t)-1, &WHERE_SECDATA (data, NULL),
+ skip_mismatched);
}
/* SYMPTR may be NULL, otherwise (**SYMPTR) has to yield valid memory
struct read_ctx cu_ctx;
if (!read_ctx_init_sub (&cu_ctx, &ctx, cu_begin, cu_end))
{
+ not_enough:
wr_error (&where, PRI_NOT_ENOUGH, "next CU");
success = false;
break;
read_ctx_get_offset (&ctx), size);
}
- ctx.ptr += size;
+ if (!read_ctx_skip (&ctx, size))
+ goto not_enough;
}
if (success)
": CU lengths don't exactly match Elf_Data contents.");
else
/* Did we consume all the relocations? */
- relocation_skip_rest (&data->rel, sec_info);
+ relocation_skip_rest (data);
}
const unsigned char *set_end = ctx.ptr + size;
if (!read_ctx_init_sub (&sub_ctx, &ctx, set_begin, set_end))
{
+ not_enough:
wr_error (&where, PRI_NOT_ENOUGH, "next set");
return false;
}
}
next:
- ctx.ptr += size;
+ if (!read_ctx_skip (&ctx, size))
+ goto not_enough;
}
if (retval)
- relocation_skip_rest (&data->rel, sec_pubnames);
+ relocation_skip_rest (data);
return retval;
}
if (retval)
{
- relocation_skip_rest (&data->rel, sec);
+ relocation_skip_rest (data);
/* We check that all CUs have the same address size when building
the CU chain. So just take the address size of the first CU in