Can ldd(1) list non-FreeBSD dynamic object dependencies?

From: Norikatsu Shigemura (nork_at_FreeBSD.org)
Date: 10/15/05

  • Next message: Divacky Roman: "Re: Re: system password's file"
    Date: Sat, 15 Oct 2005 09:41:41 +0900 (JST)
    To: freebsd-hackers@FreeBSD.org
    
    

    Hi FreeBSD hackers!

            I think that ldd(1) may list non-FreeBSD dynamic object
            dependencies. Do you think?
            If ldd(1) can list these, Linux Plugin Wrapper is more
            interested. Because you can confirm LPW enabled by ldd(1)
            like following lines:

    $ ldd /usr/X11R6/lib/linux-flashplugin6/libflashplayer.so
    ldd: /usr/X11R6/lib/linux-flashplugin6/libflashplayer.so: not a FreeBSD ELF shared object(OS type=0)
    /usr/X11R6/lib/linux-flashplugin6/libflashplayer.so:
            libpthread.so.0 => /usr/local/lib/pluginwrapper/flash6.so (0x68391000)
            libz.so.1 => /lib/libz.so.3 (0x68394000)
            libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x683a5000)
            libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x68471000)
            libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x6847f000)
            libstdc++-libc6.2-2.so.3 => /usr/lib/libstdc++.so.5 (0x684d1000)
            libm.so.6 => /lib/libm.so.4 (0x685a4000)
            libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x685bb000)
            libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x685c4000)

            In ldd(1)'s current source #178 lines:
    >>if (hdr.elf.e_ident[EI_OSABI] & ELFOSABI_FREEBSD) {

            I think & is a typo. It sould be ==. And I suggest following
            code:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            } else if (hdr.elf.e_type == ET_DYN) {
                    is_shlib = 1;
                    if (hdr.elf.e_ident[EI_OSABI] != ELFOSABI_FREEBSD) {
                            warnx("%s: not a FreeBSD ELF shared "
                                    "object(OS type=%d)", *argv, hdr.elf.e_ident[EI_OSABI]);
                            /+ file_ok = 0; */
                    }
            }
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


  • Next message: Divacky Roman: "Re: Re: system password's file"