The NetBSD Project

CVS log for src/libexec/ld.elf_so/search.c

[BACK] Up to [] / src / libexec / ld.elf_so

Request diff between arbitrary revisions

Default branch: MAIN

Revision 1.27 / (download) - annotate - [select for diffs], Wed Apr 22 23:54:32 2020 UTC (8 months, 3 weeks ago) by joerg
Branch: MAIN
Changes since 1.26: +3 -3 lines
Diff to previous 1.26 (colored)

Mark _rtld_invalid_paths static as ldd can end up with two copies

Revision / (download) - annotate - [select for diffs], Mon Apr 13 08:03:17 2020 UTC (9 months ago) by martin
Branch: phil-wifi
Changes since +3 -3 lines
Diff to previous (colored) to branchpoint 1.24 (colored) next main 1.25 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.26 / (download) - annotate - [select for diffs], Sun Oct 13 20:18:42 2019 UTC (15 months ago) by mrg
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, is-mlppp-base, is-mlppp
Changes since 1.25: +3 -3 lines
Diff to previous 1.25 (colored)

use strlcpy to ensure termination.

the buffer is statically sized so that it works without an
allocator, so truncation is the desired effect here.

Revision / (download) - annotate - [select for diffs], Mon Jun 10 22:05:29 2019 UTC (19 months, 1 week ago) by christos
Branch: phil-wifi
Changes since 1.24: +5 -3 lines
Diff to previous 1.24 (colored)

Sync with HEAD

