All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kbuild: modpost: Warn about references from rodata to __init text
@ 2017-06-30 22:58 ` Stephen Boyd
  0 siblings, 0 replies; 19+ messages in thread
From: Stephen Boyd @ 2017-06-30 22:58 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek
  Cc: linux-kernel, linux-arm-msm, linux-arm-kernel, linux-kbuild,
	Rob Clark, Bjorn Andersson

If we have a structure that's marked const it will be placed
into the .rodata section but it could reference an init section
function. Include the read only data section in the check we have
for read/write data sections referencing init sections so we can
find this class of problems. This exposes quite a few places
where const marked structures are referencing __init functions and
__init data that we were previously ignoring.

Cc: Rob Clark <robdclark@gmail.com>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---

Making this change leads to quite a few other errors even on the
multi_v7_defconfig for ARM[1]. I still need to do a build of the
allmodconfig to see how many other errors there, but it seems to
be quite a few. I suppose those will need to be fixed before we can
merge this?

[1] https://www.irccloud.com/pastebin/zzqfWGQY/

 scripts/mod/modpost.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 48397feb08fb..4f2be5c6727d 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -903,7 +903,7 @@ static void check_section(const char *modname, struct elf_info *elf,
 #define ALL_INIT_SECTIONS INIT_SECTIONS, ALL_XXXINIT_SECTIONS
 #define ALL_EXIT_SECTIONS EXIT_SECTIONS, ALL_XXXEXIT_SECTIONS
 
-#define DATA_SECTIONS ".data", ".data.rel"
+#define DATA_SECTIONS ".rodata", ".data", ".data.rel"
 #define TEXT_SECTIONS ".text", ".text.unlikely", ".sched.text", \
 		".kprobes.text", ".cpuidle.text"
 #define OTHER_TEXT_SECTIONS ".ref.text", ".head.text", ".spinlock.text", \
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2017-07-21 15:59 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-30 22:58 [PATCH] kbuild: modpost: Warn about references from rodata to __init text Stephen Boyd
2017-06-30 22:58 ` Stephen Boyd
2017-06-30 23:59 ` Rob Clark
2017-06-30 23:59   ` Rob Clark
2017-06-30 23:59   ` Rob Clark
2017-07-20 14:28   ` Masahiro Yamada
2017-07-20 14:28     ` Masahiro Yamada
2017-07-20 14:28     ` Masahiro Yamada
2017-07-20 17:52     ` Stephen Boyd
2017-07-20 17:52       ` Stephen Boyd
2017-07-20 17:52       ` Stephen Boyd
2017-07-21 15:57       ` Masahiro Yamada
2017-07-21 15:57         ` Masahiro Yamada
2017-07-21 15:57         ` Masahiro Yamada
2017-07-21 15:57         ` Masahiro Yamada
2017-07-02  1:35 ` kbuild test robot
2017-07-02  1:35   ` kbuild test robot
2017-07-18 18:38 ` Masahiro Yamada
2017-07-18 18:38   ` Masahiro Yamada

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.