Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Jan 1996 18:00:10 -0800
From:      John Polstra <jdp@polstra.com>
To:        hasty@rah.star-gate.com
Cc:        freebsd-hackers@freebsd.org, jkh@freebsd.org
Subject:   Re: Anyone got GNU `dld' ported to FreeBSD? 
Message-ID:  <199601060200.SAA03676@austin.polstra.com>
In-Reply-To: <199601041943.LAA05776@rah.star-gate.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In article <199601041943.LAA05776@rah.star-gate.com> Amancio writes:
> >>> "Jordan K. Hubbard" said:
>  > Ours works just fine too, but I can't use dynamic linking from a
>  > statically-linked application, which is what sysinstall needs to be.
> 
> What is your problem exactly when you try to use dlopen in a statically
> compiled program?

The dlopen and related functions are implemented in the dynamic linker,
/usr/libexec/ld.so.  The dynamic linker is itself a shared library.  It
is mapped into the address space (i.e., it is made available) only for
dynamically-linked programs.  So if your program is statically linked,
it does not have access to the dl* functions.

This is exactly the same behavior as SVR4 and SunOS, by the way.

Also, a few people referred to the "static crt0.o" and the "dynamic
crt0.o".  There is only one crt0.o.  It decides whether or not to invoke
the dynamic linker, according to whether the program being run is
dynamically linked.

I suppose it might be possible to add support for the dl* functions into
the static libc.a.  I haven't thought through the ramifications of that.

-- 
   John Polstra                                       jdp@polstra.com
   John D. Polstra & Co., Inc.                Seattle, Washington USA
   "Self-knowledge is always bad news."                 -- John Barth



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199601060200.SAA03676>