1. 26 Jan, 2003 9 commits
    • Sam Ravnborg's avatar
      kbuild: Made cmd_link_multi readable · 1b0c3109
      Sam Ravnborg authored
      Introduced ld_flags, and separated out the common parts of link_multi
      for normal and module objects.
      Added a bit of a comment as well
      1b0c3109
    • Sam Ravnborg's avatar
      kbuild: Enable the syntax "make dir/" · 8aba4e43
      Sam Ravnborg authored
      "make dir/" is used to build a subsystem without going through the
      full kernel tree, neither completing the build.
      This is solely useful during development, when focus is on a
      single subsystem.
      This is the counterpart to "make dir/module.ko"
      8aba4e43
    • Sam Ravnborg's avatar
      kbuild: Removed Documentation/kbuild/bug-list.txt · 590f2342
      Sam Ravnborg authored
      The bugs listed was no longer relevant.
      Also updated OO-INDEX
      590f2342
    • Sam Ravnborg's avatar
      Documentation/modules.txt: How to compile modules outside the kernel tree · 8048a09d
      Sam Ravnborg authored
      Updated documentation/modules.txt with the following:
      o Default config target is menuconfig
      o Documented INSTLL_MOD_PATH
      o Referenced to kernel 2.4
      o How to compile modules outside the kernel tree
      
      There is a lot of stuff in need for updating, this is first step
      8048a09d
    • Sam Ravnborg's avatar
      kbuild: Update Documentation/kbuild/makefiles.txt · 041e6a1f
      Sam Ravnborg authored
      makefiles.txt brought up-to-date with the changes that has occured
      in kbuild within the last couple of months.
      Restructured to present relevant info earlier, and rewritten the
      architecture specific section to a certain degree.
      
      One change in style is that makefiles used throughout the kernel tree is called
      "kbuild makefiles", because they follow the kbuild syntax.
      Old notation was "subdirectory makefiles".
      
      There is added a TODO section, if anyone feel tempted to add a bit more text.
      041e6a1f
    • Sam Ravnborg's avatar
      kbuild/all archs: Replace HEAD with head-y · 2f35d5a7
      Sam Ravnborg authored
      Replace done for all archs except mips* and cris.
      These architectures are lacking too much behind that it made sense
      2f35d5a7
    • Sam Ravnborg's avatar
      kbuild: HEAD replaced with head-y · 50c71fe5
      Sam Ravnborg authored
      In arch/$(ARCH)/Makefile the objects to be linked as the very first are specified with HEAD.
      To make more consistent naming, and to allow smarter kbuild style declarations
      HEAD is replaced with head-y.
      Support for the old notaion is kept for now.
      Only i386 updated.
      50c71fe5
    • Sam Ravnborg's avatar
      kbuild/all archs: Removed unused arch{clean,rproper} targets · 3f0aba4a
      Sam Ravnborg authored
      The recent change in the top level makefile allowed this clean-up in all
      the architecture specific Makefiles.
      No functional changes, just deleted the now optional targets
      3f0aba4a
    • Sam Ravnborg's avatar
      kbuild: arch{mrproper,clean} no longer mandatory · 7806d2f1
      Sam Ravnborg authored
      archmrproper and archclean is declared .PHONY in top-level Makefile,
      therefore they are no longer mandatory in arch/$(ARCH)/Makefile.
      7806d2f1
  2. 24 Jan, 2003 12 commits
    • Kai Germaschewski's avatar
      kbuild/modules: Check module symbol versions on insmod · d2fdc759
      Kai Germaschewski authored
      Yeah, the final step!
        
      Now that we've got the checksums for the exported symbols and the
      checksums of the unresolved symbols for the module we're loading,
      let's compare and see.
        
      Again, we allow to load a module which has the version info stripped,
      but taint the kernel in that case.
      d2fdc759
    • Kai Germaschewski's avatar
      kbuild/modules: Return the index of the symbol from __find_symbol() · 82455d2e
      Kai Germaschewski authored
      We'll need that index to find the version checksum for the symbol in
      a bit.
      82455d2e
    • Kai Germaschewski's avatar
      kbuild/modules: Record versions for unresolved symbols · dcc38eae
      Kai Germaschewski authored
      In the case of CONFIG_MODVERSIONING, the build step will only
      generate preliminary <module>.o objects, and an additional
      postprocessing step is necessary to record the versions of the unresolved
      symbols and add them into the final <module>.ko
        
      The version information for unresolved symbols is again recorded into
      a special section, "__versions", which contains an array of symbol
      name strings and checksum (struct modversion_info). Size is here not
      an issue, since this section will not be stored permanently in kernel
      memory.
        
      Makefile.modver takes care of the following steps:
      o Collect the version information for all exported symbols from vmlinux
        and all modules which export symbols.
      o For each module, generate a C file which contains the modversion
        information for all unresolved symbols in that module.
      o For each module, compile that C file to an object file
      o Finally, link the <module>.ko using the preliminary <module.o> + the
        version information above.
        
      The first two steps are currently done by not very efficient scripting,
      so there's room for performance improvement using some helper C code.
      dcc38eae
    • Kai Germaschewski's avatar
      kbuild: Don't build final .ko yet when descending with CONFIG_MODVERSIONING · e4ccd604
      Kai Germaschewski authored
      With CONFIG_MODVERSIONING, we need to record the versions of the unresolved
      symbols in the final <module>.ko, which we only know after we finished
      the descending build. So we only build <module>.o in that case.
        
      Also, keep track of the modules we built, the post-processing step needs
      a list of all modules. Keeping track is done by touching
      .tmp_versions/path/to/module.ko
      e4ccd604
    • Kai Germaschewski's avatar
      kbuild: Always link module (.ko) from associated (.o) · caa9e0e0
      Kai Germaschewski authored
      For extracting the versions and finding the unresolved symbols, we
      need multi-part modules to be linked together already, so this
      patch separates the building of the modules as a .o file from generating
      the .ko in the next step.
      caa9e0e0
    • Kai Germaschewski's avatar
      kbuild/modules: Track versions of exported symbols · 1336f151
      Kai Germaschewski authored
      Store the information on the checksum alongside the rest of the 
      information on exported symbols. To actually use them, we need
      something to check them against first, though ;)
      
      Also, fix some conditional debug code to actually compile.
      1336f151
    • Kai Germaschewski's avatar
      kbuild/modules: Don't save the license string · e805cfe6
      Kai Germaschewski authored
      Again, the license string is only used at load time, so no need
      to store it permanently in kernel memory.
      e805cfe6
    • Kai Germaschewski's avatar
      kbuild/modules: Check __vermagic for validity · c8b4778d
      Kai Germaschewski authored
      modprobe --force allows to load modules without a matching version
      magic string. This invalidation is done by clearing the SHF_ALLOC
      flag, so check it in the kernel. Also, clear the SHF_ALLOC flag
      unconditionally, since we don't need to store the __vermagic section
      in the kernel, it's only checked once at load time. 
      c8b4778d
    • Kai Germaschewski's avatar
      kbuild: Generate versions for exported symbols · 09369f63
      Kai Germaschewski authored
      Up to now, we had a way to store the checksums associated with the
      exported symbols, but they were not filled in yet. This is done
      with this patch, using the linker to actually do that for us.
        
      The comment added with this patch explains what magic exactly is going
      on.
      09369f63
    • Kai Germaschewski's avatar
      kbuild: Add CONFIG_MODVERSIONING and __kcrctab · a6b99776
      Kai Germaschewski authored
      This patch adds the new config option CONFIG_MODVERSIONING which will
      be the new way of checking for ABI changes between kernel and module
      code.
      
      This and the following patches are in part based on an initial
      implementation by Rusty Russell and I believe some of the ideas go back
      to discussions on linux-kbuild, Keith Owens and Rusty.
      
      though I'm not sure I think credit for the basic idea of
      storing version info in sections goes to Keith Owens and Rusty.
      
      o Rename __gpl_ksymtab to __ksymtab_gpl since that looks more consistent
        and appending _gpl instead of putting it into the middle simplifies
        sharing code for EXPORT_SYMBOL() and EXPORT_SYMBOL_GPL()
      o Add CONFIG_MODVERSIONING
      o If CONFIG_MODVERSIONING is set, add a section __kcrctab{,_gpl}, which
        contains the ABI checksums for the exported symbols listed in 
        __ksymtab{,_crc} Since we don't know the checksums yet at compilation
        time, just make them an unresolved symbol which gets filled in by the
        linker later.
      a6b99776
    • Kai Germaschewski's avatar
      kbuild: Remove obsolete CONFIG_MODVERSIONS cruft · 81106eac
      Kai Germaschewski authored
      Though the CONFIG_MODVERSIONS option was removed with rusty's module
      rewrite and the associated code broken, a lot of that code was still
      living on here and there. Now it's gone for good.
      81106eac
    • Kai Germaschewski's avatar
      kbuild: Remove -DEXPORT_SYMTAB switch · 61cfcb3d
      Kai Germaschewski authored
      rusty's module rewrite removed the reference to EXPORT_SYMTAB 
      from linux/module.h, and it's not used anywhere else, either.
      61cfcb3d
  3. 17 Jan, 2003 1 commit
    • Kai Germaschewski's avatar
      kbuild: Fix __start_SECTION, __stop_SECTION · aae7d999
      Kai Germaschewski authored
      In a discussion with Sam Ravnborg, the following problem became apparent:
      Most vmlinux.lds.S (but the ARM ones) used the following construct:
        
             __start___ksymtab = .;                                          
             __ksymtab         : AT(ADDR(__ksymtab) - LOAD_OFFSET) {         
                     *(__ksymtab)                                            
             }                                                               
             __stop___ksymtab = .;                                           
        
      However, the link will align the beginning of the section __ksymtab
      according to the requirements for the input sections. If '.' (current
      location counter) wasn't sufficiently aligned before, it's possible
      that __ksymtab actually starts at an address after the one
      __start___ksymtab points to, which will confuse the users of
      __start___ksymtab badly. The fix is to follow what the ARM Makefiles
      did for this case, ie
        
             __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) {                 
                     __start___ksymtab = .;                                  
                     *(__ksymtab)                                            
                     __stop___ksymtab = .;                                   
             }                                                               
      aae7d999
  4. 16 Jan, 2003 18 commits