Skip to content

Comments

support patching weak function#507

Closed
libin2015 wants to merge 2 commits intodynup:masterfrom
libin2015:support-weak-function
Closed

support patching weak function#507
libin2015 wants to merge 2 commits intodynup:masterfrom
libin2015:support-weak-function

Conversation

@libin2015
Copy link
Contributor

No description provided.

If the changed function reference the weak symbol, when loading
the patch module will trigger the following error:
module kpatch-***: overflow in relocation type *** val 0
insmod: can't insert 'kpatch-***.ko': invalid module format
This patch fix it.

Signed-off-by: Li Bin <huawei.libin@huawei.com>
Before this patch, if changed function is weak symbol, it is not
be allowed to create live patch, and it will trigger the following
error:
/usr/local/libexec/kpatch/create-diff-object: ERROR: ***.o:
kpatch_create_patches_sections: 2294: lookup_global_symbol ***
This patch add support for patching weak function.

Signed-off-by: Li Bin <huawei.libin@huawei.com>
@jpoimboe
Copy link
Member

Instead of creating a new lookup_weak_global_symbol() function, how about just adding the WEAK check to lookup_global_symbol()?

@libin2015
Copy link
Contributor Author

Yes, if the two patch is exactly correct, and can be merged together, we can just adding the WEAK check to lookup_global_symbol. Thanks.

@jpoimboe
Copy link
Member

Yes, otherwise it looks right to me, so if you can rebase them into a single commit with the change to lookup_global_symbol, I'll give it a 👍 . Thanks for the fix!

@libin2015
Copy link
Contributor Author

OK, I will do it and create a new pull request. Thanks.

@libin2015 libin2015 force-pushed the support-weak-function branch 2 times, most recently from 42a763c to 795de31 Compare October 16, 2015 05:20
@jpoimboe
Copy link
Member

Continued with #508. (next time, please rebase and force push the existing branch instead of opening a new pull request)

@jpoimboe jpoimboe closed this Oct 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants