* [PATCH] livepatch: Let compiler put module initialized function to section ".init.text"
@ 2015-05-22 6:10 Minfei Huang
2015-05-22 13:25 ` Josh Poimboeuf
0 siblings, 1 reply; 3+ messages in thread
From: Minfei Huang @ 2015-05-22 6:10 UTC (permalink / raw)
To: jpoimboe, sjenning, jkosina, vojtech
Cc: live-patching, linux-kernel, Minfei Huang
From: Minfei Huang <mnfhuang@gmail.com>
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
Signed-off-by: Minfei Huang <mnfhuang@gmail.com>
---
kernel/livepatch/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c
index 284e269..86e40b9 100644
--- a/kernel/livepatch/core.c
+++ b/kernel/livepatch/core.c
@@ -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;
--
2.2.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] livepatch: Let compiler put module initialized function to section ".init.text"
2015-05-22 6:10 [PATCH] livepatch: Let compiler put module initialized function to section ".init.text" Minfei Huang
@ 2015-05-22 13:25 ` Josh Poimboeuf
2015-05-22 14:03 ` Minfei Huang
0 siblings, 1 reply; 3+ messages in thread
From: Josh Poimboeuf @ 2015-05-22 13:25 UTC (permalink / raw)
To: Minfei Huang
Cc: sjenning, jkosina, vojtech, live-patching, linux-kernel,
Minfei Huang
On Fri, May 22, 2015 at 02:10:32PM +0800, Minfei Huang wrote:
> From: Minfei Huang <mnfhuang@gmail.com>
>
> 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
>
> Signed-off-by: Minfei Huang <mnfhuang@gmail.com>
The patch looks good but can you make the subject more concise? Maybe
something like:
livepatch: annotate klp_init() with __init
Thanks.
--
Josh
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] livepatch: Let compiler put module initialized function to section ".init.text"
2015-05-22 13:25 ` Josh Poimboeuf
@ 2015-05-22 14:03 ` Minfei Huang
0 siblings, 0 replies; 3+ messages in thread
From: Minfei Huang @ 2015-05-22 14:03 UTC (permalink / raw)
To: Josh Poimboeuf
Cc: Minfei Huang, sjenning, jkosina, vojtech, live-patching,
linux-kernel
On 05/22/15 at 08:25P, Josh Poimboeuf wrote:
> On Fri, May 22, 2015 at 02:10:32PM +0800, Minfei Huang wrote:
> > From: Minfei Huang <mnfhuang@gmail.com>
> >
> > 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
> >
> > Signed-off-by: Minfei Huang <mnfhuang@gmail.com>
>
> The patch looks good but can you make the subject more concise? Maybe
> something like:
>
> livepatch: annotate klp_init() with __init
Sure. Will modify the subject.
Thanks
Minfei
>
> Thanks.
>
> --
> Josh
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-05-22 14:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-22 6:10 [PATCH] livepatch: Let compiler put module initialized function to section ".init.text" Minfei Huang
2015-05-22 13:25 ` Josh Poimboeuf
2015-05-22 14:03 ` Minfei Huang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.