1. 04 2月, 2017 1 次提交
    • A
      kbuild: modversions: add infrastructure for emitting relative CRCs · 56067812
      Ard Biesheuvel 提交于
      This add the kbuild infrastructure that will allow architectures to emit
      vmlinux symbol CRCs as 32-bit offsets to another location in the kernel
      where the actual value is stored. This works around problems with CRCs
      being mistaken for relocatable symbols on kernels that self relocate at
      runtime (i.e., powerpc with CONFIG_RELOCATABLE=y)
      
      For the kbuild side of things, this comes down to the following:
      
       - introducing a Kconfig symbol MODULE_REL_CRCS
      
       - adding a -R switch to genksyms to instruct it to emit the CRC symbols
         as references into the .rodata section
      
       - making modpost distinguish such references from absolute CRC symbols
         by the section index (SHN_ABS)
      
       - making kallsyms disregard non-absolute symbols with a __crc_ prefix
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      56067812
  2. 29 11月, 2016 1 次提交
    • N
      kbuild: modpost warn if export version crc is missing · d8c1eb86
      Nicholas Piggin 提交于
      This catches the failing ceph CRC on with:
      
          LD      vmlinux.o
          MODPOST vmlinux.o
        WARNING: EXPORT symbol "ceph_monc_do_statfs" [vmlinux] version
        generation failed, symbol will not be versioned.
      
      When the modules referring to exported symbols are built, there is an
      existing warning for missing CRC, but it's not always the case such
      any such module will be built, and in any case it is useful to get a
      warning at the source.
      
      This gets a little verbose with CONFIG_DEBUG_SECTION_MISMATCH,
      producing a warning with each object linked, but I didn't think
      that warranted extra complexity to avoid.
      Signed-off-by: NNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: NMichal Marek <mmarek@suse.com>
      d8c1eb86
  3. 27 11月, 2016 1 次提交
  4. 08 10月, 2016 1 次提交
  5. 21 1月, 2016 1 次提交
    • A
      powerpc: Simplify module TOC handling · c153693d
      Alan Modra 提交于
      PowerPC64 uses the symbol .TOC. much as other targets use
      _GLOBAL_OFFSET_TABLE_. It identifies the value of the GOT pointer (or in
      powerpc parlance, the TOC pointer). Global offset tables are generally
      local to an executable or shared library, or in the kernel, module. Thus
      it does not make sense for a module to resolve a relocation against
      .TOC. to the kernel's .TOC. value. A module has its own .TOC., and
      indeed the powerpc64 module relocation processing ignores the kernel
      value of .TOC. and instead calculates a module-local value.
      
      This patch removes code involved in exporting the kernel .TOC., tweaks
      modpost to ignore an undefined .TOC., and the module loader to twiddle
      the section symbol so that .TOC. isn't seen as undefined.
      
      Note that if the kernel was compiled with -msingle-pic-base then ELFv2
      would not have function global entry code setting up r2. In that case
      the module call stubs would need to be modified to set up r2 using the
      kernel .TOC. value, requiring some of this code to be reinstated.
      
      mpe: Furthermore a change in binutils master (not yet released) causes
      the current way we handle the TOC to no longer work when building with
      MODVERSIONS=y and RELOCATABLE=n. The symptom is that modules can not be
      loaded due to there being no version found for TOC.
      
      Cc: stable@vger.kernel.org # 3.16+
      Signed-off-by: NAlan Modra <amodra@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      c153693d
  6. 26 10月, 2015 1 次提交
  7. 06 10月, 2015 1 次提交
  8. 08 8月, 2015 1 次提交
    • T
      modpost: abort if a module symbol is too long · 5cfb203a
      Takashi Iwai 提交于
      Module symbols have a limited length, but currently the build system
      allows the build finishing even if the driver code contains a too long
      symbol name, which eventually overflows the modversion_info[] item.
      The compiler may catch at compiling *.mod.c like
        CC      xxx.mod.o
        xxx.mod.c:18:16: warning: initializer-string for array of chars is too long
      but it's merely a warning.
      
      This patch adds the check of the symbol length in modpost and stops
      the build properly.
      
      Currently MODULE_NAME_LEN is defined in modpost.c instead of referring
      to the definition in kernel header because including linux/module.h is
      messy and we must cover cross-compilation.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      5cfb203a
  9. 09 7月, 2015 1 次提交
    • C
      modpost: work correctly with tile coldtext sections · 673c2c34
      Chris Metcalf 提交于
      The tilegx and tilepro compilers use .coldtext for their unlikely
      executed text section name, so an __attribute__((cold)) function
      will (when compiled with higher optimization levels) land in
      the .coldtext section.
      
      Modify modpost to add .coldtext to the set of OTHER_TEXT_SECTIONS
      so we don't get warnings about referencing such a section in an
      __ex_table block, and then also modify arch/tile/lib/memcpy_user_64.c
      so that it uses plain ".coldtext" instead of ".coldtext.memcpy".
      The latter naming is a relic of an earlier use of -ffunction-sections,
      which we no longer use by default.
      Signed-off-by: NChris Metcalf <cmetcalf@ezchip.com>
      Acked-by: NRusty Russell <rusty@rustcorp.com.au>
      673c2c34
  10. 22 4月, 2015 7 次提交
  11. 13 4月, 2015 7 次提交
  12. 03 10月, 2014 1 次提交
    • K
      aarch64: filter $x from kallsyms · 6c34f1f5
      Kyle McMartin 提交于
      Similar to ARM, AArch64 is generating $x and $d syms... which isn't
      terribly helpful when looking at %pF output and the like. Filter those
      out in kallsyms, modpost and when looking at module symbols.
      
      Seems simplest since none of these check EM_ARM anyway, to just add it
      to the strchr used, rather than trying to make things overly
      complicated.
      
      initcall_debug improves:
      dmesg_before.txt: initcall $x+0x0/0x154 [sg] returned 0 after 26331 usecs
      dmesg_after.txt: initcall init_sg+0x0/0x154 [sg] returned 0 after 15461 usecs
      Signed-off-by: NKyle McMartin <kyle@redhat.com>
      Acked-by: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      6c34f1f5
  13. 27 8月, 2014 2 次提交
  14. 27 7月, 2014 2 次提交
  15. 10 6月, 2014 1 次提交
  16. 05 5月, 2014 1 次提交
  17. 28 4月, 2014 1 次提交
  18. 19 2月, 2014 1 次提交
  19. 14 2月, 2014 3 次提交
  20. 15 1月, 2014 1 次提交
  21. 13 11月, 2013 1 次提交
  22. 07 11月, 2013 1 次提交
  23. 29 10月, 2013 1 次提交
  24. 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