BTW, I thought of another corner case which I think will break
offset-resuming in dwarf_getfuncs: DW_AT_import+DW_FORM_GNU_ref_alt.
The die offsets from the main file and alt file will almost surely
overlap, and if you happen to have a subprogram at the same offset in
both, then it's not possible to tell which one to resume on.
Must the offsets used by dwarf_getfuncs be die offsets? After all, they
are type ptrdiff_t, not Dwarf_Off. This particular problem might be
solved by instead using die->addr for the "offset" value.