separate ldd.cc into two files
improve some code
add swig support for ldd