编译内核后查找函数定义的位置,比如查找stat_kernel在哪里定义和引用了:
linux-5.4$ grep -rn start_kernel `find -name "*.o"`
Binary file ./arch/arm64/kernel/smp.o matches
Binary file ./arch/arm64/kernel/head.o matches
Binary file ./init/main.o matches
Binary file ./vmlinux.o matches
方便之处,编译之前,有很多个文件里面都有定义start_kernel,通过这个方法来确定函数在哪个文件编译进去了;若是u-boot可以直接看u-boot.map;linux有无linux.map?