Sign up here and you can log into the forum!

The search for library dependencies/orphan libraries

Have a question about devices internals, memory layout, reverse engineering, etc---This is the place for anything so technical that it would cause a n00b's head to 'splode

The search for library dependencies/orphan libraries   

Postby mad_ady » Tue Feb 03, 2015 2:28 am

While preparing for porting WDLXTV to 1.06, I built some scripts to create a database of dependencies (e.g. binary -> library). On this list I later ran a query to see which libraries were not used by any of the binaries in the firmware... And, surprise - surprise: it looks like a lot of unused libraries (I ran it on 1.05-0.5.2.1)...

The files (scripts and output) are here: http://svn.wdlxtv.com/listing.php?repname=misc&path=%2FlddDependency%2F&#af7ecd28b837988bbe782d1be35e914a3

Code: Select all
select file from libraries where pointsTo not in (select l.pointsTo from dependencies d join libraries l where d.library = l.file)


And I get the following (some are mistakes - like the ones in modules, or some are folders, or symlinks to different parts in bi2):

Code: Select all
/lib/libIIO.so
/lib/libpng.so
/lib/libnss_files-2.8.so
/lib/libnss_compat.so.2
/lib/libIFL31NativeSoundOutput.so
/lib/librmwmdrmndupnp.so
/lib/libIImageDecoder.so
/lib/libgio-2.0.so.0
/lib/libnss_hesiod.so.2
/lib/libBrokenLocale.so.1
/lib/librmlibplay_default_plugin.so
/lib/libusbpp-0.1.so.4.4.4
/lib/firmware
/lib/libhistory.so
/lib/librmcpputils.so
/lib/libIAEKernel.so
/lib/libIEDKExtensions.so
/lib/libIGraphicsDriver.so
/lib/libpcrecpp.so.0.0.0
/lib/libgobject-2.0.so
/lib/libcharset.so
/lib/libreadline.so
/lib/libhistory.so.6
/lib/librmmm.so
/lib/libnss_dns-2.8.so
/lib/libgdbm.so
/lib/librmasfpulldemuxcore.so
/lib/librmremote.so
/lib/libIShell.so
/lib/libIURLOps.so
/lib/libpcrecpp.so
/lib/libnss_nisplus-2.8.so
/lib/libnss_files.so.2
/lib/libcharset.so.1
/lib/libcidn-2.8.so
/lib/libnss_compat-2.8.so
/lib/libpcprofile.so
/lib/libpcreposix.so.0
/lib/libemhwlibhdmi.so
/lib/libIFileSystem.so
/lib/libpng.so.3.14.0
/lib/librmlibrealmedia.so
/lib/libgphoto2/jamcam.so
/lib/libgphoto2/konica.so
/lib/libgphoto2/fuji.so
/lib/libgphoto2/sony_dscf1.so
/lib/libgphoto2/panasonic_dc1000.so
/lib/libgphoto2/gsmart300.so
/lib/libgphoto2/ptp2.so
/lib/libgphoto2/toshiba_pdrm11.so
/lib/libgphoto2/ricoh.so
/lib/libgphoto2/directory.so
/lib/libgphoto2/panasonic_l859.so
/lib/libgphoto2/soundvision.so
/lib/libgphoto2/ricoh_g3.so
/lib/libgphoto2/digigr8.so
/lib/libgphoto2/smal.so
/lib/libgphoto2/sonix.so
/lib/libgphoto2/sipix_web2.so
/lib/libgphoto2/sq905.so
/lib/libgphoto2/disk.so
/lib/libgphoto2/enigma13.so
/lib/libgphoto2/hp215.so
/lib/libgphoto2/digita.so
/lib/libgphoto2/stv0674.so
/lib/libgphoto2/kodak_dc3200.so
/lib/libgphoto2/jd11.so
/lib/libgphoto2/pccam300.so
/lib/libgphoto2/largan.so
/lib/libgphoto2/polaroid_pdc700.so
/lib/libgphoto2/polaroid_pdc640.so
/lib/libgphoto2/panasonic_dc1580.so
/lib/libgphoto2/iclick.so
/lib/libgphoto2/kodak_dc240.so
/lib/libgphoto2/sipix_blink2.so
/lib/libgphoto2/canon.so
/lib/libgphoto2/samsung.so
/lib/libgphoto2/clicksmart310.so
/lib/libgphoto2/ptpip.so
/lib/libgphoto2/kodak_dc210.so
/lib/libgphoto2/panasonic_coolshot.so
/lib/libgphoto2/dimera3500.so
/lib/libgphoto2/kodak_ez200.so
/lib/libgphoto2/stv0680.so
/lib/libgphoto2/konica_qm150.so
/lib/libgphoto2/aox.so
/lib/libgphoto2/polaroid_pdc320.so
/lib/libgphoto2/sierra.so
/lib/libgphoto2/adc65.so
/lib/libgphoto2/agfa_cl20.so
/lib/libgphoto2/jl2005a.so
/lib/libgphoto2/spca50x.so
/lib/libgphoto2/sony_dscf55.so
/lib/libgphoto2/usb.so
/lib/libgphoto2/mustek.so
/lib/libgphoto2/casio_qv.so
/lib/libgphoto2/topfield.so
/lib/libgphoto2/pccam600.so
/lib/libgphoto2/barbie.so
/lib/libgphoto2/kodak_dc120.so
/lib/libgphoto2/serial.so
/lib/libgphoto2/mars.so
/lib/libgphoto2/lg_gsm.so
/lib/libgphoto2/sx330z.so
/lib/libgphoto2/dimagev.so
/lib/libgdbm.so.3
/lib/libIStreamPlayer.so
/lib/libusbpp.so
/lib/librmlivehttp.so
/lib/libhistory.so.6.2
/lib/libpcreposix.so.0.0.0
/lib/librmlibplay.so
/lib/libcidn.so.1
/lib/libmemusage.so
/lib/libemhwlibi2c.so
/lib/libIXMLReaderLib.so
/lib/libnss_hesiod-2.8.so
/lib/librmmm_t.so
/lib/libgmodule-2.0.so
/lib/libgmodule-2.0.so.0.2400.2
/lib/libpcreposix.so
/lib/libgobject-2.0.so.0
/lib/librmmonitoring.so
/lib/libgdbm.so.3.0.0
/lib/libusbpp-0.1.so.4
/lib/libgio-2.0.so.0.2400.2
/lib/librmdemuxwritekeyapi.so
/lib/mt-daapd/plugins/out-daap.so
/lib/mt-daapd/plugins/rsp.so
/lib/mt-daapd/plugins/ssc-script.so
/lib/libemhsi.so
/lib/libthread_db-1.0.so
/lib/libnss_dns.so.2
/lib/libgio-2.0.so
/lib/libanl.so.1
/lib/libnss_nis.so.2
/lib/libSegFault.so
/lib/librmlibplay_sample_plugin.so
/lib/libpcrecpp.so.0
/lib/librpc2xtask.so
/lib/libthread_db.so.1
/lib/libpng.so.3
/lib/libIJSONParserLib.so
/lib/libIVideoDecoder.so
/lib/librmsoftmixer.so
/lib/libnss_nisplus.so.2
/lib/libIAudioDecoder.so
/lib/libgmodule-2.0.so.0
/lib/security/pam_namespace.so
/lib/security/pam_stress.so
/lib/security/pam_faildelay.so
/lib/security/pam_localuser.so
/lib/security/pam_permit.so
/lib/security/pam_userdb.so
/lib/security/pam_rootok.so
/lib/security/pam_listfile.so
/lib/security/pam_mkhomedir.so
/lib/security/pam_unix.so
/lib/security/pam_access.so
/lib/security/pam_filter.so
/lib/security/pam_exec.so
/lib/security/pam_selinux.so
/lib/security/pam_mail.so
/lib/security/pam_time.so
/lib/security/pam_tally2.so
/lib/security/pam_tally.so
/lib/security/pam_xauth.so
/lib/security/pam_timestamp.so
/lib/security/pam_lastlog.so
/lib/security/pam_env.so
/lib/security/pam_rhosts.so
/lib/security/pam_group.so
/lib/security/pam_pwhistory.so
/lib/security/pam_ftp.so
/lib/security/pam_debug.so
/lib/security/pam_securetty.so
/lib/security/pam_deny.so
/lib/security/pam_keyinit.so
/lib/security/pam_nologin.so
/lib/security/pam_wheel.so
/lib/security/pam_sepermit.so
/lib/security/pam_shells.so
/lib/security/pam_succeed_if.so
/lib/security/pam_loginuid.so
/lib/security/pam_warn.so
/lib/security/pam_issue.so
/lib/security/pam_limits.so
/lib/security/pam_echo.so
/lib/security/pam_umask.so
/lib/security/pam_motd.so
/lib/libgobject-2.0.so.0.2400.2
/lib/libIProcess.so
/lib/libsamples.so
/lib/modules/scsi_wait_scan.ko
/lib/modules/irkernel.ko
/lib/modules/wd_led_rst.ko
/lib/modules/2.6.22.19-19-4
/lib/modules/2.6.22.19-19-4-orig/build
/lib/modules/2.6.22.19-19-4-orig/source
/lib/libISocket.so
/lib/libBrokenLocale-2.8.so
/lib/librmfp.so
/lib/librmabcdrminterface.so
/lib/libanl-2.8.so
/lib/libnss_nis-2.8.so
/lib/libIFlashLib.so
/lib/libIStream.so
/lib/libcharset.so.1.0.0
/lib/libgbushsi.so
/lib/librmfontrender_t.so
/lib/libIRTMPDigest.so
/usr/lib/libonig.so.2.0.0
/usr/lib/perl
/usr/lib/libxmlrpc_server.so
/usr/lib/libgnutls-extra.so.26.14.12
/usr/lib/libdvdread.so
/usr/lib/libgettextpo.so
/usr/lib/libqdbm.so.14.10.0
/usr/lib/libXpm.so.4
/usr/lib/libX11.so.6
/usr/lib/libXdmcp.so.6.0.0
/usr/lib/libldap-2.4.so.2
/usr/lib/libXpm.so.4.11.0
/usr/lib/libcurl.so.3
/usr/lib/libXau.so.6
/usr/lib/libxcb.so.1
/usr/lib/libfontconfig.so.1.3.0
/usr/lib/libgnutls-openssl.so.26
/usr/lib/libGeoIPUpdate.so.0.0.0
/usr/lib/libxcb.so.1.1.0
/usr/lib/libgettextpo.so.0
/usr/lib/libXau.so.6.0.0
/usr/lib/libX11.so.6.3.0
/usr/lib/libdvdcss.so
/usr/lib/sftp-server
/usr/lib/libgnutls-extra.so.26
/usr/lib/libcurl-gnutls.so.3
/usr/lib/libxmlrpc_xmltok.so
/usr/lib/libxmlrpc.so
/usr/lib/libGeoIPUpdate.so.0
/usr/lib/libdb-4.8.so
/usr/lib/libfontconfig.so.1
/usr/lib/perl5
/usr/lib/ssl
/usr/lib/libxmlrpc_xmlparse.so
/usr/lib/libxmlrpc_util.so
/usr/lib/libqdbm.so.14
/usr/lib/libt1.so.5
/usr/lib/libgd.so.2
/usr/lib/libGeoIP.so.1
/usr/lib/libgettextpo.so.0.4.0
/usr/lib/apr-util-1
/usr/lib/libXdmcp.so.6
/usr/lib/libpamc.so.0.82.1
/usr/lib/sudo/sudo_noexec.so
/usr/lib/libpamc.so.0
/usr/lib/libdvdcss.so.2.1.0
/usr/lib/libt1.so.5.1.2
/usr/lib/libGeoIP.so.1.4.6
/usr/lib/libdvdcss.so.2
/usr/lib/libgnutls-openssl.so.26.14.12
/usr/lib/libonig.so.2
/usr/lib/apache2
/usr/lib/libgd.so.2.0.0


Looks like the gphoto2 and libpam have a lot of libraries not used. I'm not sure if they can be loaded if a program does something special, and ldd would not pick them up, or if they are just orphans...
I'll keep an eye on them, and move them out (try without them) when space becomes an issue again... Also, can anybody spot any errors I might have done?
User avatar
mad_ady
Developer
 
Posts: 4549
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Return to WDTV Live

Who is online

Users browsing this forum: No registered users and 1 guest