1
0
mirror of https://github.com/dynup/kpatch synced 2025-03-10 04:37:57 +00:00

Merge pull request from spartacus06/ignore-init-funcs

ignore init functions during bundling
This commit is contained in:
Josh Poimboeuf 2014-03-21 15:19:54 -05:00
commit 8dfa41ed78

View File

@ -379,10 +379,15 @@ void kpatch_create_symbol_table(struct kpatch_elf *kelf)
* to offsets inside the __ksymtab_strings section
* for kernel exported symbols. We want to ignore
* those.
*
* Also, functions declared with __init do not honor
* -ffunction-sections and can be at non-zero offsets
* in the .init.text section, so ignore those.
*/
if ((sym->type == STT_FUNC ||
sym->type == STT_OBJECT) &&
strcmp(sym->sec->name, "__ksymtab_strings")) {
strcmp(sym->sec->name, "__ksymtab_strings") &&
strcmp(sym->sec->name, ".init.text")) {
if (sym->sym.st_value != 0)
ERROR("symbol %s at offset %lu within section %s, expected 0",
sym->name, sym->sym.st_value, sym->sec->name);