Say I write a non-sensical program that features a single system call, open
:
#include <fcntl.h>
void main()
{
int hi = open("does not exist", 0);
}
When I compile the program and issue an ldd
command on the output, I get the following:
linux-vdso.so.1 (0x00007ffddd741000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6835328000)
/lib64/ld-linux-x86-64.so.2 (0x00007f6835584000)
I only recognize the libc.so.6
link, but I don't recognize the others.
Does one of these other libraries contain kernel system calls? Or is it possible that system call functions are statically linked? (seems unlikely).
nm -D /lib/x86_64-linux-gnu/libc.so.6 | grep -w open
. – Quasímodo Sep 09 '22 at 00:00