I'm trying to add a number of system calls to the kernel, so I followed this tutorial: https://medium.com/anubhav-shrimal/adding-a-hello-world-system-call-to-linux-kernel-dad32875872
I used a different kernel version though (kernel 5.9.0). This is how my syscall_64.tbl looks:
548 64 mysyscall_a mysyscall_a
549 64 mysyscall_b mysyscall_b
550 64 mysyscall_c mysyscall_c
551 64 mysyscall_d mysyscall_d
552 64 mysyscall_e mysyscall_e
when I try to make
, I keep getting this error:
ld: arch/x86/entry/syscall_64.0:(.rodata+0x1128): undefined reference to '__x64_mysyscall_a'
I checked that the names match in the .c, in the syscall_64.tbl and in syscalls.h. I also tried changing it to '__x64_sys_mysyscall_a' in syscall_64.tbl as someone suggested in another question, but it still gives the same error. Anyone knows how to solve this?
P.S. All of my system calls are defined in the same .c, not sure if this makes a difference.