return;
}
- Elf_Data *data = dbg->sectiondata[IDX_debug_aranges];
+ Elf_Data *data = (dbg->sectiondata[IDX_debug_aranges]
+ ?: elf_rawdata (scn, NULL));
if (unlikely (data == NULL))
{
Elf_Scn *scn, GElf_Shdr *shdr,
Dwarf *dbg)
{
- Elf_Data *data = dbg->sectiondata[IDX_debug_ranges];
-
+ Elf_Data *data = (dbg->sectiondata[IDX_debug_ranges]
+ ?: elf_rawdata (scn, NULL));
if (unlikely (data == NULL))
{
error (0, 0, gettext ("cannot get .debug_ranges content: %s"),
bool is_eh_frame = strcmp (scnname, ".eh_frame") == 0;
Elf_Data *data = (is_eh_frame
? elf_rawdata (scn, NULL)
- : dbg->sectiondata[IDX_debug_frame]);
+ : (dbg->sectiondata[IDX_debug_frame]
+ ?: elf_rawdata (scn, NULL)));
if (unlikely (data == NULL))
{
/* There is no functionality in libdw to read the information in the
way it is represented here. Hardcode the decoder. */
- Elf_Data *data = dbg->sectiondata[IDX_debug_line];
- if (unlikely (data == NULL || data->d_buf == NULL))
+ Elf_Data *data = (dbg->sectiondata[IDX_debug_line]
+ ?: elf_rawdata (scn, NULL));
+ if (unlikely (data == NULL))
{
error (0, 0, gettext ("cannot get line data section data: %s"),
elf_errmsg (-1));
Ebl *ebl, GElf_Ehdr *ehdr,
Elf_Scn *scn, GElf_Shdr *shdr, Dwarf *dbg)
{
- Elf_Data *data = dbg->sectiondata[IDX_debug_loc];
+ Elf_Data *data = (dbg->sectiondata[IDX_debug_loc]
+ ?: elf_rawdata (scn, NULL));
if (unlikely (data == NULL))
{
/* There is no function in libdw to iterate over the raw content of
the section but it is easy enough to do. */
- Elf_Data *data = dbg->sectiondata[IDX_debug_macinfo];
- if (unlikely (data == NULL || data->d_buf == NULL))
+ Elf_Data *data = (dbg->sectiondata[IDX_debug_macinfo]
+ ?: elf_rawdata (scn, NULL));
+ if (unlikely (data == NULL))
{
error (0, 0, gettext ("cannot get macro information section data: %s"),
elf_errmsg (-1));
(uint64_t) shdr->sh_offset);
putc_unlocked ('\n', stdout);
- Elf_Data *data = dbg->sectiondata[IDX_debug_macro];
- if (unlikely (data == NULL || data->d_buf == NULL))
+ Elf_Data *data = (dbg->sectiondata[IDX_debug_macro]
+ ?: elf_rawdata (scn, NULL));
+ if (unlikely (data == NULL))
{
error (0, 0, gettext ("cannot get macro information section data: %s"),
elf_errmsg (-1));