Commit Graph

39 Commits

Author SHA1 Message Date
Konstantin Belousov
1659238a0c Implement RTLD_DEEPBIND.
PR:	246462
Tested by:	Martin Birgmeier <d8zNeCFG@aon.at>
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D24841
2020-05-15 11:58:01 +00:00
Dag-Erling Smørgrav
c9cf7cb85b Revert r343093 until I can address the issues raised by kib@. 2019-01-17 16:50:50 +00:00
Dag-Erling Smørgrav
9b35e90238 Implement dlopenat(3).
MFC after:	3 weeks
2019-01-16 12:12:40 +00:00
Romain Tartière
2f1a2bdf81 Add man page for dlvsym(3)
Add a short description of the function to the appropriate man page and add
reference to it where it makes sense.

Reviewed by:	bcr, markj, 0mp
Approved by:	markj
Differential Revision:	https://reviews.freebsd.org/D18725
2019-01-03 21:31:17 +00:00
Konstantin Belousov
99ac8154ff Provide libdl.
Create libdl.so.1 as a filter for libc.so.7 which exports public dl*
functions. The functions are resolved from the rtld instead, the goal
of creating library is to avoid errors from the static linker due to
missed libdl. For static binaries, an empty .o is compiled into
libdl.a so that static binaries still get dl stubs from libc.a.

Right now lld cannot create filter objects, disable libdl on arm64
when binutils are not used.

Reviewed by:	bdrewery, dim (previos version); emaste
Exp run:	PR 220525, done by antoine
Sponsored by:	The FreeBSD Foundation
MFC after:	1 month
Differential revision:	https://reviews.freebsd.org/D11504
2017-07-10 14:59:21 +00:00
Tijl Coosemans
dac0a53840 The ld(1) flag is -Bsymbolic not -Wsymbolic. 2015-02-14 15:14:41 +00:00
Konstantin Belousov
5d8aec9c02 Implement fdlopen(3), an rtld interface to load shared object by file
descriptor.

Requested and tested by:	des (previous version)
Reviewed by:  des, kan (previous version)
MFC after:    2 weeks
2012-01-07 10:33:01 +00:00
Joel Dahl
c2025a7660 Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while
translating these manual pages.  Minor corrections by me.

Submitted by:	Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>
2010-08-16 15:18:30 +00:00
Ulrich Spörlein
aa12cea2cc mdoc: order prologue macros consistently by Dd/Dt/Os
Although groff_mdoc(7) gives another impression, this is the ordering
most widely used and also required by mdocml/mandoc.

Reviewed by:	ru
Approved by:	philip, ed (mentors)
2010-04-14 19:08:06 +00:00
Pietro Cerutti
071ab531db - Remove const'ness from dlerror(3) prototype, for consistency with POSIX.
Approved by:	cognet
MFC after:	1 week
2010-03-24 15:59:51 +00:00
Konstantin Belousov
49e8c06b45 Implement RTLD_NOLOAD flag for dlopen(3).
Requested and tested by:	jkim
Reviewed by:	kan
Approved by:	re (kensmith)
2009-07-17 19:45:42 +00:00
Konstantin Belousov
b2e4ce45d9 Document RTLD_NODELETE, -z nodelete and -z origin support. 2009-04-01 14:38:20 +00:00
Peter Pentchev
c56864a7a7 Fix the ordering in the description of the dlsym() lookup procedure to
reflect src/libexec/rtld-elf/rtld.c rev. 1.68 - the globally-loaded
objects (RTLD_GLOBAL) are searched before the local object's DAG's.

