debugedit: Do not 'edit_dwarf2' when just extracting build-id

No need to call edit_dwarf2() if debugedit is invoked just to extract
build-id (with `-i -n'). Otherwise, we will get `DWARF version 0
unhandled' warning for compressed .debug files:

  /usr/lib/rpm/debugedit: ./usr/lib/debug/...e.ko.debug: DWARF version 0 unhandled

Context: We have kernel modules elfcompressed in ALT.
This commit is contained in:
Vitaly Chikunov 2020-11-14 18:14:28 +03:00 committed by Panu Matilainen
parent 1110c28063
commit e526a0af17
1 changed files with 2 additions and 1 deletions

View File

@ -2865,7 +2865,8 @@ main (int argc, char *argv[])
fprintf (stderr, "Stabs debuginfo not supported: %s\n", file);
break;
}
if (strcmp (name, ".debug_info") == 0)
if (!(do_build_id && no_recompute_build_id && !base_dir && !dest_dir)
&& strcmp (name, ".debug_info") == 0)
edit_dwarf2 (dso);
break;