title: Compiling a loadable kernel module(Debian/Ubuntu)
body: <p>This question is a follow up of <a href="https://stackoverflow.com/questions/28973146/compiling-an-individual-kernel-module-debian-ubuntu">this</a> one. I am trying to compile the ELF loader as an individual LKM and use it as a standalone application(replacing the original module within the base kernel sounds too risky). 
  Up to this point I have copied the <a href="http://lxr.free-electrons.com/source/fs/binfmt_elf.c" rel="nofollow noreferrer">source file</a> into a separate directory tree and attempted to compile it using the following <strong>Makefile</strong>:</p>
  
  <pre><code>obj-m += binfmt_elf_mod.o
  
  all:
      make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
  
  clean:
      make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
  </code></pre>
  
  <p>The module is generate but the following warnings are given:</p>
  
  <pre><code>make -C /lib/modules/3.13.0-32-generic/build M=/path/to/source/Resources modules
  make[1]: Entering directory `/usr/src/linux-headers-3.13.0-32-generic'
    Building modules, stage 2.
    MODPOST 1 modules
  WARNING: "start_thread" [/path/to/source/Resources/binfmt_elf_mod.ko] undefined!
  WARNING: "arch_randomize_brk" [/path/to/source/Resources/binfmt_elf_mod.ko] undefined!
  WARNING: "find_extend_vma" [/path/to/source/Resources/binfmt_elf_mod.ko] undefined!
  WARNING: "security_bprm_secureexec" [/path/to/source/Resources/binfmt_elf_mod.ko] undefined!
  WARNING: "vdso_enabled" [/path/to/source/Resources/binfmt_elf_mod.ko] undefined!
  WARNING: "arch_align_stack" [/path/to/source/Resources/binfmt_elf_mod.ko] undefined!
  WARNING: "arch_setup_additional_pages" [/path/to/source/Resources/binfmt_elf_mod.ko] undefined!
  WARNING: "randomize_va_space" [/path/to/source/Resources/binfmt_elf_mod.ko] undefined!
  WARNING: "set_personality_64bit" [/path/to/source/Resources/binfmt_elf_mod.ko] undefined!
  WARNING: "elf_core_write_extra_data" [/path/to/source/Resources/binfmt_elf_mod.ko] undefined!
  WARNING: "get_dump_page" [/path/to/source/Resources/binfmt_elf_mod.ko] undefined!
  WARNING: "elf_core_write_extra_phdrs" [/path/to/source/Resources/binfmt_elf_mod.ko] undefined!
  WARNING: "task_cputime" [/path/to/source/Resources/binfmt_elf_mod.ko] undefined!
  WARNING: "elf_core_extra_data_size" [/path/to/source/Resources/binfmt_elf_mod.ko] undefined!
  WARNING: "copy_siginfo_to_user" [/path/to/source/Resources/binfmt_elf_mod.ko] undefined!
  WARNING: "thread_group_cputime" [/path/to/source/Resources/binfmt_elf_mod.ko] undefined!
  WARNING: "elf_core_extra_phdrs" [/path/to/source/Resources/binfmt_elf_mod.ko] undefined!
  WARNING: "arch_vma_name" [/path/to/source/Resources/binfmt_elf_mod.ko] undefined!
  WARNING: "get_gate_vma" [/path/to/source/Resources/binfmt_elf_mod.ko] undefined!
  make[1]: Leaving directory `/usr/src/linux-headers-3.13.0-32-generic'
  </code></pre>
  
  <p>Currently I am building using the default build script in <strong>/lib/modules/3.13.0-32-generic</strong> instead of the downloaded sources. How is it possible to solve these dependencies?</p>