create-diff-object: support .data..read_mostly and .data.unlikely

Support patching functions which uses these sections by converting
references to these sections to symbol object references.

Fixes #219.
This commit is contained in:
Josh Poimboeuf 2014-05-30 08:30:02 -05:00
parent 00e9dc3b1d
commit 4a95a16911

View File

@ -739,12 +739,14 @@ void kpatch_replace_sections_syms(struct kpatch_elf *kelf)
}
/*
* .data..percpu is a special data section whose data
* symbols aren't bundled with sections when using
* These are special data sections whose data symbols
* aren't bundled with sections when using
* -fdata-sections. We need to replace the section
* references with their corresponding objects.
*/
if (strcmp(rela->sym->name, ".data..percpu"))
if (strcmp(rela->sym->name, ".data..percpu") &&
strcmp(rela->sym->name, ".data..read_mostly") &&
strcmp(rela->sym->name, ".data.unlikely"))
continue;
list_for_each_entry(sym, &kelf->symbols, list) {