Thursday, May 12, 2016

Kegunaan ldd dan ln -s

ldd (List Dynamic Dependencies) is a *nix utility that prints the shared libraries required by each program or shared library specified on the command line.[1] It was developed byRoland McGrath and Ulrich Drepper.[2] ldd is a shell script that executes the program given as argument, and shouldn't be used with untrusted binaries. If some shared library is missing for any program, that program won't come up.

ldd (Daftar Dinamis Dependensi) adalah utilitas *nix yang memberitahukan shared library yang dibutuhkan oleh masing-masing program atau shared library yang ditentukan pada baris perintah. [1] Hal ini dikembangkan oleh Roland McGrath dan Ulrich Drepper. [2] ldd adalah script shell yang mengeksekusi program yang diberikan sebagai argumen, dan seharusnya tidak digunakan dengan binari yang tidak dipercaya. Jika ada beberapa shared library yang hilang untuk salah satu program, maka program yang tidak akan jalan.


contoh :
 user@home ~/ $ ldd /usr/bin/mp3blaster
         linux-vdso.so.1 =>  (0x00007fff8fdff000)
         libsidplay.so.1 => /usr/lib/libsidplay.so.1 (0x00007f4ea98ec000)
         libvorbisfile.so.3 => /usr/lib/libvorbisfile.so.3 (0x00007f4ea96e4000)
         libvorbis.so.0 => /usr/lib/libvorbis.so.0 (0x00007f4ea94b6000)
         libncurses.so.5 => /lib/libncurses.so.5 (0x00007f4ea9273000)
         libpthread.so.0 => /lib/libpthread.so.0 (0x00007f4ea9056000)
         libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f4ea8d41000)
         libm.so.6 => /lib/libm.so.6 (0x00007f4ea8abe000)
         libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f4ea88a7000)
         libc.so.6 => /lib/libc.so.6 (0x00007f4ea8523000)
         libogg.so.0 => /usr/lib/libogg.so.0 (0x00007f4ea831c000)
         libdl.so.2 => /lib/libdl.so.2 (0x00007f4ea8118000)
         /lib64/ld-linux-x86-64.so.2 (0x00007f4ea9b59000)


ln is A symbolic link, also termed a soft link, is a special kind of file that points to another file, much like a shortcut in Windows or a Macintosh alias. Unlike a hard link, a symbolic link does not contain the data in the target file. It simply points to another entry somewhere in the file system. This difference gives symbolic links certain qualities that hard links do not have, such as the ability to link to directories, or to files on remote computers networked through NFS. Also, when you delete a target file, symbolic links to that file become unusable, whereas hard links preserve the contents of the file.
To create a symbolic link in Unix, at the Unix prompt, enter:
  ln -s source_file myfile

contoh kegunaan ldd
error while loading shared libraries libluajit.so.2... maka untuk ngecek linker nya sudah bener,
cek dengan ldd /binary/snort misalkan,
maka akan terlihat libraries terletak pada posisi mana,
contoh output ldd = /usr/lib/x86_64-gnu-linux

setelah itu link kan
ln -s libluajit.so.2 
/usr/lib/x86_64-gnu-linux.

test running kembali... sukses deh

1 comment:

have a question, just spill it :D