public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Minfei Huang <mnfhuang@gmail.com>
To: jpoimboe@redhat.com, sjenning@redhat.com, jkosina@suse.cz,
	vojtech@suse.cz
Cc: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org,
	mhuang@redhat.com, Minfei Huang <mnfhuang@gmail.com>
Subject: [Patch v2] livepatch: annotate klp_init() with __init
Date: Fri, 22 May 2015 22:26:29 +0800	[thread overview]
Message-ID: <1432304789-6324-1-git-send-email-mnfhuang@gmail.com> (raw)

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>
---
v1:
- modify the subject to make it more concise
---
 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


             reply	other threads:[~2015-05-22 14:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-22 14:26 Minfei Huang [this message]
2015-05-22 14:35 ` [Patch v2] livepatch: annotate klp_init() with __init Josh Poimboeuf
2015-05-25 15:18 ` Jiri Kosina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1432304789-6324-1-git-send-email-mnfhuang@gmail.com \
    --to=mnfhuang@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mhuang@redhat.com \
    --cc=sjenning@redhat.com \
    --cc=vojtech@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox