1. 14 8月, 2019 1 次提交
  2. 10 8月, 2019 1 次提交
  3. 31 7月, 2019 4 次提交
  4. 18 7月, 2019 2 次提交
    • M
      kbuild: create *.mod with full directory path and remove MODVERDIR · b7dca6dd
      Masahiro Yamada 提交于
      While descending directories, Kbuild produces objects for modules,
      but do not link final *.ko files; it is done in the modpost.
      
      To keep track of modules, Kbuild creates a *.mod file in $(MODVERDIR)
      for every module it is building. Some post-processing steps read the
      necessary information from *.mod files. This avoids descending into
      directories again. This mechanism was introduced in 2003 or so.
      
      Later, commit 551559e1 ("kbuild: implement modules.order") added
      modules.order. So, we can simply read it out to know all the modules
      with directory paths. This is easier than parsing the first line of
      *.mod files.
      
      $(MODVERDIR) has a flat directory structure, that is, *.mod files
      are named only with base names. This is based on the assumption that
      the module name is unique across the tree. This assumption is really
      fragile.
      
      Stephen Rothwell reported a race condition caused by a module name
      conflict:
      
        https://lkml.org/lkml/2019/5/13/991
      
      In parallel building, two different threads could write to the same
      $(MODVERDIR)/*.mod simultaneously.
      
      Non-unique module names are the source of all kind of troubles, hence
      commit 3a48a919 ("kbuild: check uniqueness of module names")
      introduced a new checker script.
      
      However, it is still fragile in the build system point of view because
      this race happens before scripts/modules-check.sh is invoked. If it
      happens again, the modpost will emit unclear error messages.
      
      To fix this issue completely, create *.mod with full directory path
      so that two threads never attempt to write to the same file.
      
      $(MODVERDIR) is no longer needed.
      
      Since modules with directory paths are listed in modules.order, Kbuild
      is still able to find *.mod files without additional descending.
      
      I also killed cmd_secanalysis; scripts/mod/sumversion.c computes MD4 hash
      for modules with MODULE_VERSION(). When CONFIG_DEBUG_SECTION_MISMATCH=y,
      it occurs not only in the modpost stage, but also during directory
      descending, where sumversion.c may parse stale *.mod files. It would emit
      'No such file or directory' warning when an object consisting a module is
      renamed, or when a single-obj module is turned into a multi-obj module or
      vice versa.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: NNicolas Pitre <nico@fluxnic.net>
      b7dca6dd
    • M
      kbuild: modpost: read modules.order instead of $(MODVERDIR)/*.mod · ff9b45c5
      Masahiro Yamada 提交于
      Towards the goal of removing MODVERDIR, read out modules.order to get
      the list of modules to be processed. This is simpler than parsing *.mod
      files in $(MODVERDIR).
      
      For external modules, $(KBUILD_EXTMOD)/modules.order should be read.
      
      I removed the single target %.ko from the top Makefile. To make sure
      modpost works correctly, vmlinux and the other modules must be built.
      You cannot build a particular .ko file alone.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      ff9b45c5
  5. 11 4月, 2019 1 次提交
    • W
      modpost: make KBUILD_MODPOST_WARN also configurable for external modules · 83da1bed
      Wiebe, Wladislav (Nokia - DE/Ulm) 提交于
      Commit ea837f1c ("kbuild: make modpost processing configurable")
      was intended to give KBUILD_MODPOST_WARN flexibility to be configurable.
      Right now KBUILD_MODPOST_WARN gets just ignored when KBUILD_EXTMOD is
      set which happens per default when building modules out of the tree.
      
      This change gives the opportunity to define module build behaving also
      in case of out of tree builds and default will become exit on error.
      Errors which can be detected by the build should be trapped out of the box
      there, unless somebody wants to notice broken stuff later at runtime.
      
      As this patch changes the default behaving from warning to error,
      users can consider to fix it for external module builds by:
      - providing module symbol table via KBUILD_EXTRA_SYMBOLS for
        modules which are dependent
      - OR getting old behaving back by passing KBUILD_MODPOST_WARN to the build
      Signed-off-by: NWladislav Wiebe <wladislav.wiebe@nokia.com>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      83da1bed
  6. 14 3月, 2019 1 次提交
  7. 28 1月, 2019 1 次提交
    • M
      kbuild: add real-prereqs shorthand for $(filter-out FORCE,$^) · afa974b7
      Masahiro Yamada 提交于
      In Kbuild, if_changed and friends must have FORCE as a prerequisite.
      
      Hence, $(filter-out FORCE,$^) or $(filter-out $(PHONY),$^) is a common
      idiom to get the names of all the prerequisites except phony targets.
      
      Add real-prereqs as a shorthand.
      
      Note:
      We cannot replace $(filter %.o,$^) in cmd_link_multi-m because $^ may
      include auto-generated dependencies from the .*.cmd file when a single
      object module is changed into a multi object module. Refer to commit
      69ea912f ("kbuild: remove unneeded link_multi_deps"). I added some
      comment to avoid accidental breakage.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: NRob Herring <robh@kernel.org>
      afa974b7
  8. 24 8月, 2018 1 次提交
  9. 06 7月, 2018 1 次提交
  10. 16 11月, 2017 1 次提交
  11. 02 11月, 2017 1 次提交
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  12. 07 10月, 2017 1 次提交
  13. 09 9月, 2016 1 次提交
  14. 06 10月, 2015 1 次提交
  15. 23 9月, 2013 1 次提交
    • G
      modpost: Optionally ignore secondary errors seen if a single module build fails · eed380f3
      Guenter Roeck 提交于
      Commit ea4054a2 (modpost: handle huge numbers of modules) added
      support for building a large number of modules.
      
      Unfortunately, the commit changed the semantics of the makefile: Instead of
      passing only existing object files to modpost, make now passes all expected
      object files. If make was started with option -i, this results in a modpost
      error if a single file failed to build.
      
      Example with the current btrfs build falure on m68k:
      
      fs/btrfs/btrfs.o: No such file or directory
      make[1]: [__modpost] Error 1 (ignored)
      
      This error is followed by lots of errors such as:
      
      m68k-linux-gcc: error: arch/m68k/emu/nfcon.mod.c: No such file or directory
      m68k-linux-gcc: fatal error: no input files
      compilation terminated.
      make[1]: [arch/m68k/emu/nfcon.mod.o] Error 1 (ignored)
      
      This doesn't matter much for normal builds, but it is annoying for builds
      started with "make -i" due to the large number of secondary errors.
      Those errors unnececessarily clog any error log and make it difficult
      to find the real errors in the build.
      
      Fix the problem by adding a new parameter '-n' to modpost. If this parameter
      is specified, modpost reports but ignores missing object files.
      
      With this patch, error output from above problem is (with make -i):
      
      m68k-linux-ld: cannot find fs/btrfs/ioctl.o: No such file or directory
      make[2]: [fs/btrfs/btrfs.o] Error 1 (ignored)
      ...
      fs/btrfs/btrfs.o: No such file or directory (ignored)
      
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Michael Marek <mmarek@suse.cz>
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      eed380f3
  16. 05 4月, 2013 1 次提交
    • R
      modpost: handle huge numbers of modules. · ea4054a2
      Rusty Russell 提交于
      strace shows:
      72102 execve("/bin/sh", ["/bin/sh", "-c", "echo '  scripts/mod/modpost -m -a
      -o /cc/wfg/sound-compiletest/Module.symvers      -s'; scripts/
      mod/modpost -m -a -o /cc/wfg/sound-compiletest/Module.symvers      -s vmlinux
      arch/x86/crypto/ablk_helper.o arch/x86/crypto/aes-i586.o arch
      /x86/crypto/aesni-intel.o arch/x86/crypto/crc32-pclmul.o
      ...
      drivers/ata/sata_promise.o "...], [/* 119 vars */] <unfinished ...>
      71827 wait4(-1,  <unfinished ...>
      72102 <... execve resumed> )            = -1 E2BIG (Argument list too long)
      
      So we re-run the shell command which produces the list and feed it into modpost -T -.
      Reported-by: NFengguang Wu <fengguang.wu@intel.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      ea4054a2
  17. 25 1月, 2013 1 次提交
  18. 19 10月, 2012 1 次提交
  19. 10 10月, 2012 1 次提交
    • D
      MODSIGN: Sign modules during the build process · 80d65e58
      David Howells 提交于
      If CONFIG_MODULE_SIG is set, then this patch will cause all modules files to
      to have signatures added.  The following steps will occur:
      
       (1) The module will be linked to foo.ko.unsigned instead of foo.ko
      
       (2) The module will be stripped using both "strip -x -g" and "eu-strip" to
           ensure minimal size for inclusion in an initramfs.
      
       (3) The signature will be generated on the stripped module.
      
       (4) The signature will be appended to the module, along with some information
           about the signature and a magic string that indicates the presence of the
           signature.
      
      Step (3) requires private and public keys to be available.  By default these
      are expected to be found in files:
      
      	signing_key.priv
      	signing_key.x509
      
      in the base directory of the build.  The first is the private key in PEM form
      and the second is the X.509 certificate in DER form as can be generated from
      openssl:
      
      	openssl req \
      		-new -x509 -outform PEM -out signing_key.x509 \
      		-keyout signing_key.priv -nodes \
      		-subj "/CN=H2G2/O=Magrathea/CN=Slartibartfast"
      
      If the secret key is not found then signing will be skipped and the unsigned
      module from (1) will just be copied to foo.ko.
      
      If signing occurs, lines like the following will be seen:
      
      	LD [M]  fs/foo/foo.ko.unsigned
      	STRIP [M] fs/foo/foo.ko.stripped
      	SIGN [M] fs/foo/foo.ko
      
      will appear in the build log.  If the signature step will be skipped and the
      following will be seen:
      
      	LD [M]  fs/foo/foo.ko.unsigned
      	STRIP [M] fs/foo/foo.ko.stripped
      	NO SIGN [M] fs/foo/foo.ko
      
      NOTE!  After the signature step, the signed module _must_not_ be passed through
      strip.  The unstripped, unsigned module is still available at the name on the
      LD [M] line.  This restriction may affect packaging tools (such as rpmbuild)
      and initramfs composition tools.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      80d65e58
  20. 31 8月, 2012 1 次提交
    • scripts/Makefile.modpost: error in finding modules from .mod files. · ef591a55
      이건호 提交于
      This error may happen when the user's id or path includes .ko string.
      For example, user's id is xxx.ko and building test.ko module,
      the test.mod file lists ko name and all object files.
         /home/xxx.ko/kernel_dev/device/drivers/test.ko
         /home/xxx.ko/kernel_dev/device/drivers/test_main.o
      /home/xxx.ko/kernel_dev/device/drivers/test_io.o ...
      Current Makefile.modpost and Makefile.modinst find and list up not
      only test.ko but also other object files.
      because all of object file's path includes .ko string.
      This is a patch to fix it.
      Signed-off-by: NGunho Lee <gunho.lee@lge.com>
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      ef591a55
  21. 25 5月, 2011 1 次提交
  22. 31 3月, 2011 1 次提交
  23. 03 8月, 2010 2 次提交
    • U
      4696e295
    • S
      kbuild: allow assignment to {A,C,LD}FLAGS_MODULE on the command line · 6588169d
      Sam Ravnborg 提交于
      It is now possible to assign options to AS, CC and LD
      on the command line - which is only used when building modules.
      
      {A,C,LD}FLAGS_MODULE was all used both in the top-level Makefile
      in the arch makefiles, thus users had no way to specify
      additional options to AS, CC, LD when building modules
      without overriding the original value.
      
      Introduce a new set of variables KBUILD_{A,C,LD}FLAGS_MODULE
      that is used by arch specific files and free up
      {A,C,LD}FLAGS_MODULE so they can be assigned on
      the command line.
      
      All arch Makefiles that used the old variables has been updated.
      
      Note: Previously we had a MODFLAGS variable for both
      AS and CC. But in favour of consistency this was dropped.
      So in some cases arch Makefile has one assignmnet replaced by
      two assignmnets.
      
      Note2: MODFLAGS was not documented and is dropped
      without any notice. I do not expect much/any breakage
      from this.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Denys Vlasenko <vda.linux@googlemail.com>
      Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
      Cc: Mike Frysinger <vapier@gentoo.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Chen Liqin <liqin.chen@sunplusct.com>
      Acked-by: Mike Frysinger <vapier@gentoo.org> [blackfin]
      Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com> [avr32]
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      6588169d
  24. 19 9月, 2009 1 次提交
  25. 30 10月, 2008 1 次提交
  26. 23 7月, 2008 1 次提交
    • M
      markers: fix duplicate modpost entry · d35cb360
      Mathieu Desnoyers 提交于
      When a kernel was rebuilt, the previous Module.markers was not cleared.
      It caused markers with different format strings to appear as duplicates
      when a markers was changed.  This problem is present since
      scripts/mod/modpost.c started to generate Module.markers, commit
      b2e3e658
      
      It therefore applies to 2.6.25, 2.6.26 and linux-next.
      
      I merely merged the patches from Roland, Wenji and Takashi here.
      
      Credits to
      Roland McGrath <roland@redhat.com>
      Wenji Huang <wenji.huang@oracle.com>
      and
      Takashi Nishiie <t-nishiie@np.css.fujitsu.com>
      
      for providing the individual fixes.
      
      - Changelog :
        - Integrated Takashi's Makefile modification to clear Module.markers upon
          make clean.
      Signed-off-by: NMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: Roland McGrath <roland@redhat.com>
      Cc: Wenji Huang <wenji.huang@oracle.com>
      Cc: Takashi Nishiie <t-nishiie@np.css.fujitsu.com>
      Cc: <stable@kernel.org>		[2.6.25.x, 2.6.26.x]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d35cb360
  27. 01 6月, 2008 1 次提交
    • S
      kbuild: fix $(src) assignmnet with external modules · 96d97f26
      Sam Ravnborg 提交于
      When we introduced support for KBUILD_EXTRA_SYMBOLS
      we started to include the externam module's kbuild
      file when doing the final modpost step.
      
      As external modules often do:
      ccflags-y := -I$(src)
      
      We had problems because $(src) was unassinged and
      gcc then used the next parameter for -I resulting in
      strange build failures.
      
      Fix is to assign $(src) and $(obj) when building
      external modules.
      
      This fixes: http://bugzilla.kernel.org/show_bug.cgi?id=10798Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Tvrtko <tvrtko.ursulin@sophos.com>
      Cc: Andrea Arcangeli <andrea@qumranet.com>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      96d97f26
  28. 27 4月, 2008 1 次提交
  29. 26 4月, 2008 1 次提交
  30. 24 3月, 2008 1 次提交
  31. 14 2月, 2008 1 次提交
    • M
      Linux Kernel Markers: create modpost file · b2e3e658
      Mathieu Desnoyers 提交于
      This adds some new magic in the MODPOST phase for CONFIG_MARKERS.  Analogous
      to the Module.symvers file, the build will now write a Module.markers file
      when CONFIG_MARKERS=y is set.  This file lists the name, defining module, and
      format string of each marker, separated by \t characters.  This simple text
      file can be used by offline build procedures for instrumentation code,
      analogous to how System.map and Module.symvers can be useful to have for
      kernels other than the one you are running right now.
      
      The strings are made easy to extract by having the __trace_mark macro define
      the name and format together in a single array called __mstrtab_* in the
      __markers_strings section.  This is straightforward and reliable as long as
      the marker structs are always defined by this macro.  It is an unreasonable
      amount of hairy work to extract the string pointers from the __markers section
      structs, which entails handling a relocation type for every machine under the
      sun.
      
      Mathieu :
      - Ran through checkpatch.pl
      Signed-off-by: NRoland McGrath <roland@redhat.com>
      Signed-off-by: NMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: David Smith <dsmith@redhat.com>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b2e3e658
  32. 29 1月, 2008 1 次提交
    • S
      kbuild: add verbose option to Section mismatch reporting in modpost · 588ccd73
      Sam Ravnborg 提交于
      If the config option CONFIG_SECTION_MISMATCH is not set and
      we see a Section mismatch present the following to the user:
      
      modpost: Found 1 section mismatch(es).
      To see additional details select "Enable full Section mismatch analysis"
      in the Kernel Hacking menu (CONFIG_SECTION_MISMATCH).
      
      If the option CONFIG_SECTION_MISMATCH is selected
      then be verbose in the Section mismatch reporting from mdopost.
      Sample outputs:
      
      WARNING: o-x86_64/vmlinux.o(.text+0x7396): Section mismatch in reference from the function discover_ebda() to the variable .init.data:ebda_addr
      The function  discover_ebda() references
      the variable __initdata ebda_addr.
      This is often because discover_ebda lacks a __initdata
      annotation or the annotation of ebda_addr is wrong.
      
      WARNING: o-x86_64/vmlinux.o(.data+0x74d58): Section mismatch in reference from the variable pci_serial_quirks to the function .devexit.text:pci_plx9050_exit()
      The variable pci_serial_quirks references
      the function __devexit pci_plx9050_exit()
      If the reference is valid then annotate the
      variable with __exit* (see linux/init.h) or name the variable:
      *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,
      
      WARNING: o-x86_64/vmlinux.o(__ksymtab+0x630): Section mismatch in reference from the variable __ksymtab_arch_register_cpu to the function .cpuinit.text:arch_register_cpu()
      The symbol arch_register_cpu is exported and annotated __cpuinit
      Fix this by removing the __cpuinit annotation of arch_register_cpu or drop the export.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      588ccd73
  33. 26 7月, 2007 2 次提交
  34. 17 7月, 2007 1 次提交
    • S
      kbuild: do section mismatch check on full vmlinux · 741f98fe
      Sam Ravnborg 提交于
      Previously we did do the check on the .o files used to link
      vmlinux but that failed to find questionable references across
      the .o files.
      Create a dedicated vmlinux.o file used only for section mismatch checks
      that uses the defualt linker script so section does not get renamed.
      
      The vmlinux.o may later be used as part of the the final link of vmlinux
      but for now it is used fo section mismatch only.
      For a defconfig build this is instant but for an allyesconfig this
      add two minutes to a full build (that anyways takes ~2 hours).
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      741f98fe