1
votes

I am trying to build an LKM for linux 4.15.0-23-generic. I am using following command to make it.

make -C /lib/modules/$(shell uname -r)/build/ M=$(PWD) modules

Unfortunately, make fails to get the correct header files.

WARNING: "unwind_get_return_address_ptr" [/home/probir/hyperf/hyperf/hyperf.ko] undefined! WARNING: "__kernel_text_address" [/home/probir/hyperf/hyperf/hyperf.ko] undefined! make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-23-generic'

Header files are located in following directory.

/usr/src/linux-headers-4.15.0-23-generic/arch/x86/include/asm/unwind.h

/usr/src/linux-headers-4.15.0-23-generic/include/linux/kernel.h

Why make is failing to locate the header, even if correct version is given?

1
Headers have absolutely nothing to do with this.n. 1.8e9-where's-my-share m.
Would you please elaborate?Proy
If there are missing headers, you get a very straightforward error message that talks about missing headers in a way you cannot miss. Since you've got a totally different kind of message, there are no missing headers.n. 1.8e9-where's-my-share m.
Thanks, got my answer.Proy

1 Answers

1
votes

These functions (unwind_get_return_address_ptr and __kernel_text_address) are not exported (via EXPORT_SYMBOL or so), so they cannot be used by modules. Only a code compiled into kernel itself may use given symbols.