kpatch-build: include secsym in kpatch_mark_ignored_sections

kpatch_mark_ignored_sections include .rodata.str1.1 section but does
not include its section symbol, causing its section symbol can not be
included any more in kpatch_include_standard_elements. After the
section symbol is freed in kpatch_elf_teardown, we got a segmentation
fault in kpatch_create_intermediate_sections.

Signed-off-by: Zhipeng Xie <xiezhipeng1@huawei.com>
This commit is contained in:
Zhipeng Xie 2018-11-22 21:06:32 +00:00 committed by x00292102
parent f06f65666a
commit 517e26a6cb

View File

@ -2246,6 +2246,7 @@ static void kpatch_mark_ignored_sections(struct kpatch_elf *kelf)
* from the section data comparison, but this is a simpler way.
*/
strsec->include = 1;
strsec->secsym->include = 1;
name = strsec->data->d_buf + rela->addend;
ignoresec = find_section_by_name(&kelf->sections, name);
if (!ignoresec)