diff --git a/libr/bin/p/bin_elf.c b/libr/bin/p/bin_elf.c index 5cf06df5e1..314f9ba65b 100644 --- a/libr/bin/p/bin_elf.c +++ b/libr/bin/p/bin_elf.c @@ -78,6 +78,17 @@ static RList* sections(RBinArch *arch) { r_list_append (ret, ptr); } free (section); + if (r_list_empty (ret)) { + if (!(ptr = R_NEW (RBinSection))) + return ret; + strncpy (ptr->name, "undefined", R_BIN_SIZEOF_STRINGS); + ptr->size = arch->size; + ptr->vsize = arch->size; + ptr->offset = 0; + ptr->rva = 0; + ptr->srwx = 7; + r_list_append (ret, ptr); + } return ret; }