According on the ldd linux command on /bin/chgrp the only necessary library for its execution is libc.so. When chgrp is debugged with gdb I've noticed that other libraries are actually loaded, such as:
/lib/x86_64-linux-gnu/libnss_compat.so.2
/lib/x86_64-linux-gnu/libnsl.so.1
/lib/x86_64-linux-gnu/libnss_nis.so.2
/lib/x86_64-linux-gnu/libnss_files.so.2
Why these libraries do not compare in the ldd output?
Also: they do not compare in the DYNAMIC section of libc.so, how are they located and loaded? (I've checked the DYNAMIC section of libc.so with readelf and these libraries are not there)
chgrp
probably loads them dynamically via thedlopen
function.