Skip to content

Commit

Permalink
create-diff-object: Check ELF headers earlier
Browse files Browse the repository at this point in the history
There is no point inspecting through the symbols of the ELF files
(original and patched) when the ELF headers do not meet requirements.

Check ELF headers as soon as the files are mapped.

Signed-off-by: Julien Thierry <jthierry@redhat.com>
  • Loading branch information
Julien Thierry committed Sep 17, 2019
1 parent debf44a commit 50476c9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kpatch-build/create-diff-object.c
Expand Up @@ -3412,16 +3412,16 @@ int main(int argc, char *argv[])
kelf_base = kpatch_elf_open(orig_obj);
kelf_patched = kpatch_elf_open(patched_obj);

kpatch_compare_elf_headers(kelf_base->elf, kelf_patched->elf);
kpatch_check_program_headers(kelf_base->elf);
kpatch_check_program_headers(kelf_patched->elf);

kpatch_bundle_symbols(kelf_base);
kpatch_bundle_symbols(kelf_patched);

kpatch_detect_child_functions(kelf_base);
kpatch_detect_child_functions(kelf_patched);

kpatch_compare_elf_headers(kelf_base->elf, kelf_patched->elf);
kpatch_check_program_headers(kelf_base->elf);
kpatch_check_program_headers(kelf_patched->elf);

list_for_each_entry(sym, &kelf_base->symbols, list) {
if (sym->type == STT_FILE) {
hint = strdup(sym->name);
Expand Down

0 comments on commit 50476c9

Please sign in to comment.