0

in Linux kernel source code, there are below words in fs/proc/Makefile

obj-y += proc.o

but where is the fs/proc/proc.c file?

find the file in Linux source code, but not found.

jaloo
  • 13
  • 3
  • There is no `proc.c`. If I recall correctly, `proc.o` is built from the separate object files `inode.o`, `root.o`, etc, using `ld -r` which effectively combines many object files into one. You could confirm by actually building it using `make V=1` to show all the commands that are run, or try to trace through Linux's very long and complex Makefile setup. I suspect it's somewhere in [Makefile.build](https://github.com/torvalds/linux/blob/master/scripts/Makefile.build) from one of the pattern rules using `%.o`. – Nate Eldredge Feb 06 '23 at 06:13
  • @NateEldredge in [kbuild/Makefiles](https://docs.kernel.org/kbuild/makefiles.html#goal-definitions) said: "obj-y += foo.o This tells kbuild that there is one object in that directory, named foo.o. foo.o will be built from foo.c or foo.S." then maybe have some other Hidden rules? – jaloo Feb 07 '23 at 10:05

0 Answers0