Revision / (download) - annotate - [select for diffs], Fri Jan 18 08:50:11 2019 UTC (2 years ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.24: +5 -3 lines
Diff to previous 1.24 (colored) next main 1.25 (colored)

Synch with HEAD

Revision 1.25 / (download) - annotate - [select for diffs], Sat Jan 12 18:58:10 2019 UTC (2 years ago) by christos
Branch: MAIN
CVS Tags: phil-wifi-20190609, pgoyette-compat-20190127, pgoyette-compat-20190118, netbsd-9-base, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9
Changes since 1.24: +5 -3 lines
Diff to previous 1.24 (colored)

print the program name when we don't find a library.
XXX: really most _rtld_error() should do that, and most do.

Revision / (download) - annotate - [select for diffs], Thu May 22 11:37:13 2014 UTC (6 years, 8 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.23: +3 -3 lines
Diff to previous 1.23 (colored) next main 1.24 (colored)

sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")

Revision / (download) - annotate - [select for diffs], Sun Jun 23 06:28:50 2013 UTC (7 years, 6 months ago) by tls
Branch: tls-maxphys
Changes since 1.23: +3 -3 lines
Diff to previous 1.23 (colored) next main 1.24 (colored)

resync from head

Revision 1.24 / (download) - annotate - [select for diffs], Mon May 6 08:02:20 2013 UTC (7 years, 8 months ago) by skrll
Branch: MAIN
CVS Tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, pgoyette-compat-base, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: phil-wifi, pgoyette-compat
Changes since 1.23: +3 -3 lines
Diff to previous 1.23 (colored)

Trailing whitespace

Revision 1.23 / (download) - annotate - [select for diffs], Fri Dec 24 12:41:43 2010 UTC (10 years ago) by skrll
Branch: MAIN
CVS Tags: yamt-pagecache-tag8, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, matt-mips64-premerge-20101231, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2, agc-symver-base, agc-symver
Branch point for: yamt-pagecache, tls-maxphys
Changes since 1.22: +20 -9 lines
Diff to previous 1.22 (colored)

Add support for DF_1_BIND_NOW, DF_1_NODELETE and DF_1_NOOPEN marked
objects, and the RTLD_NODELETE and RTLD_NOLOAD flags to dlopen(3).

Mark libpthread as DF_1_NOOPEN and use it to test the functionality.

Somewhat taken from FreeBSD.

Fixes PR 42029.

OK from christos and joerg.

Revision 1.22 / (download) - annotate - [select for diffs], Sat Aug 7 19:47:34 2010 UTC (10 years, 5 months ago) by joerg
Branch: MAIN
Changes since 1.21: +6 -4 lines
Diff to previous 1.21 (colored)

Stricter matching for _rtld_invalid_paths by ensuring separator.
Use mem* functions instead of str* for strings of known size.

Revision 1.21 / (download) - annotate - [select for diffs], Tue Mar 21 17:48:10 2006 UTC (14 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-pf42-base, yamt-pf42, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, wrstuden-revivesa, wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, netbsd-4, mjf-devfs2-base, mjf-devfs2, matt-premerge-20091211, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2, matt-mips64-base, matt-mips64, matt-armv6-prevmlocking, matt-armv6-nbase, matt-armv6-base, matt-armv6, keiichi-mipv6-base, keiichi-mipv6, jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend, hpcarm-cleanup-nbase, hpcarm-cleanup-base, hpcarm-cleanup, cube-autoconf-base, cube-autoconf, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.20: +8 -19 lines
Diff to previous 1.20 (colored)

Coverity CID 2749: Fix another double free. Instead of removing that last
free() call, change the allocation policy to leave the responsibility for
allocation/freeing the pathname to _rtld_map_object(), instead of having
the caller allocate it and _rtld_map_object() free it. This simplifies the
code a lot and it is more efficient.

Revision 1.20 / (download) - annotate - [select for diffs], Sat Mar 18 02:34:30 2006 UTC (14 years, 10 months ago) by matt
Branch: MAIN
Changes since 1.19: +15 -6 lines
Diff to previous 1.19 (colored)

Fix some double frees / missing frees / use after freed all
relating to _rtld_load_object.  Fix Coverity CID 2601, 2600.

Revision 1.19 / (download) - annotate - [select for diffs], Fri Oct 22 05:39:57 2004 UTC (16 years, 3 months ago) by skrll
Branch: MAIN
CVS Tags: netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3
Changes since 1.18: +6 -1 lines
Diff to previous 1.18 (colored)

Add __RCSIDs.

OK'd by mycroft.

Revision / (download) - annotate - [select for diffs], Fri May 28 08:31:22 2004 UTC (16 years, 7 months ago) by tron
Branch: netbsd-1-6
Changes since 1.10: +74 -102 lines
Diff to previous 1.10 (colored) next main 1.11 (colored)

Apply patch (request by skrll in ticket #1702):
Bring "ld.elf_so" (mostly) in sync with NetBSD-current:
- MI and MD (e.g. under NetBSD-alpha) performance improvements
- much better structured code
- closes PR bin/25464

Revision 1.18 / (download) - annotate - [select for diffs], Tue Aug 12 09:18:50 2003 UTC (17 years, 5 months ago) by skrll
Branch: MAIN
CVS Tags: netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-base, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2-0, netbsd-2
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (colored)

Resolve dlsym(3) and friends directly so that dlsym(RTLD_NEXT,...) works.

Previously dlsym resolved to the version in crt0.o or libc which would
mean that the caller's shared object couldn't be determined correctly
using __builtin_return_address(0).

Mainly from FreeBSD, but adapted by me. Benefits of this solutions are:

	- backward comptibility maintained
	- existing broken binaries are fixed with a new ld.elf_so
	- __mainprog_obj can be removed from crt0.o
	- we do the same thing as FreeBSD

Fixes PR 22067.

OKed by Jason and Christos.

Revision 1.17 / (download) - annotate - [select for diffs], Thu Jul 24 10:12:26 2003 UTC (17 years, 6 months ago) by skrll
Branch: MAIN
Changes since 1.16: +6 -13 lines
Diff to previous 1.16 (colored)

ANSIfy and de-__P().

Revision 1.16 / (download) - annotate - [select for diffs], Thu Nov 14 21:07:46 2002 UTC (18 years, 2 months ago) by nathanw
Branch: MAIN
CVS Tags: fvdl_fs64_base
Changes since 1.15: +25 -4 lines
Diff to previous 1.15 (colored)

In _rtld_load_library(), ensure that the old _rtld_error state (a message from
a previous error, or NULL) is preserved if the search eventually succeeds.

Addresses the problem pointed out in PR pkg/19024.

Revision 1.15 / (download) - annotate - [select for diffs], Sat Oct 5 11:59:04 2002 UTC (18 years, 3 months ago) by mycroft
Branch: MAIN
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored)

Minor cleanup.

Revision 1.14 / (download) - annotate - [select for diffs], Tue Oct 1 14:16:53 2002 UTC (18 years, 3 months ago) by junyoung
Branch: MAIN
Changes since 1.13: +25 -4 lines
Diff to previous 1.13 (colored)

Store pathnames of shared objects not found in search paths in cache
and utilize it. This greatly reduces the number of calls to open(2) and
malloc(3) for programs like mozilla that depend on many shared objects
while it doesn't affect performance of small programs.

Revision 1.13 / (download) - annotate - [select for diffs], Tue Sep 24 12:52:20 2002 UTC (18 years, 3 months ago) by mycroft
Branch: MAIN
Changes since 1.12: +2 -17 lines
Diff to previous 1.12 (colored)

Remove the SVR4_LIBDIR madness.

Revision 1.12 / (download) - annotate - [select for diffs], Tue Sep 24 00:02:46 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.11: +7 -8 lines
Diff to previous 1.11 (colored)

Very minor cleanup of the previous.

Revision 1.11 / (download) - annotate - [select for diffs], Mon Sep 23 23:56:49 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.10: +34 -81 lines
Diff to previous 1.10 (colored)

Several small changes that shave 7-8% off the simple-exec-loop test:

* Rename _rtld_find_library() to _rtld_load_library().  It now calls
  _rtld_load_object() if necessary to actually load the object, rather
  than having the caller do it.  To do this, it also takes the `mode'
  argument that gets passed to _rtld_load_object().

* On a related note, remove _rtld_check_library(), and instead call
  _rtld_load_object() to instead try actually loading the object.  We
  save two extra namei's and a bunch of redundant work (almost
  literally the same code) this way.

* In _rtld_map_object(), mmap(2) the first page read-only, rather than
  read(2)ing it.

* In _rtld_symlook_obj(), compare the *second* character of the symbol
  name before calling strcmp().  (This first character is too
  frequently `_', and turns out to not be helpful, in libc.)

* Also in _rtld_symlook_obj(), remove the bogus STT_FUNC special case
  -- this also allows removing the `in_plt' argument to
  _rtld_symlook_list() and _rtld_symlook_obj().


* In _rtld_obj_from_addr(), rather than trying to look up `_end' in
  the each object, instead use obj->mapsize as the upper bound.

Revision / (download) - annotate - [select for diffs], Sun Dec 9 17:22:04 2001 UTC (19 years, 1 month ago) by he
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-PATCH003
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored) next main 1.10 (colored)

Pull up revision 1.10 (requested by skrll):
  Add init/fini section support in crtbegin and crtend, and introduce
  support for DWARF2 exception handling.  Fixes PR#12865, PR#13488,
  PR#13489, and PR#13491.  Also fix ld.elf_so to deal appropriately.

Revision 1.10 / (download) - annotate - [select for diffs], Thu Jul 27 10:44:39 2000 UTC (20 years, 5 months ago) by kleink
Branch: MAIN
CVS Tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001
Branch point for: netbsd-1-6
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

Adjust a comment after the Great Renaming.

Revision / (download) - annotate - [select for diffs], Mon Dec 27 18:30:15 1999 UTC (21 years ago) by wrstuden
Branch: wrstuden-devbsize
Changes since 1.5: +7 -12 lines
Diff to previous 1.5 (colored) next main 1.6 (colored)

Pull up to last week's -current.

Revision 1.9 / (download) - annotate - [select for diffs], Thu Nov 4 02:00:18 1999 UTC (21 years, 2 months ago) by erh
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, minoura-xpg4dl-base, minoura-xpg4dl, comdex-fall-1999-base, comdex-fall-1999
Branch point for: netbsd-1-5
Changes since 1.8: +1 -7 lines
Diff to previous 1.8 (colored)

Remove ELFNAME defines since they are defined in sys/exec_elf.h

Revision 1.8 / (download) - annotate - [select for diffs], Mon Oct 25 13:57:12 1999 UTC (21 years, 3 months ago) by kleink
Branch: MAIN
Changes since 1.7: +7 -6 lines
Diff to previous 1.7 (colored)

Update to match new SVR4-style definition names in <sys/exec_elf.h>.

Revision 1.7 / (download) - annotate - [select for diffs], Fri Oct 22 10:39:16 1999 UTC (21 years, 3 months ago) by hannken
Branch: MAIN
Changes since 1.6: +6 -0 lines
Diff to previous 1.6 (colored)

Undo last change. While these macros are defined in exec_elf.h, they are
enclosed by `#ifdef _KERNEL'.

Revision 1.6 / (download) - annotate - [select for diffs], Thu Oct 21 21:15:04 1999 UTC (21 years, 3 months ago) by erh
Branch: MAIN
Changes since 1.5: +1 -7 lines
Diff to previous 1.5 (colored)

Remove ELFNAME macros which are already defines in exec_elf.h

Revision 1.5 / (download) - annotate - [select for diffs], Sun Aug 1 19:47:07 1999 UTC (21 years, 5 months ago) by kleink
Branch: MAIN
Branch point for: wrstuden-devbsize
Changes since 1.4: +9 -4 lines
Diff to previous 1.4 (colored)

Rearrange the shared library search path precedences to LD_LIBRARY_PATH >
runpath > built-in default; this is the behaviour of the SVR4 shared loader,
and gives users the opportunity to override the runpath.  (Addresses a report
on current-users by John Kohl.)

Revision 1.4 / (download) - annotate - [select for diffs], Mon Mar 1 16:40:07 1999 UTC (21 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH003, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001, netbsd-1-4
Changes since 1.3: +85 -70 lines
Diff to previous 1.3 (colored)


Revision 1.3 / (download) - annotate - [select for diffs], Mon Feb 17 19:32:05 1997 UTC (23 years, 11 months ago) by cgd
Branch: MAIN
CVS Tags: netbsd-1-3-base, netbsd-1-3-RELEASE, netbsd-1-3-PATCH003-CANDIDATE2, netbsd-1-3-PATCH003-CANDIDATE1, netbsd-1-3-PATCH003-CANDIDATE0, netbsd-1-3-PATCH003, netbsd-1-3-PATCH002, netbsd-1-3-PATCH001, netbsd-1-3-BETA, netbsd-1-3
Changes since 1.2: +45 -204 lines
Diff to previous 1.2 (colored)

use 'normal' ELF library lookup rules

Revision 1.2 / (download) - annotate - [select for diffs], Mon Feb 3 19:45:02 1997 UTC (23 years, 11 months ago) by cgd
Branch: MAIN
Changes since 1.1: +2 -1 lines
Diff to previous 1.1 (colored)

that which thou openest, thou shalt close.

Revision 1.1 / (download) - annotate - [select for diffs], Mon Dec 16 20:38:05 1996 UTC (24 years, 1 month ago) by cgd
Branch: MAIN

First cut at an ELF shared loader.  Originally from John Polstra's FreeBSD elf
kit, then hacked on by Matt Thomas <>, then by me (to
make it work with new versions of the toolchain, etc.).  This runs, but it's
in serious need of cleaning and/or a fair bit of reworking.  See the README
file for more information, and a list of things to do.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

CVSweb <>