aboutsummaryrefslogtreecommitdiff
path: root/libexec/rtld-elf/rtld.1
Commit message (Collapse)AuthorAgeFilesLines
* Import the DragonFly BSD commit 4f0bc915b65fcf5a23214f6d221d65c80be68ad4Konstantin Belousov2012-07-151-7/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | by John Marino <draco@marino.st>, with the following (edited) commit message Date: Sat, 24 Mar 2012 06:40:50 +0100 Subject: [PATCH 1/1] rtld: Implement DT_RUNPATH and -z nodefaultlib DT_RUNPATH is incorrectly being considered as an alias of DT_RPATH. The purpose of DT_RUNPATH is to have two different types of rpath: one that can be overridden by the environment variable LD_LIBRARY_PATH and one that can't. With the currently implementation, LD_LIBRARY_PATH will always trump any embedded rpath or runpath tags. Current path search order by rtld: ================================== LD_LIBRARY_PATH DT_RPATH / DT_RUNPATH (always the same) ldconfig hints file (default: /var/run/ld-elf.so.hints) /usr/lib New path search order by rtld: ============================== DT_RPATH of the calling object if no DT_RUNPATH DT_RPATH of the main binary if no DT_RUNPATH and binary isn't calling obj LD_LIBRARY_PATH DT_RUNPATH ldconfig hints file /usr/lib The new path search matches how the linux runtime loader works. The other major added feature is support for linker flag "-z nodefaultlib". When this flag is passed to the linker, rtld will skip all references to the standard library search path ("/usr/lib" in this case but it could handle more color delimited paths) except in DT_RPATH and DT_RUNPATH. New path search order by rtld with -z nodefaultlib flag set: ============================================================ DT_RPATH of the calling object if no DT_RUNPATH DT_RPATH of the main binary if no DT_RUNPATH and binary isn't calling obj LD_LIBRARY_PATH DT_RUNPATH ldconfig hints file (skips all references to /usr/lib) FreeBSD notes: - we fixed some bugs which were submitted to DragonFly and merged there as commit 1ff8a2bd3eb6e5587174c6a983303ea3a79e0002; - we added LD_LIBRARY_PATH_RPATH environment variable to switch to the previous behaviour of considering DT_RPATH a synonym for DT_RUNPATH; - the FreeBSD default search path is /lib:/usr/lib and not /usr/lib. Reviewed by: kan MFC after: 1 month MFC note: flip the ld_library_path_rpath default value for stable/9 Notes: svn path=/head/; revision=238471
* Implement support for ELF filters in rtld. Both normal and auxillaryKonstantin Belousov2010-12-251-0/+8
| | | | | | | | | | | | | | | | | | | | filters are implemented. Filtees are loaded on demand, unless LD_LOADFLTR environment variable is set or -z loadfltr was specified during the linking. This forces rtld to upgrade read-locked rtld_bind_lock to write lock when it encounters an object with filter during symbol lookup. Consolidate common arguments of the symbol lookup functions in the SymLook structure. Track the state of the rtld locks in the RtldLockState structure. Pass local RtldLockState through the rtld symbol lookup calls to allow lock upgrades. Reviewed by: kan Tested by: Mykola Dzham <i levsha me>, nwhitehorn (powerpc) Notes: svn path=/head/; revision=216695
* mdoc: drop redundant .Pp and .LP callsUlrich Spörlein2010-10-081-1/+0
| | | | | | | They have no effect when coming in pairs, or before .Bl/.Bd Notes: svn path=/head/; revision=213573
* Document RTLD_NODELETE, -z nodelete and -z origin support.Konstantin Belousov2009-04-011-1/+20
| | | | Notes: svn path=/head/; revision=190624
* Support for a new environment variable, LD_ELF_HINTS_PATH for overridingXin LI2009-03-231-1/+6
| | | | | | | | | | | | | | the rtld hints file. This environment variable would be unset if the process is considered as tainted with setuid/setgid. This feature gives a convenient way of using a custom set of shared library that is not located in the default location and switch back. Feature requested by: iXsystems Original patch by: John Hixson MFC after: 2 weeks Notes: svn path=/head/; revision=190324
* Make the meaning of the %A format specifier, as passed toBruce M Simpson2008-05-151-2/+5
| | | | | | | LD_TRACE_LOADED_OBJECTS_FMT[12], more obvious for users like me. Notes: svn path=/head/; revision=179012
* Update the man page to reflect that certain variables will be unset inChristian S.J. Peron2007-05-171-2/+4
| | | | | | | | the case that the program is set-user-ID or set-group-ID. Add missing annotations for LIBMAP and LIBMAP_DISABLE. Notes: svn path=/head/; revision=169663
* Remove %m formatter, it's ifdef 0'ed in the code from the very beginningPav Lucistnik2007-05-121-2/+0
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=169501
* Expand documentation for LD_TRACE_LOADED_OBJECTS_FMT? variablesPav Lucistnik2007-05-121-0/+6
| | | | | | | | | PR: docs/66265 (inspired by) Submitted by: Michel Lavondes <fox@vader.aacc.cc.md.us> MFC after: 1 week Notes: svn path=/head/; revision=169500
* Document LD_UTRACE.John Baldwin2007-01-231-2/+7
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=166205
* Markup fixes.Ruslan Ermilov2006-09-171-2/+4
| | | | Notes: svn path=/head/; revision=162387
* - Document LD_32_* environment variablesPav Lucistnik2006-03-271-2/+9
| | | | | | | | | - Mention 32-bit files in FILES section MFC after: 1 week Notes: svn path=/head/; revision=157169
* Removed trailing whitespace.Ruslan Ermilov2005-06-141-2/+2
| | | | | | | Approved by: re (blanket) Notes: svn path=/head/; revision=147365
* Description from Dan:Matthew N. Dodd2005-02-041-1/+14
| | | | | | | | | | | | | | | | | | Another handy libmap patch. Lets you do stuff like this: LD_LIBMAP="libpthread.so.1=libthr.so.1" mythreadedapp If you already have a program-specific override in libmap.conf, note that you must use a program-specific override in LD_LIBMAP: LD_LIBMAP="[mythreadedapp],libpthread.so.1=libthr.so.1" mythreadedapp PR: bin/74471 Submitted by: Dan Nelson <dnelson AT allantgroup.com> MFC after: 2 weeks Notes: svn path=/head/; revision=141232
* LD_DUMP_REL_PRE and LD_DUMP_REL_POST don't output to stderr; don'tMatthew N. Dodd2003-06-191-2/+2
| | | | | | | claim that they do. Notes: svn path=/head/; revision=116566
* Provide a mechanism for dumping relocation information.Matthew N. Dodd2003-06-191-0/+10
| | | | | | | | | | Setting the LD_DUMP_REL_PRE or LD_DUMP_REL_POST environment variables cause rtld-elf to output a table of all relocations. This is useful for debugging. Notes: svn path=/head/; revision=116563
* Assorted mdoc(7) fixes.Ruslan Ermilov2003-06-021-5/+5
| | | | Notes: svn path=/head/; revision=115697
* Use the environment variable LD_LIBMAP_DISABLE to disableMatthew N. Dodd2003-05-311-0/+3
| | | | | | | libmap.conf(5) functionality. Notes: svn path=/head/; revision=115444
* Since libmap.conf is referenced in rtld.1, include it in the referencesRobert Watson2003-05-171-0/+1
| | | | | | | | | section. Approved by: re (scottl) Notes: svn path=/head/; revision=115107
* mdoc(7) police: Normalize the FILES section.Ruslan Ermilov2003-05-161-2/+3
| | | | | | | Approved by: re (blanket) Notes: svn path=/head/; revision=115086
* Dynamic object dependency mapping: libmap.Matthew N. Dodd2003-04-071-0/+2
| | | | | | | | | | This is an optional feature, disabled by default. This will be useful to people testing the various POSIX threading libraries under -CURRENT but can easily serve other needs. Notes: svn path=/head/; revision=113229
* Advertize rtld(1) as ld.so(1) in manual pages worldAlexey Zelkin2003-02-131-0/+1
| | | | Notes: svn path=/head/; revision=110836
* Uniformly refer to a file system as "file system".Ruslan Ermilov2002-12-121-1/+1
| | | | | | | Approved by: re Notes: svn path=/head/; revision=107788
* The .Nm utilityPhilippe Charnier2002-07-061-2/+6
| | | | Notes: svn path=/head/; revision=99500
* Add support such that if LD_TRACE_LOADED_OBJECTS_ALL is defined to aDavid E. O'Brien2002-02-171-0/+5
| | | | | | | | | | | non-empty string in the environment; we indicate which objects caused each object to be loaded. PR: 30908 Submitted-by: Mike Meyer <mwm@mired.org> Notes: svn path=/head/; revision=90755
* mdoc(7) police: tidy up.Ruslan Ermilov2002-01-101-17/+25
| | | | Notes: svn path=/head/; revision=89230
* mdoc(7) police:Ruslan Ermilov2001-08-071-4/+2
| | | | | | | | | | Avoid using parenthesis enclosure macros (.Pq and .Po/.Pc) with plain text. Not only this slows down the mdoc(7) processing significantly, but it also has an undesired (in this case) effect of disabling hyphenation within the entire enclosed block. Notes: svn path=/head/; revision=81251
* mdoc(7) police: removed HISTORY info from the .Os call.Ruslan Ermilov2001-07-101-1/+1
| | | | Notes: svn path=/head/; revision=79529
* mdoc(7) police: remove extraneous .Pp before and/or after .Sh.Dima Dorfman2001-07-091-2/+0
| | | | Notes: svn path=/head/; revision=79454
* mdoc(7) police: sort SEE ALSO xrefs (sort -b -f +2 -3 +1 -2).Ruslan Ermilov2001-07-061-1/+1
| | | | Notes: svn path=/head/; revision=79366
* Prepare for mdoc(7)NG.Ruslan Ermilov2001-01-161-1/+1
| | | | Notes: svn path=/head/; revision=71099
* Prepare for mdoc(7)NG.Ruslan Ermilov2000-12-201-3/+5
| | | | Notes: svn path=/head/; revision=70227
* Only punctuation is an allowed argument type for open-close macrosSheldon Hearn2000-06-301-1/+2
| | | | | | | | | such as Po/Pc, as explained by phantom. Reported by: billf Notes: svn path=/head/; revision=62271
* Cross-reference ldd(1) in rtld(1) and vice versa.Sheldon Hearn2000-03-281-0/+1
| | | | Notes: svn path=/head/; revision=58720
* Add a manual page for the ELF dynamic linker. I initially createdJohn Polstra2000-01-291-98/+20
| | | | | | | | | rtld.1 by means of a repository copy from "src/libexec/rtld-aout/rtld.1". Then I edited it to make it (more) accurate for the ELF dynamic linker. Notes: svn path=/head/; revision=56790
* .Nm += "rtld"Alexey Zelkin1999-09-281-1/+2
| | | | | | | apropos(1) now knows about rtld(1) manpage. Notes: svn path=/head/; revision=51746
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50476
* spelling corrections.Wolfram Schneider1997-09-131-3/+3
| | | | | | | | PR: docs/4450 Submitted by: josh@quick.net Notes: svn path=/head/; revision=29329
* Typo fix.Masafumi Max NAKANE1997-05-271-3/+3
| | | | | | | | PR: 3693 Submitted by: Kazuo Horikawa <k-horik@yk.rim.or.jp> Notes: svn path=/head/; revision=26195
* Revert $FreeBSD$ to $Id$Peter Wemm1997-02-221-1/+1
| | | | Notes: svn path=/head/; revision=22996
* Pay attention to the environment variable "LD_IGNORE_MISSING_OBJECTS".John Polstra1997-01-171-1/+25
| | | | | | | | | | | | If it is set to a nonempty string, then simply skip any missing shared libraries. This came up in a discussion long ago as a potentially useful feature at sysinstall time. For example, an X11 utility could be used without the X libraries being present, provided the utility had a mode in which no X functions were actually called. Notes: svn path=/head/; revision=21819
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* Sort cross references.Wolfram Schneider1997-01-131-3/+3
| | | | Notes: svn path=/head/; revision=21635
* Correct typos and spelling errors.John Polstra1997-01-121-5/+5
| | | | Notes: svn path=/head/; revision=21578
* Add support for the LD_BIND_NOW environment variable. If it is set to aJohn Polstra1997-01-121-7/+17
| | | | | | | | | | | | | | | | | | | | | | | | nonempty string, then function calls are relocated at program start-up rather than lazily. This variable is standard on Sun and SVR4 systems. The dlopen() function now supports both lazy and immediate binding, as determined by its "mode" argument, which can be either 1 (RTLD_LAZY) or 2 (RTLD_NOW). I will add defines of these symbols to <dlfcn.h> as soon as I've done a little more checking to make sure they won't cause collisions or bootstrapping problems that would break "make world". The "LD_*" environment variables which alter dynamic linker behavior are now treated as unset if they are set to the empty string. This agrees with the standard SVR4 conventions for the dynamic linker. Add a work-around for programs compiled with certain buggy versions of crt0.o. The buggy versions failed to set the "crt_ldso" member of the interface structure. This caused certain error messages from the dynamic linker to begin with "(null)" instead of the pathname of the dynamic linker. Notes: svn path=/head/; revision=21577
* Fix spelling error in manpage.Steven Wallace1996-12-261-2/+2
| | | | Notes: svn path=/head/; revision=20930
* Fix two minor typos in the manual page.John Polstra1996-10-181-3/+3
| | | | Notes: svn path=/head/; revision=19010
* Update to handle new version ld.so.hints and info in executable forPeter Wemm1996-10-011-2/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | configurable fallback search paths, as well as new crt interface version. Also: - even faster getenv(), get all environment variable settings in a single pass. - ldd printf-like format specifications - minor code cleanups, one vsprintf -> vsnprintf (harmless) The library search sequence is a little more complete now. Before, it'd search $LD_LIBRARY_PATH (by opendir/readdir/closedir), then read the hints file, then read /usr/lib (again by scanning thr directory). It would then fail if there was no "found" library. Now, it does LD_LIBRARY_PATH and the hints file the same, but then uses a longer fallback path. The -R path is fetched from the executable if specified at build time, the ldconfig path is appended, and /usr/lib is appended to that. Duplicates are suppressed. This means that simply placing a new library in /usr/local/lib will work (the same as it did in /usr/lib) without needing ldconfig -m. It will find it quicker if the ldconfig is run though. Similar changes have been made to the NetBSD ld.so, but ours is rather different now due to John Polstra's speedups and fixes from a while back. The ldd printf-like format support came direct from NetBSD. Reviewed by: nate, jdp Notes: svn path=/head/; revision=18599
* add missing comma(s) in .Xr macrosWolfram Schneider1996-09-231-3/+3
| | | | Notes: svn path=/head/; revision=18480
* Implement support for LD_PRELOAD in the dynamic linker. RemoveJohn Polstra1996-04-201-10/+8
| | | | | | | | | | descriptions of LD_NO_INTERN_SEARCH and LD_NOSTD_PATH from the manual page, since they are not supported. Submitted by: Doug Ambrisko <ambrisko@ambrisko.roble.com> Notes: svn path=/head/; revision=15326