Kumar Gaurav
Kumar Gaurav

Reputation: 1317

What are the various files created when compiling linux device driver?

I have very basic question. When we create a driver using makefile, we see a number of files created as

  1. Module.symvers
  2. .mod.c
  3. built-in.o
  4. .mod.o
  5. .o
  6. modules.order
  7. .ko

So far I'm only interested in *.ko file and not concerned with any other file. But still i wanna know about other files, what are they used for? Please reply

Upvotes: 2

Views: 502

Answers (1)

Christophe Augier
Christophe Augier

Reputation: 575

From the documentation pointed in the comment and some other sources (1, 2 and 3):

  1. Module.symvers - "Module.symvers contains a list of all exported symbols from a kernel build."
  2. .mod.c - "is a file that basically contains the information about the module (Version information etc)"
  3. built-in.o - This file is not related to kernel modules but instead normal kernel build. "Kbuild compiles all the $(obj-y) files. It then calls "$(LD) -r" to merge these files into one built-in.o file. built-in.o is later linked into vmlinux by the parent Makefile"
  4. .mod.o - objcet files resulting from the compilation of the .mod.c files.
  5. .o - object files resulting from the compilation of the module source files.
  6. modules.order - "In case you are compiling multiple modules together, it will list out the order in which the compilation and creation of .ko takes"
  7. .ko - the final kernel module binary that is loaded into the kernel.

Upvotes: 2

Related Questions