I wanted to add a function lets say foo
to my program my_pgm.c
. I used it by extern foo();
When I run Makefile to run my_pgm.c
it went fine, but as it is not there in /proc/kallsym
while doing insmod my_pgm.ko
it throws errror.
insmod: ERROR: could not insert module my_pgm.ko: Unknown symbol in module
In dmesg it prints like Unknown symbol my_pgm (err 0)
foo defined as part of another file. I took the function pointer foo from there using nm another_file.ko
. I wanted to insert this pointer entry into /proc/kallsyms
My question is can we modify /proc/kallsyms
? If so how to modify it?(If I edit the file and override it then also changes are not reflecting when I reopen the file)