PR:		62770
Submitted by:	Kimura Fuyuki <fuyuki@nigredo.org>
2004-06-03 10:13:26 +00:00
Alexey Zelkin
e859833529 Mention that dlerror() is also applicable to retrieve error message after
dladdr() and dlinfo() functions calls.
2003-02-21 13:43:41 +00:00
Alexey Zelkin
7ec37597d3 o Document that dlsym()'s behaviour with new special handle RTLD_SELF
o Add cross reference to dlinfo(3)
o Minor mdoc nits
2003-02-14 10:57:20 +00:00
Ruslan Ermilov
2efeeba554 mdoc(7) police: "The .Fa argument.". 2002-12-19 09:40:28 +00:00
Ruslan Ermilov
95f4226b27 mdoc(7) police: "The .Fn function". 2002-12-18 10:13:54 +00:00
Mike Barcroft
a4a96c8166 Add `restrict' type-qualifier. 2002-09-11 05:05:48 +00:00
Ruslan Ermilov
760d968629 mdoc(7) police: laundry. 2002-08-09 11:06:03 +00:00
Garrett Wollman
fda2301943 Since POSIX gives us plenary authority to define _t types, change
__dlfunc_t to dlfunc_t to match what I have proposed to the Austin
Group.  (This also makes it easier for applications to store these
values before they decide what to do with them, e.g., in a wrapper
function.)
2002-05-29 19:35:13 +00:00
Garrett Wollman
dc12134a80 Reorganize dlfcn.h slightly to separate out XSI and BSD interfaces.
Add new dlfunc() interface, which is a version of dlsym() with a
return type that can be cast to a function pointer without turning
your computer into a frog.

Reviewed by:	freebsd-standards
2002-05-29 16:25:43 +00:00
Maxim Sobolev
c6de4ce791 Allow ldd(1) be used on shared libraries in addition to executables. 2002-02-04 10:33:48 +00:00
Ruslan Ermilov
32eef9aeb1 mdoc(7) police: Use the new .In macro for #include statements. 2001-10-01 16:09:29 +00:00
Ruslan Ermilov
a307d59838 mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 13:41:46 +00:00
Dima Dorfman
4088069c3a Xref dladdr(3).
Requested by:	-hackers
2001-06-08 22:50:33 +00:00
Ruslan Ermilov
d0353b836e mdoc(7) police: split punctuation characters + misc fixes. 2001-02-01 16:38:02 +00:00
Ruslan Ermilov
4263595653 Prepare for mdoc(7)NG. 2000-12-29 14:08:20 +00:00
Jeroen Ruigrok van der Werven
5714e85318 Whitespace only change: trim trailing whitespace. 2000-10-30 13:23:19 +00:00
John Polstra
7f244df88e Document RTLD_DEFAULT and the search algorithm used for resolving
undefined symbols.
2000-09-19 04:28:34 +00:00
John Polstra
07f643a52b Make a somewhat unsatisfactory attempt to describe the effects of
the RTLD_GLOBAL and RTLD_LOCAL flags which can be passed to dlopen().
2000-09-19 04:02:05 +00:00
Alexey Zelkin
25bb73e063 Introduce ".Lb" macro to libc manpages.
More libraries manpages updates following.
2000-04-21 09:42:15 +00:00
Joerg Wunsch
c786c636ba It is no longer necessary to prepend underscores to external symbols under
ELF.

Submitted by:	A.Leidinger@WJPServer.CS.Uni-SB.de (Alexander Leidinger)
1999-11-02 18:18:26 +00:00
Peter Wemm
7f3dea244c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
Nik Clayton
fbc400a67a Add $Id$, to make it simpler for members of the translation teams to
track.

The $Id$ line is normally at the bottom of the main comment block in the
man page, separated from the rest of the manpage by an empty comment,
like so;

     .\"    $Id$
     .\"

If the immediately preceding comment is a @(#) format ID marker than the
the $Id$ will line up underneath it with no intervening blank lines.
Otherwise, an additional blank line is inserted.

Approved by:            bde
1999-07-12 20:50:10 +00:00
John Polstra
6d30b16752 Back out my change from 6 April PDT that added a new dlversion()
function.  It was an ill-considered feature.  It didn't solve the
problem I wanted it to solve.   And it added Yet Another Version
Number that would have to be maintained at every release point.
I'm nuking it now before anybody grows too fond of it.
1999-04-22 01:54:38 +00:00
John Polstra
14f5fa0596 Add a new function dlversion() which returns the version number of
the dynamic linker in the same form as __FreeBSD_version.  This is
mainly intended for checking the dynamic linker version during a make
world.
1999-04-07 02:43:11 +00:00
Joseph Koshy
f28529d798 Add a note about ELF executables requiring to be linked with -export-dynamic
for dlsym() searches inside the executable to work.
1999-02-17 02:41:04 +00:00
Joseph Koshy
6e2affc98f Correct a typo that I noticed. 1998-09-15 00:24:19 +00:00
John Polstra
645c4be38a Move the trampolines for dlopen and related functions from crt0.o
into libc.  This reduces the size of every dynamically linked
executable by 248 bytes, and it reduces the size of static executables
by a lesser amount.  It also eliminates some global namespace
pollution.

With this change in place, the source for dlfcn.h should probably
be moved to "/usr/src/include".  I'll save that for another day.

Compatibility note:  Programs which use dlopen, if compiled on
systems with this change, will not run on systems with a libc from
prior to this change.  Very few programs use dlopen, so I think
that is OK.
1998-02-09 06:05:25 +00:00