Certain debug sections like ".debug_aranges" when built with GCC 11.2.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.lagerw...@citrix.com>
---
 create-diff-object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/create-diff-object.c b/create-diff-object.c
index a516670..780e6c8 100644
--- a/create-diff-object.c
+++ b/create-diff-object.c
@@ -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;
                }
        }
-- 
2.31.1


Reply via email to