]> xenbits.xensource.com Git - livepatch-build-tools.git/commitdiff
create-diff-object: Handle missing secsym for debug sections
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Wed, 8 Feb 2023 17:50:14 +0000 (17:50 +0000)
committerRoss Lagerwall <ross.lagerwall@citrix.com>
Thu, 16 Feb 2023 12:00:30 +0000 (12:00 +0000)
Certain debug sections like ".debug_aranges" when built with GAS 2.36.1
are missing section symbols (presumably because they're not needed).
Instead, of segfaulting, simply don't include them if they're missing.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
create-diff-object.c

index a5166701d43089c2a78a9e25f1a771cb47baeb6e..780e6c8e65567f9fa00cca304b70ecb3d21590fe 100644 (file)
@@ -1484,7 +1484,7 @@ static void kpatch_include_debug_sections(struct kpatch_elf *kelf)
        list_for_each_entry(sec, &kelf->sections, list) {
                if (is_debug_section(sec)) {
                        sec->include = 1;
-                       if (!is_rela_section(sec))
+                       if (!is_rela_section(sec) && sec->secsym)
                                sec->secsym->include = 1;
                }
        }