allow the user to ignore a rela section

If the user specifies KPATCH_IGNORE_SECTION for a rela section, ignore
the corresponding text section instead of corrupting memory.

Fixes #381.
This commit is contained in:
Josh Poimboeuf 2014-09-10 15:52:41 -05:00
parent c21cc1292f
commit 24ea032f9f

View File

@ -1673,6 +1673,8 @@ void kpatch_mark_ignored_sections(struct kpatch_elf *kelf)
if (!ignoresec)
ERROR("KPATCH_IGNORE_SECTION: can't find %s", name);
log_normal("ignoring section: %s\n", name);
if (is_rela_section(ignoresec))
ignoresec = ignoresec->base;
ignoresec->ignore = 1;
if (ignoresec->twin)
ignoresec->twin->ignore = 1;