Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756896AbbEVO0j (ORCPT ); Fri, 22 May 2015 10:26:39 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:36122 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756233AbbEVO0h (ORCPT ); Fri, 22 May 2015 10:26:37 -0400 From: Minfei Huang 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 Subject: [Patch v2] livepatch: annotate klp_init() with __init Date: Fri, 22 May 2015 22:26:29 +0800 Message-Id: <1432304789-6324-1-git-send-email-mnfhuang@gmail.com> X-Mailer: git-send-email 2.2.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1305 Lines: 43 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 --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/