livepatch: annotate klp_init() with __init
PATCH v2 1/1 livepatch: annotate klp_init() with __init
Usually we prefer to let compiler put the module initialized function to section ".init.text". Thus this text in memory will be freed in future.
Once we add the "__init" preceding function name, we can use following command to find it in specfied section.
$ objdump -t -j .init.text built-in.o
built-in.o: file format elf64-x86-64
SYMBOL TABLE:
0000000000000000 l d .init.text 0000000000000000 .init.text
0000000000000000 l F .init.text 000000000000004e klp_init
---
v1:
- modify the subject to make it more concise
--- kernel/livepatch/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/livepatch/core.c +1 -1
@@ -973,7 +973,7 @@ static struct notifier_block klp_module_nb = { .priority = INT_MIN+1, /* called late but before ftrace notifier */ }; -static int klp_init (void ) +static int __init klp_init (void ) {int ret;
Signature · 1 line
2.2.2
Quoted 10 lines · Minfei Huang
Usually we prefer to let compiler put the module initialized function to section ".init.text". Thus this text in memory will be freed in future.
Once we add the "
__init" preceding function name, we can use following command to find it in specfied section.$ objdump -t -j .init.text built-in.obuilt-in.o: file format elf64-x86-64
Quoted 8 lines
SYMBOL TABLE:
0000000000000000 l d .init.text 0000000000000000 .init.text
0000000000000000 l F .init.text000000000000004eklp_initSigned-off-by Minfei Huang <[email protected]>---
v1:
- modify the subject to make it more concise
Thanks!
Signature · 1 line
Josh
Quoted 8 lines · Minfei Huang
Usually we prefer to let compiler put the module initialized function to section ".init.text". Thus this text in memory will be freed in future.
Once we add the "
__init" preceding function name, we can use following command to find it in specfied section.$ objdump -t -j .init.text built-in.o
Quoted 7 lines
built-in.o: file format elf64-x86-64
SYMBOL TABLE:
0000000000000000 l d .init.text 0000000000000000 .init.text
0000000000000000 l F .init.text000000000000004eklp_initSigned-off-by Minfei Huang <[email protected]>
I think this changelog is way too verbose for no good reason (this is probably the first time in my life I am saying something like that :) ).
There is really no need to explain how to use objdump in changelog. I've shortened the changelog and applied.
Thanks,
Signature · 2 lines
Jiri Kosina SUSE Labs