!strncmp(sec->name, ".rodata", 7);
}
+int is_init_section(struct section *sec)
+{
+ return sec->sh.sh_type == SHT_PROGBITS &&
+ (sec->sh.sh_flags & SHF_ALLOC) &&
+ !strncmp(sec->name, ".init", 5);
+}
+
int is_debug_section(struct section *sec)
{
char *name;
int is_text_section(struct section *sec);
int is_rodata_section(struct section *sec);
+int is_init_section(struct section *sec);
int is_debug_section(struct section *sec);
int is_rela_section(struct section *sec);
int is_standard_section(struct section *sec);
}
}
+static void livepatch_ignore_init_sections(struct kpatch_elf *kelf)
+{
+ struct section *sec;
+
+ list_for_each_entry(sec, &kelf->sections, list) {
+ if (is_init_section(sec)) {
+ log_normal("WARNING: Explicitly ignoring .init section: %s\n",
+ sec->name);
+ sec->ignore = 1;
+ }
+ }
+}
+
static void kpatch_mark_ignored_sections(struct kpatch_elf *kelf)
{
struct section *sec, *strsec, *ignoresec;
* We access its sections via the twin pointers in the
* section, symbol, and rela lists of kelf_patched.
*/
+ log_debug("Ignore .init sections\n");
+ livepatch_ignore_init_sections(kelf_patched);
log_debug("Mark ignored sections\n");
kpatch_mark_ignored_sections(kelf_patched);
log_debug("Compare correlated elements\n");