diff options
| author | Sam Ravnborg <sam@ravnborg.org> | 2008-01-21 15:31:44 -0500 |
|---|---|---|
| committer | Sam Ravnborg <sam@ravnborg.org> | 2008-01-28 17:21:18 -0500 |
| commit | 91341d4b2c196c689acf90e9e96f28f8d5c6665f (patch) | |
| tree | b4676097b6a3fe4f5e9d420ba9d9956bb883e506 /lib | |
| parent | eb8f689046b857874e964463619f09df06d59fad (diff) | |
kbuild: introduce new option to enhance section mismatch analysis
Setting the option DEBUG_SECTION_MISMATCH will
report additional section mismatch'es but this
should in the end makes it possible to get rid of
all of them.
See help text in lib/Kconfig.debug for details.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Kconfig.debug | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 14fb355e3caa..748e72be6e68 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
| @@ -79,6 +79,36 @@ config HEADERS_CHECK | |||
| 79 | exported to $(INSTALL_HDR_PATH) (usually 'usr/include' in | 79 | exported to $(INSTALL_HDR_PATH) (usually 'usr/include' in |
| 80 | your build tree), to make sure they're suitable. | 80 | your build tree), to make sure they're suitable. |
| 81 | 81 | ||
| 82 | config DEBUG_SECTION_MISMATCH | ||
| 83 | bool "Enable full Section mismatch analysis" | ||
| 84 | default n | ||
| 85 | help | ||
| 86 | The section mismatch analysis checks if there are illegal | ||
| 87 | references from one section to another section. | ||
| 88 | Linux will during link or during runtime drop some sections | ||
| 89 | and any use of code/data previously in these sections will | ||
| 90 | most likely result in an oops. | ||
| 91 | In the code functions and variables are annotated with | ||
| 92 | __init, __devinit etc. (see full list in include/linux/init.h) | ||
| 93 | which result in the code/data being placed in specific sections. | ||
| 94 | The section mismatch anaylsis are always done after a full | ||
| 95 | kernel build but enabling this options will in addition | ||
| 96 | do the following: | ||
| 97 | - Add the option -fno-inline-functions-called-once to gcc | ||
| 98 | When inlining a function annotated __init in a non-init | ||
| 99 | function we would loose the section information and thus | ||
| 100 | the analysis would not catch the illegal reference. | ||
| 101 | This options tell gcc to inline less but will also | ||
| 102 | result in a larger kernel. | ||
| 103 | - Run the section mismatch analysis for each module/built-in.o | ||
| 104 | When we run the section mismatch analysis on vmlinux.o we | ||
| 105 | looses valueable information about where the mismatch was | ||
| 106 | introduced. | ||
| 107 | Running the analysis for each module/built-in.o file | ||
| 108 | will tell where the mismatch happens much closer to the | ||
| 109 | source. The drawback is that we will report the same | ||
| 110 | mismatch at least twice. | ||
| 111 | |||
| 82 | config DEBUG_KERNEL | 112 | config DEBUG_KERNEL |
| 83 | bool "Kernel debugging" | 113 | bool "Kernel debugging" |
| 84 | help | 114 | help |
