The NetBSD Project

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

[BACK] Up to [cvs.NetBSD.org] / src / libexec / ld.elf_so

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.207 / (download) - annotate - [select for diffs], Tue Sep 22 00:41:27 2020 UTC (3 months, 4 weeks ago) by kamil
Branch: MAIN
CVS Tags: HEAD
Changes since 1.206: +3 -3 lines
Diff to previous 1.206 (colored)

Correct r_ldbase valuse

It shall be the relocbase value, not linkmap.

Revision 1.206 / (download) - annotate - [select for diffs], Mon Sep 21 16:08:57 2020 UTC (3 months, 4 weeks ago) by kamil
Branch: MAIN
Changes since 1.205: +8 -6 lines
Diff to previous 1.205 (colored)

Upgrade the SVR4 RTLD r_debug protocol to version 1

Changes:
 - Add a new field r_ldbase in the r_debug struct.
 - Set r_version to 1.

This harmonizes the support with OpenBSD and Linux.
FreeBSD uses version 0 (or no version).
Solaris uses version 2 that is not implemented elsewhere and relies on
SVR4 specific design and interfaces.

Update the code comments as r_debug and link_map is used by other software
than GDB, namely: sanitizers, rump, LLDB.

Revision 1.197.2.4 / (download) - annotate - [select for diffs], Wed May 13 18:08:38 2020 UTC (8 months, 1 week ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-1-RELEASE
Changes since 1.197.2.3: +19 -2 lines
Diff to previous 1.197.2.3 (colored) to branchpoint 1.197 (colored) next main 1.198 (colored)

Pull up following revision(s) (requested by chs in ticket #907):

	libexec/ld.elf_so/rtld.c: revision 1.205
	libexec/ld.elf_so/rtld.h: revision 1.140
	libexec/ld.elf_so/symbols.map: revision 1.3
	libexec/ld.elf_so/symbols.map: revision 1.4
	lib/libc/gen/pthread_atfork.c: revision 1.13
	lib/libc/gen/pthread_atfork.c: revision 1.14
	libexec/ld.elf_so/rtld.h: revision 1.139
	libexec/ld.elf_so/rtld.c: revision 1.204

Introduce intermediate locking for fork, so that the dynamic linker is
in a consistent state. This most importantly avoids races between dlopen
and friends and fork, potentially resulting in dead locks in the child
when it itself tries to acquire locks.

Rename __atomic_fork to __locked_fork and give it &errno as argument.
rtld and libc use different storage, so the initial version would
incorrectly report the failure reason for fork().

There is still a small race condition inside ld.elf_so as it doesn't use
thread-safe errno internally, but that's a more contained internal
issue.

Revision 1.192.2.4 / (download) - annotate - [select for diffs], Tue Apr 21 18:42:00 2020 UTC (9 months ago) by martin
Branch: phil-wifi
Changes since 1.192.2.3: +17 -0 lines
Diff to previous 1.192.2.3 (colored) to branchpoint 1.192 (colored) next main 1.193 (colored)

Sync with HEAD

Revision 1.205 / (download) - annotate - [select for diffs], Sun Apr 19 01:06:15 2020 UTC (9 months ago) by joerg
Branch: MAIN
CVS Tags: phil-wifi-20200421
Changes since 1.204: +5 -3 lines
Diff to previous 1.204 (colored)

Rename __atomic_fork to __locked_fork and give it &errno as argument.
rtld and libc use different storage, so the initial version would
incorrectly report the failure reason for fork().

There is still a small race condition inside ld.elf_so as it doesn't use
thread-safe errno internally, but that's a more contained internal
issue.

Revision 1.204 / (download) - annotate - [select for diffs], Thu Apr 16 14:39:58 2020 UTC (9 months ago) by joerg
Branch: MAIN
Changes since 1.203: +17 -2 lines
Diff to previous 1.203 (colored)

Introduce intermediate locking for fork, so that the dynamic linker is
in a consistent state. This most importantly avoids races between dlopen
and friends and fork, potentially resulting in dead locks in the child
when it itself tries to acquire locks.

Revision 1.192.2.3 / (download) - annotate - [select for diffs], Mon Apr 13 08:03:17 2020 UTC (9 months, 1 week ago) by martin
Branch: phil-wifi
Changes since 1.192.2.2: +36 -16 lines
Diff to previous 1.192.2.2 (colored) to branchpoint 1.192 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.192.2.2 / (download) - annotate - [select for diffs], Wed Apr 8 14:07:17 2020 UTC (9 months, 1 week ago) by martin
Branch: phil-wifi
Changes since 1.192.2.1: +31 -17 lines
Diff to previous 1.192.2.1 (colored) to branchpoint 1.192 (colored)

Merge changes from current as of 20200406

Revision 1.197.2.3 / (download) - annotate - [select for diffs], Sun Mar 8 10:22:29 2020 UTC (10 months, 2 weeks ago) by martin
Branch: netbsd-9
Changes since 1.197.2.2: +17 -5 lines
Diff to previous 1.197.2.2 (colored) to branchpoint 1.197 (colored)

Pull up following revision(s) (requested by thorpej in ticket #758):

	libexec/ld.elf_so/map_object.c: revision 1.61
	libexec/ld.elf_so/headers.c: revision 1.68
	libexec/ld.elf_so/rtld.c: revision 1.203

PT_GNU_RELRO segments are arranged such that their vaddr + memsz ends
on a linker common page size boundary.  However, if the common page size
used by the linker is less than the VM page size being used by the kernel,
this can end up in the middle of a VM page and when the region is write-
protected, this can cause objects in neighboring .data to get incorrectly
write-protected, resulting in a crash.

Avoid this situation by calculating the end of the RELRO region not by
rounding memsz up to the VM page size, but rather by adding vaddr + memsz
and then truncating to the VM page size.

Fixes PR toolchain/55043.

XXX pullup-9

Revision 1.203 / (download) - annotate - [select for diffs], Wed Mar 4 01:21:17 2020 UTC (10 months, 2 weeks ago) by thorpej
Branch: MAIN
CVS Tags: phil-wifi-20200411, phil-wifi-20200406
Changes since 1.202: +17 -5 lines
Diff to previous 1.202 (colored)

PT_GNU_RELRO segments are arranged such that their vaddr + memsz ends
on a linker common page size boundary.  However, if the common page size
used by the linker is less than the VM page size being used by the kernel,
this can end up in the middle of a VM page and when the region is write-
protected, this can cause objects in neighboring .data to get incorrectly
write-protected, resulting in a crash.

Avoid this situation by calculating the end of the RELRO region not by
rounding memsz up to the VM page size, but rather by adding vaddr + memsz
and then truncating to the VM page size.

Fixes PR toolchain/55043.

XXX pullup-9

Revision 1.202 / (download) - annotate - [select for diffs], Sat Feb 29 04:23:05 2020 UTC (10 months, 3 weeks ago) by kamil
Branch: MAIN
CVS Tags: is-mlppp-base, is-mlppp
Changes since 1.201: +16 -14 lines
Diff to previous 1.201 (colored)

Implement and integrate GNU Hashing function

Define Elf_Hash struct that contains ELF/SYSV and GNU hash checksum.
Implement _rtld_gnu_hash() for DT_GNU_HASH.
Adapt existing code to compute all Elf_Hash types, instead of only
the ELF/SYSV one.
Rename _rtld_elf_hash() to _rtld_sysv_hash() to match the GNU toolchain
terminology.

_rtld_gnu_hash() uses Dan Bernstein's string hash function posted eons ago
on comp.lang.c.

Revision 1.197.2.2 / (download) - annotate - [select for diffs], Mon Dec 9 16:12:16 2019 UTC (13 months, 1 week ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-0-RELEASE, netbsd-9-0-RC2
Changes since 1.197.2.1: +3 -3 lines
Diff to previous 1.197.2.1 (colored) to branchpoint 1.197 (colored)

Pull up following revision(s) (requested by uwe in ticket #534):

	libexec/ld.elf_so/rtld.c: revision 1.201

_rtld_relro - fix debug printf format for a size_t argument

Revision 1.201 / (download) - annotate - [select for diffs], Sun Dec 8 22:35:27 2019 UTC (13 months, 1 week ago) by uwe
Branch: MAIN
Changes since 1.200: +3 -3 lines
Diff to previous 1.200 (colored)

_rtld_relro - fix debug printf format for a size_t argument

Revision 1.200 / (download) - annotate - [select for diffs], Fri Oct 4 01:57:53 2019 UTC (15 months, 2 weeks ago) by christos
Branch: MAIN
CVS Tags: phil-wifi-20191119
Changes since 1.199: +4 -4 lines
Diff to previous 1.199 (colored)

use __func__ (c99, c++11) instead of __FUNCTION__

Revision 1.199 / (download) - annotate - [select for diffs], Thu Oct 3 10:34:30 2019 UTC (15 months, 2 weeks ago) by tnn
Branch: MAIN
Changes since 1.198: +4 -4 lines
Diff to previous 1.198 (colored)

improve error message

Revision 1.197.2.1 / (download) - annotate - [select for diffs], Wed Sep 18 16:09:07 2019 UTC (16 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-0-RC1
Changes since 1.197: +36 -16 lines
Diff to previous 1.197 (colored)

Pull up following revision(s) (requested by kamil in ticket #209):

	libexec/ld.elf_so/rtld.c: revision 1.198

Return the ELF loader dl_phdr_info information for dl_iterate_phdr(3)
Sync the behavior of dl_iterate_phdr(3) with Linux/FreeBSD/OpenBSD.

Revision 1.198 / (download) - annotate - [select for diffs], Sun Sep 15 13:40:46 2019 UTC (16 months ago) by kamil
Branch: MAIN
Changes since 1.197: +36 -16 lines
Diff to previous 1.197 (colored)

Return the ELF loader dl_phdr_info information for dl_iterate_phdr(3)

Sync the behavior of dl_iterate_phdr(3) with Linux/FreeBSD/OpenBSD.

Revision 1.192.2.1 / (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.192: +26 -3 lines
Diff to previous 1.192 (colored)

Sync with HEAD

Revision 1.197 / (download) - annotate - [select for diffs], Sun Apr 14 19:21:37 2019 UTC (21 months, 1 week ago) by christos
Branch: MAIN
CVS Tags: phil-wifi-20190609, netbsd-9-base
Branch point for: netbsd-9
Changes since 1.196: +2 -4 lines
Diff to previous 1.196 (colored)

undo previous unlock/relock; it is not needed now that we added the tls model
declaration to all externs in jemalloc (suggested by joerg@)

Revision 1.196 / (download) - annotate - [select for diffs], Sat Apr 13 03:15:25 2019 UTC (21 months, 1 week ago) by christos
Branch: MAIN
Changes since 1.195: +4 -2 lines
Diff to previous 1.195 (colored)

Fix c++ exceptions on arm; jemalloc calls _rtld_tls_get_addr from inside
dl_iterate_phdr, so we need to unlock and relock.

Revision 1.190.2.4 / (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.190.2.3: +25 -2 lines
Diff to previous 1.190.2.3 (colored) to branchpoint 1.190 (colored) next main 1.191 (colored)

Synch with HEAD

Revision 1.195 / (download) - annotate - [select for diffs], Sun Dec 30 01:48:37 2018 UTC (2 years ago) by christos
Branch: MAIN
CVS Tags: pgoyette-compat-20190127, pgoyette-compat-20190118
Changes since 1.194: +21 -2 lines
Diff to previous 1.194 (colored)

binutils 2.31.1 can put copy relocations in the relro segment. Delay
protecting the relro segment for the main object until copy relocations
are done.

Revision 1.194 / (download) - annotate - [select for diffs], Thu Dec 27 18:57:43 2018 UTC (2 years ago) by christos
Branch: MAIN
Changes since 1.193: +6 -2 lines
Diff to previous 1.193 (colored)

explain why we skip objmain.

Revision 1.190.2.3 / (download) - annotate - [select for diffs], Sat Oct 20 06:58:22 2018 UTC (2 years, 3 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.190.2.2: +3 -3 lines
Diff to previous 1.190.2.2 (colored) to branchpoint 1.190 (colored)

Sync with head

Revision 1.193 / (download) - annotate - [select for diffs], Wed Oct 17 23:36:58 2018 UTC (2 years, 3 months ago) by joerg
Branch: MAIN
CVS Tags: pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020
Changes since 1.192: +3 -3 lines
Diff to previous 1.192 (colored)

Move compatibility for pre-2.0 ELF binaries into separate file.
Early ELF binaries defined dlopen and friends in crt0.o by
using function pointers in the object handle passed from rtld.
This contract wastes space when many shared objects are allocated
and ties dynamic linker and rest of the system tightly together.
Fake the entry points in a static object and restrict them to the
platforms that had working ELF support at the time. Keep the magic and
version field used by modern crt0.o for all architectures. The checks
will be removed from crt0.o in a follow-up step.

Revision 1.190.2.2 / (download) - annotate - [select for diffs], Sat Apr 7 04:12:09 2018 UTC (2 years, 9 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.190.2.1: +3 -3 lines
Diff to previous 1.190.2.1 (colored) to branchpoint 1.190 (colored)

Sync with HEAD.  77 conflicts resolved - all of them $NetBSD$

Revision 1.192 / (download) - annotate - [select for diffs], Tue Apr 3 21:10:27 2018 UTC (2 years, 9 months ago) by joerg
Branch: MAIN
CVS Tags: phil-wifi-base, 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
Branch point for: phil-wifi
Changes since 1.191: +3 -3 lines
Diff to previous 1.191 (colored)

Rework ifunc support to address a number of short comings:
- Move to a shared _rtld_call_ifunc for rel and rela architectures
- Architectures using rel format must patch IRELATIVE non-PLT
  relocations like RELATIVE in additition to the later ifunc handling
- Consistently record the delta to the end of the relocation group for
  non-PLT IRELATIVE relocations

Hidden ifunc is now supported on all ifunc platforms, even when using
-fno-plt. The combination of -fno-plt and relro is broken due to
incorrect GNU ld output though.

Revision 1.190.2.1 / (download) - annotate - [select for diffs], Thu Mar 15 09:12:01 2018 UTC (2 years, 10 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.190: +3 -3 lines
Diff to previous 1.190 (colored)

Synch with HEAD

Revision 1.191 / (download) - annotate - [select for diffs], Fri Mar 9 20:19:11 2018 UTC (2 years, 10 months ago) by joerg
Branch: MAIN
CVS Tags: pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Changes since 1.190: +3 -3 lines
Diff to previous 1.190 (colored)

Like Sparc, PowerPC can use IRELATIVE relocations in non-PLT sections.

Revision 1.190 / (download) - annotate - [select for diffs], Sun Feb 11 18:58:44 2018 UTC (2 years, 11 months ago) by jakllsch
Branch: MAIN
CVS Tags: pgoyette-compat-base
Branch point for: pgoyette-compat
Changes since 1.189: +6 -2 lines
Diff to previous 1.189 (colored)

Wrap PowerPC #pragma goop in #if __GNUC_PREREQ__(6,0).
Our older GCC warns/errors on it.

Revision 1.189 / (download) - annotate - [select for diffs], Wed Feb 7 06:17:45 2018 UTC (2 years, 11 months ago) by mrg
Branch: MAIN
Changes since 1.188: +5 -2 lines
Diff to previous 1.188 (colored)

update for GCC 6:

ignore -Wframe-address warnings for the ppc hack.

Revision 1.188 / (download) - annotate - [select for diffs], Mon Nov 6 21:16:04 2017 UTC (3 years, 2 months ago) by joerg
Branch: MAIN
Changes since 1.187: +32 -14 lines
Diff to previous 1.187 (colored)

init/fini for the main program is handled by crt0.o, so ifunc handling
is skipped right now as it iterates the same list. Don't repeat that
mistake and explicitly take care of it in the dynamic linker.

Revision 1.183.4.2 / (download) - annotate - [select for diffs], Tue Aug 29 09:43:17 2017 UTC (3 years, 4 months ago) by bouyer
Branch: netbsd-8
CVS Tags: netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, matt-nb8-mediatek-base, matt-nb8-mediatek
Changes since 1.183.4.1: +41 -2 lines
Diff to previous 1.183.4.1 (colored) to branchpoint 1.183 (colored) next main 1.184 (colored)

Pull up following revision(s) (requested by joerg in ticket #127):
	tests/libexec/ld.elf_so/h_thread_local_dtor.c: revision 1.1
	external/gpl3/gcc/lib/libstdc++-v3/arch/earmv6/c++config.h: revision 1.14
	external/gpl3/gcc/lib/libstdc++-v3/arch/earmeb/c++config.h: revision 1.17
	lib/libc/stdlib/atexit.h: file removal
	lib/libc/stdlib/exit.c: revision 1.16
	external/gpl3/gcc/lib/libstdc++-v3/arch/powerpc64/c++config.h: revision 1.8
	lib/libc/stdlib/exit.c: revision 1.17
	external/gpl3/gcc/lib/libstdc++-v3/arch/earmv7hf/c++config.h: revision 1.14
	distrib/sets/lists/debug/shl.mi: revision 1.178
	external/gpl3/gcc/lib/libstdc++-v3/arch/sh3el/c++config.h: revision 1.21
	distrib/sets/lists/debug/shl.mi: revision 1.179
	distrib/sets/lists/debug/mi: revision 1.219
	lib/libpthread/pthread.c: revision 1.150
	external/gpl3/gcc/lib/libstdc++-v3/arch/earmv7/c++config.h: revision 1.14
	libexec/ld.elf_so/symbols.map: revision 1.2
	include/dlfcn.h: revision 1.25
	external/gpl3/gcc/lib/libstdc++-v3/arch/arm/c++config.h: revision 1.21
	external/gpl3/gcc/lib/libstdc++-v3/arch/x86_64/c++config.h: revision 1.23
	external/gpl3/gcc/lib/libstdc++-v3/arch/mips64el/c++config.h: revision 1.18
	external/gpl3/gcc/lib/libstdc++-v3/arch/earmv4eb/c++config.h: revision 1.14
	external/gpl3/gcc/lib/libstdc++-v3/arch/earm/c++config.h: revision 1.19
	external/gpl3/gcc/lib/libstdc++-v3/arch/mipsel/c++config.h: revision 1.19
	external/gpl3/gcc/lib/libstdc++-v3/arch/ia64/c++config.h: revision 1.5
	external/gpl3/gcc/lib/libstdc++-v3/arch/earmv6eb/c++config.h: revision 1.14
	external/gpl3/gcc/lib/libstdc++-v3/arch/earmhf/c++config.h: revision 1.17
	distrib/sets/lists/tests/mi: revision 1.755
	external/gpl3/gcc/lib/libstdc++-v3/arch/mips64eb/c++config.h: revision 1.19
	external/gpl3/gcc/lib/libstdc++-v3/arch/i386/c++config.h: revision 1.20
	external/gpl3/gcc/lib/libstdc++-v3/arch/vax/c++config.h: revision 1.21
	external/gpl3/gcc/lib/libstdc++-v3/arch/armeb/c++config.h: revision 1.21
	external/gpl3/gcc/lib/libstdc++-v3/arch/sparc/c++config.h: revision 1.20
	lib/libc/dlfcn/dlfcn_elf.c: revision 1.14
	tests/libexec/ld.elf_so/t_thread_local_dtor.sh: revision 1.1
	tests/lib/libpthread/t_thread_local_dtor.sh: revision 1.1
	lib/libc/stdlib/Makefile.inc: revision 1.93
	lib/libc/include/atexit.h: revision 1.1
	lib/libc/include/atexit.h: revision 1.2
	external/gpl3/gcc/lib/libstdc++-v3/arch/m68k/c++config.h: revision 1.19
	external/gpl3/gcc/lib/libstdc++-v3/arch/earmv6hf/c++config.h: revision 1.14
	distrib/sets/lists/debug/shl.mi: revision 1.180
	external/gpl3/gcc/lib/libstdc++-v3/arch/sparc64/c++config.h: revision 1.19
	external/gpl3/gcc/lib/libstdc++-v3/arch/earmv6hfeb/c++config.h: revision 1.14
	external/gpl3/gcc/lib/libstdc++-v3/arch/hppa/c++config.h: revision 1.19
	external/gpl3/gcc/lib/libstdc++-v3/arch/earmv7hfeb/c++config.h: revision 1.14
	lib/libc/stdlib/cxa_thread_atexit.c: revision 1.1
	tests/libexec/ld.elf_so/helper_dso3/h_helper_dso3.cpp: revision 1.1
	tests/libexec/ld.elf_so/helper_dso3/Makefile: revision 1.1
	external/gpl3/gcc/lib/libstdc++-v3/arch/riscv64/c++config.h: revision 1.5
	libexec/ld.elf_so/rtld.c: revision 1.185
	external/gpl3/gcc/lib/libstdc++-v3/arch/sh3eb/c++config.h: revision 1.19
	external/gpl3/gcc/lib/libstdc++-v3/arch/riscv32/c++config.h: revision 1.5
	external/gpl3/gcc/lib/libstdc++-v3/arch/m68000/c++config.h: revision 1.15
	external/gpl3/gcc/lib/libstdc++-v3/arch/mipseb/c++config.h: revision 1.21
	external/gpl3/gcc/lib/libstdc++-v3/arch/coldfire/c++config.h: revision 1.12
	external/gpl3/gcc/lib/libstdc++-v3/arch/earmv4/c++config.h: revision 1.14
	external/gpl3/gcc/lib/libstdc++-v3/arch/earmhfeb/c++config.h: revision 1.15
	external/gpl3/gcc/lib/libstdc++-v3/arch/alpha/c++config.h: revision 1.19
	tests/libexec/ld.elf_so/Makefile: revision 1.9
	external/gpl3/gcc/lib/libstdc++-v3/arch/powerpc/c++config.h: revision 1.20
	external/gpl3/gcc/lib/libstdc++-v3/arch/earmv7eb/c++config.h: revision 1.14
	tests/lib/libpthread/h_thread_local_dtor.cpp: revision 1.1
	distrib/sets/lists/tests/shl.mi: revision 1.11
	tests/lib/libpthread/Makefile: revision 1.13
	libexec/ld.elf_so/rtld.h: revision 1.129
	external/gpl3/gcc/lib/libstdc++-v3/arch/or1k/c++config.h: revision 1.6
Implement __cxa_thread_atexit and __cxa_thread_atexit_impl. This
functions are used for destructors of thread_local objects.
If a pending destructor exists, prevent unloading of shared objects.
Introduce __dl_cxa_refcount interface for this purpose. When the last
reference is gone and the object has been dlclose'd before, the
unloading is finalized.
Ideally, __cxa_thread_atexit_impl wouldn't exist, but libstdc++ insists
on providing __cxa_thread_atexit as direct wrapper without further
patching.
Fix filename of new debug file
Add misising DEBUGLIB file
Avoid common declaration.
Drop TLS variant checks, emutls is enough for VAX and Sun2.

Revision 1.187 / (download) - annotate - [select for diffs], Sat Aug 12 09:03:27 2017 UTC (3 years, 5 months ago) by joerg
Branch: MAIN
Changes since 1.186: +7 -3 lines
Diff to previous 1.186 (colored)

Add sparc/sparc64 support for irelative relocations.

Revision 1.186 / (download) - annotate - [select for diffs], Thu Aug 10 19:03:25 2017 UTC (3 years, 5 months ago) by joerg
Branch: MAIN
Changes since 1.185: +17 -4 lines
Diff to previous 1.185 (colored)

Add IRELATIVE support for ARM, X86 and PowerPC.

Revision 1.185 / (download) - annotate - [select for diffs], Tue Jul 11 15:21:35 2017 UTC (3 years, 6 months ago) by joerg
Branch: MAIN
CVS Tags: perseant-stdc-iso10646-base, perseant-stdc-iso10646
Changes since 1.184: +41 -2 lines
Diff to previous 1.184 (colored)

Implement __cxa_thread_atexit and __cxa_thread_atexit_impl. This
functions are used for destructors of thread_local objects.

If a pending destructor exists, prevent unloading of shared objects.
Introduce __dl_cxa_refcount interface for this purpose. When the last
reference is gone and the object has been dlclose'd before, the
unloading is finalized.

Ideally, __cxa_thread_atexit_impl wouldn't exist, but libstdc++ insists
on providing __cxa_thread_atexit as direct wrapper without further
patching.

Revision 1.183.4.1 / (download) - annotate - [select for diffs], Sat Jun 10 06:27:51 2017 UTC (3 years, 7 months ago) by snj
Branch: netbsd-8
Changes since 1.183: +4 -4 lines
Diff to previous 1.183 (colored)

Pull up following revision(s) (requested by joerg in ticket #26):
	libexec/ld.elf_so/rtld.c: revision 1.184
Call _rtld_debug_state before running the global initialisers, so give
gdb a chance to set break points etc.

Revision 1.184 / (download) - annotate - [select for diffs], Thu Jun 8 18:24:39 2017 UTC (3 years, 7 months ago) by joerg
Branch: MAIN
Changes since 1.183: +4 -4 lines
Diff to previous 1.183 (colored)

Call _rtld_debug_state before running the global initialisers, so give
gdb a chance to set break points etc.

Revision 1.182.2.1 / (download) - annotate - [select for diffs], Fri Apr 21 16:53:13 2017 UTC (3 years, 9 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.182: +3 -3 lines
Diff to previous 1.182 (colored) next main 1.183 (colored)

Sync with HEAD

Revision 1.178.2.2 / (download) - annotate - [select for diffs], Mon Mar 20 06:57:01 2017 UTC (3 years, 10 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.178.2.1: +3 -3 lines
Diff to previous 1.178.2.1 (colored) to branchpoint 1.178 (colored) next main 1.179 (colored)

Sync with HEAD

Revision 1.183 / (download) - annotate - [select for diffs], Mon Feb 27 20:25:26 2017 UTC (3 years, 10 months ago) by chs
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, pgoyette-localcount-20170320, netbsd-8-base, bouyer-socketcan-base1
Branch point for: netbsd-8
Changes since 1.182: +3 -3 lines
Diff to previous 1.182 (colored)

tag the powerpc hackish_return_address() as __noinline.

Revision 1.178.2.1 / (download) - annotate - [select for diffs], Sat Jan 7 08:56:05 2017 UTC (4 years ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.178: +17 -4 lines
Diff to previous 1.178 (colored)

Sync with HEAD.  (Note that most of these changes are simply $NetBSD$
tag issues.)

Revision 1.182 / (download) - annotate - [select for diffs], Thu Dec 1 18:21:39 2016 UTC (4 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: pgoyette-localcount-20170107, bouyer-socketcan-base
Branch point for: bouyer-socketcan
Changes since 1.181: +3 -4 lines
Diff to previous 1.181 (colored)

n dl_iterate_phdr return the path not the name.

Revision 1.181 / (download) - annotate - [select for diffs], Thu Dec 1 14:29:15 2016 UTC (4 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.180: +4 -6 lines
Diff to previous 1.180 (colored)

Instead of using a function to resolve symbols that should be supplied by
the dynamic linker itself, use a version script that exposes them. From joerg@

Revision 1.180 / (download) - annotate - [select for diffs], Wed Nov 30 20:25:23 2016 UTC (4 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.179: +4 -3 lines
Diff to previous 1.179 (colored)

add missing newline in comment

Revision 1.179 / (download) - annotate - [select for diffs], Wed Nov 30 19:43:32 2016 UTC (4 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.178: +17 -2 lines
Diff to previous 1.178 (colored)

Emulate the standard symbol search order in dlsym() i.e. resolve weak or
not found symbols that are in the dynamic linker list of exported symbols
from the dynamic linker itself.

Revision 1.178 / (download) - annotate - [select for diffs], Tue May 24 20:32:33 2016 UTC (4 years, 7 months ago) by christos
Branch: MAIN
CVS Tags: pgoyette-localcount-base, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, localcount-20160914
Branch point for: pgoyette-localcount
Changes since 1.177: +3 -2 lines
Diff to previous 1.177 (colored)

Put the name of the dynamic linker in allocated memory, so that it becomes
part of the core file link-map, so that gdb can find it.

Revision 1.173.4.3 / (download) - annotate - [select for diffs], Sun Mar 6 18:17:55 2016 UTC (4 years, 10 months ago) by martin
Branch: netbsd-7
CVS Tags: netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, 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
Changes since 1.173.4.2: +38 -23 lines
Diff to previous 1.173.4.2 (colored) to branchpoint 1.173 (colored) next main 1.174 (colored)

Catch up to -current, via patch, requested by christos in ticket #1126:

Revision 1.155.6.1 / (download) - annotate - [select for diffs], Fri Apr 17 09:33:01 2015 UTC (5 years, 9 months ago) by msaitoh
Branch: netbsd-6-0
Changes since 1.155: +3 -3 lines
Diff to previous 1.155 (colored) next main 1.156 (colored)

Pull up following revision(s) (requested by joerg in ticket #1288):
	libexec/ld.elf_so/rtld.c: revision 1.176
lib/49813: Release mutex on error.

Revision 1.155.2.1.2.1 / (download) - annotate - [select for diffs], Fri Apr 17 09:31:55 2015 UTC (5 years, 9 months ago) by msaitoh
Branch: netbsd-6-1
Changes since 1.155.2.1: +3 -3 lines
Diff to previous 1.155.2.1 (colored) next main 1.155.2.2 (colored)

Pull up following revision(s) (requested by joerg in ticket #1288):
	libexec/ld.elf_so/rtld.c: revision 1.176
lib/49813: Release mutex on error.

Revision 1.155.2.4 / (download) - annotate - [select for diffs], Thu Apr 16 09:35:54 2015 UTC (5 years, 9 months ago) by msaitoh
Branch: netbsd-6
Changes since 1.155.2.3: +3 -3 lines
Diff to previous 1.155.2.3 (colored) to branchpoint 1.155 (colored) next main 1.156 (colored)

Pull up following revision(s) (requested by joerg in ticket #1288):
	libexec/ld.elf_so/rtld.c: revision 1.176
lib/49813: Release mutex on error.

Revision 1.177 / (download) - annotate - [select for diffs], Mon Apr 6 09:34:15 2015 UTC (5 years, 9 months ago) by yamt
Branch: MAIN
Changes since 1.176: +12 -8 lines
Diff to previous 1.176 (colored)

Fix membars around rtld internal mutex.

This fixes the most of lockups i observed with Open vSwitch
on NetBSD/amd64.  ("most of" because it still occasionally
locks up because of other problems.  see PR/49816)

Revision 1.173.4.2 / (download) - annotate - [select for diffs], Mon Apr 6 02:01:39 2015 UTC (5 years, 9 months ago) by snj
Branch: netbsd-7
CVS Tags: 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
Changes since 1.173.4.1: +3 -3 lines
Diff to previous 1.173.4.1 (colored) to branchpoint 1.173 (colored)

Pull up following revision(s) (requested by joerg in ticket #665):
	libexec/ld.elf_so/rtld.c: revision 1.176
lib/49813: Release mutex on error.

Revision 1.176 / (download) - annotate - [select for diffs], Sat Apr 4 18:51:57 2015 UTC (5 years, 9 months ago) by joerg
Branch: MAIN
Changes since 1.175: +3 -3 lines
Diff to previous 1.175 (colored)

lib/49813: Release mutex on error.

Revision 1.173.4.1 / (download) - annotate - [select for diffs], Mon Mar 9 07:56:43 2015 UTC (5 years, 10 months ago) by snj
Branch: netbsd-7
Changes since 1.173: +5 -2 lines
Diff to previous 1.173 (colored)

Pull up following revision(s) (requested by skrll in ticket #569):
	libexec/ld.elf_so/rtld.c: revision 1.175
HPPA hack for a problem where gdb doesn't see _rtld_debug_state when
it's a single bv,n %r0(%rp) instruction.
The nullify confuses something.

Revision 1.175 / (download) - annotate - [select for diffs], Thu Mar 5 09:49:53 2015 UTC (5 years, 10 months ago) by skrll
Branch: MAIN
Changes since 1.174: +5 -2 lines
Diff to previous 1.174 (colored)

HPPA hack for a problem where gdb doesn't see _rtld_debug_state when
it's a single bv,n %r0(%rp) instruction.

The nullify confuses something.

Revision 1.155.2.3 / (download) - annotate - [select for diffs], Sun Jan 25 10:22:59 2015 UTC (5 years, 11 months ago) by martin
Branch: netbsd-6
Changes since 1.155.2.2: +3 -3 lines
Diff to previous 1.155.2.2 (colored) to branchpoint 1.155 (colored)

Pull up the following, requested by he in ticket #1238:
	src/libexec/ld.elf_so/rtld.c 1.161
Fix the other lwp_park() to pass 0 for the 'unpark' lwp.

Revision 1.155.2.2 / (download) - annotate - [select for diffs], Sat Jan 24 13:49:23 2015 UTC (5 years, 11 months ago) by martin
Branch: netbsd-6
Changes since 1.155.2.1: +3 -3 lines
Diff to previous 1.155.2.1 (colored) to branchpoint 1.155 (colored)

Pull up following revision(s) (requested by he in ticket #1238):
	libexec/ld.elf_so/rtld.c: revision 1.160
You need to pass 0 (not -1) to lwp_park() if you don't also
  want to do an unpark.
Clearly this code path was never tested!

Revision 1.174 / (download) - annotate - [select for diffs], Mon Aug 25 20:40:52 2014 UTC (6 years, 4 months ago) by joerg
Branch: MAIN
Changes since 1.173: +28 -17 lines
Diff to previous 1.173 (colored)

Add basic support for indirect functions. It allows providing a public
function symbol with an implementation choosen at run time.
Refactor calls to functions by address in ld.elf_so to create temporary
function descriptors on the stack, if the address is not leaked outside.

Limitations:
- no support for initialising static storage with function pointers
- no support for unnamed resolver functions

Inspired by FreeBSD's r228435 by kib@freebsd.org.

Revision 1.158.2.4 / (download) - annotate - [select for diffs], Wed Aug 20 00:02:22 2014 UTC (6 years, 5 months ago) by tls
Branch: tls-maxphys
Changes since 1.158.2.3: +14 -4 lines
Diff to previous 1.158.2.3 (colored) next main 1.159 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.153.2.4 / (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.153.2.3: +32 -27 lines
Diff to previous 1.153.2.3 (colored) to branchpoint 1.153 (colored) next main 1.154 (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 1.173 / (download) - annotate - [select for diffs], Tue Mar 18 16:05:34 2014 UTC (6 years, 10 months ago) by joerg
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, netbsd-7-base
Branch point for: netbsd-7
Changes since 1.172: +6 -3 lines
Diff to previous 1.172 (colored)

Ignore LD_BIND_NOW for setuid binaries, but keep it in the environment
otherwise.

Revision 1.172 / (download) - annotate - [select for diffs], Fri Jan 31 22:46:40 2014 UTC (6 years, 11 months ago) by joerg
Branch: MAIN
CVS Tags: riastradh-drm2-base3
Changes since 1.171: +6 -4 lines
Diff to previous 1.171 (colored)

Catch up with _lwp_park change.

Revision 1.171 / (download) - annotate - [select for diffs], Wed Nov 20 07:18:23 2013 UTC (7 years, 2 months ago) by skrll
Branch: MAIN
Changes since 1.170: +5 -3 lines
Diff to previous 1.170 (colored)

If dlopen of the dynamic linker is requested, e.g. by rump in
rumpuser_dl_bootstrap, then return &_rtld_objself as the handle and do
not create a duplicate mapping.

The handle is mostly useless as _rtld_objself doesn't appear on
_rtld_objlist.

This fixes a problem on earm platforms where ld.elf_so (currently) has
an init_array section.  Calling this caused binaries to segv.

Revision 1.170 / (download) - annotate - [select for diffs], Sat Oct 19 17:19:30 2013 UTC (7 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.169: +5 -2 lines
Diff to previous 1.169 (colored)

fix unused variable warnings

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

resync from head

Revision 1.169 / (download) - annotate - [select for diffs], Thu May 9 15:47:34 2013 UTC (7 years, 8 months ago) by skrll
Branch: MAIN
CVS Tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2
Changes since 1.168: +3 -8 lines
Diff to previous 1.168 (colored)

Remove redundant assignment. Hasn't been needed since 1999.

Revision 1.168 / (download) - annotate - [select for diffs], Thu May 9 15:39:10 2013 UTC (7 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.167: +2 -3 lines
Diff to previous 1.167 (colored)

remove stray debugging

Revision 1.167 / (download) - annotate - [select for diffs], Thu May 9 15:38:14 2013 UTC (7 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.166: +5 -4 lines
Diff to previous 1.166 (colored)

convert to SIMPLEQ like the rest of the queues.

Revision 1.166 / (download) - annotate - [select for diffs], Mon May 6 19:59:30 2013 UTC (7 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.165: +3 -2 lines
Diff to previous 1.165 (colored)

Fixed handling of DT_SONAME:

	- add function to add name aliases for shared libraries loaded
	  XXX[1]: we don't add a name during load time, only when DT_SONAME
	  is present.
	- search already loaded objects in load_by_name for an already
	  loaded object that matches our name and return it.
	- add missing initialization and cleanup for obj->names
	  XXX[2]: should we make them SIMPLEQ?
	- Add XXX in rtld.c about getting the name of an object.

NB: This makes the jdk work again without resorting to a hack of putting
    the build path of libjvm.so into the run path (which is a security
    problem).
XXX: Pullup-6?

Revision 1.165 / (download) - annotate - [select for diffs], Mon May 6 08:02:20 2013 UTC (7 years, 8 months ago) by skrll
Branch: MAIN
Changes since 1.164: +13 -13 lines
Diff to previous 1.164 (colored)

Trailing whitespace

Revision 1.164 / (download) - annotate - [select for diffs], Mon May 6 07:58:43 2013 UTC (7 years, 8 months ago) by skrll
Branch: MAIN
Changes since 1.163: +3 -3 lines
Diff to previous 1.163 (colored)

Disalble a debug only where it causes problems.

Revision 1.163 / (download) - annotate - [select for diffs], Fri May 3 18:31:24 2013 UTC (7 years, 8 months ago) by matt
Branch: MAIN
Changes since 1.162: +3 -6 lines
Diff to previous 1.162 (colored)

Remove dbg for _ctype_

Revision 1.162 / (download) - annotate - [select for diffs], Thu May 2 21:11:18 2013 UTC (7 years, 8 months ago) by matt
Branch: MAIN
Changes since 1.161: +5 -3 lines
Diff to previous 1.161 (colored)

Print out &_DYNAMIC too.

Revision 1.158.2.2 / (download) - annotate - [select for diffs], Mon Feb 25 00:28:03 2013 UTC (7 years, 10 months ago) by tls
Branch: tls-maxphys
Changes since 1.158.2.1: +4 -4 lines
Diff to previous 1.158.2.1 (colored)

resync with head

Revision 1.153.2.3 / (download) - annotate - [select for diffs], Wed Jan 23 00:05:27 2013 UTC (8 years ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.153.2.2: +4 -4 lines
Diff to previous 1.153.2.2 (colored) to branchpoint 1.153 (colored)

sync with head

Revision 1.155.4.1 / (download) - annotate - [select for diffs], Tue Jan 22 21:47:28 2013 UTC (8 years ago) by matt
Branch: matt-nb6-plus
Changes since 1.155: +99 -65 lines
Diff to previous 1.155 (colored) next main 1.156 (colored)

Pullup from HEAD:
Add .init_array/.fini_array support (conditionalized on HAVE_INITFINI_ARRAY).

Revision 1.161 / (download) - annotate - [select for diffs], Sun Dec 16 23:00:46 2012 UTC (8 years, 1 month ago) by dsl
Branch: MAIN
CVS Tags: yamt-pagecache-base8, agc-symver-base, agc-symver
Changes since 1.160: +3 -3 lines
Diff to previous 1.160 (colored)

Fix the other lwp_park() to pass 0 for the 'unpark' lwp.

Revision 1.160 / (download) - annotate - [select for diffs], Sun Dec 16 11:15:21 2012 UTC (8 years, 1 month ago) by dsl
Branch: MAIN
Changes since 1.159: +3 -3 lines
Diff to previous 1.159 (colored)

You need to pass 0 (not -1) to lwp_park() if you don't also
  want to do an unpark.
Clearly this code path was never tested!
Needs pullup to netbsd-6

Revision 1.158.2.1 / (download) - annotate - [select for diffs], Tue Nov 20 03:00:46 2012 UTC (8 years, 2 months ago) by tls
Branch: tls-maxphys
Changes since 1.158: +3 -4 lines
Diff to previous 1.158 (colored)

Resync to 2012-11-19 00:00:00 UTC

Revision 1.153.2.2 / (download) - annotate - [select for diffs], Tue Oct 30 18:59:23 2012 UTC (8 years, 2 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.153.2.1: +100 -67 lines
Diff to previous 1.153.2.1 (colored) to branchpoint 1.153 (colored)

sync with head

Revision 1.155.2.1 / (download) - annotate - [select for diffs], Wed Oct 17 22:36:59 2012 UTC (8 years, 3 months ago) by riz
Branch: netbsd-6
CVS Tags: 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
Branch point for: netbsd-6-1
Changes since 1.155: +3 -4 lines
Diff to previous 1.155 (colored)

Pull up following revision(s) (requested by riastradh in ticket #605):
	libexec/ld.elf_so/rtld.c: revision 1.159
On failure in _rtld_dlcheck, call _rtld_error, not xwarnx.
Callers need not call _rtld_error themselves now.
Fixes PR lib/41760.  Should add the test case from the PR too.

Revision 1.159 / (download) - annotate - [select for diffs], Mon Oct 1 03:03:46 2012 UTC (8 years, 3 months ago) by riastradh
Branch: MAIN
CVS Tags: yamt-pagecache-base7, yamt-pagecache-base6
Changes since 1.158: +3 -4 lines
Diff to previous 1.158 (colored)

On failure in _rtld_dlcheck, call _rtld_error, not xwarnx.

Callers need not call _rtld_error themselves now.

Fixes PR lib/41760.  Should add the test case from the PR too.

Revision 1.158 / (download) - annotate - [select for diffs], Wed Aug 15 03:46:06 2012 UTC (8 years, 5 months ago) by matt
Branch: MAIN
Branch point for: tls-maxphys
Changes since 1.157: +99 -65 lines
Diff to previous 1.157 (colored)

Add .init_array/.fini_array support (conditionalized on HAVE_INITFINI_ARRAY).

Revision 1.153.2.1 / (download) - annotate - [select for diffs], Tue Apr 17 00:05:36 2012 UTC (8 years, 9 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.153: +39 -17 lines
Diff to previous 1.153 (colored)

sync with head

Revision 1.123.2.3 / (download) - annotate - [select for diffs], Sat Mar 17 18:28:32 2012 UTC (8 years, 10 months ago) by bouyer
Branch: netbsd-5
CVS Tags: 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
Changes since 1.123.2.2: +53 -6 lines
Diff to previous 1.123.2.2 (colored) to branchpoint 1.123 (colored) next main 1.124 (colored)

Pull up following revision(s) via patch (requested by skrll in ticket #1724):
	rescue/list.ldd: revision 1.4
	lib/libc/dlfcn/dlfcn_elf.c: revision 1.7
	libexec/ld.elf_so/arch/mips/mips_reloc.c: revision 1.57
	distrib/sets/lists/comp/mi: revision 1.1512
	share/man/man3/Makefile: revision 1.56
	libexec/ld.elf_so/arch/mips/mips_reloc.c: revision 1.58
	usr.bin/ldd/ldd.c: revision 1.15
	libexec/ld.elf_so/rtld.h: revision 1.84
	share/man/man3/dl_iterate_phdr.3: revision 1.1
	libexec/ld.elf_so/rtld.c: revision 1.129
	libexec/ld.elf_so/arch/powerpc/ppc_reloc.c: revision 1.44
	libexec/ld.elf_so/rtld.h: revision 1.89
	libexec/ld.elf_so/arch/x86_64/mdreloc.c: revision 1.36
	libexec/ld.elf_so/map_object.c: revision 1.41
	libexec/ld.elf_so/arch/x86_64/mdreloc.c: revision 1.37
	libexec/ld.elf_so/arch/sparc64/mdreloc.c: revision 1.46
	include/link_elf.h: revision 1.10
	libexec/ld.elf_so/arch/i386/mdreloc.c: revision 1.29
	libexec/ld.elf_so/arch/vax/mdreloc.c: revision 1.26
	libexec/ld.elf_so/arch/alpha/alpha_reloc.c: revision 1.34
	libexec/ld.elf_so/arch/hppa/hppa_reloc.c: revision 1.31
	libexec/ld.elf_so/arch/alpha/alpha_reloc.c: revision 1.35
	libexec/ld.elf_so/Makefile: revision 1.94
	libexec/ld.elf_so/arch/hppa/hppa_reloc.c: revision 1.32
	libexec/ld.elf_so/Makefile: revision 1.95
	libexec/ld.elf_so/arch/arm/mdreloc.c: revision 1.31
	libexec/ld.elf_so/Makefile: revision 1.96
	libexec/ld.elf_so/arch/arm/mdreloc.c: revision 1.32
	libexec/ld.elf_so/reloc.c: revision 1.98
	libexec/ld.elf_so/arch/arm/mdreloc.c: revision 1.33
	sys/sys/exec_elf.h: revision 1.106
	libexec/ld.elf_so/rtld.c: revision 1.130
	libexec/ld.elf_so/load.c: revision 1.37
	libexec/ld.elf_so/rtld.c: revision 1.131
	libexec/ld.elf_so/load.c: revision 1.38
	libexec/ld.elf_so/rtld.h: revision 1.90
	libexec/ld.elf_so/headers.c: revision 1.36
	libexec/ld.elf_so/rtld.h: revision 1.95
	libexec/ld.elf_so/arch/i386/mdreloc.c: revision 1.30
	libexec/ld.elf_so/arch/m68k/mdreloc.c: revision 1.25
	libexec/ld.elf_so/symbol.c: revision 1.50
	libexec/ld.elf_so/symbol.c: revision 1.51
	libexec/ld.elf_so/arch/sparc/mdreloc.c: revision 1.43
	libexec/ld.elf_so/symbol.c: revision 1.52
	libexec/ld.elf_so/arch/sh3/mdreloc.c: revision 1.27
	libexec/ld.elf_so/symbol.c: revision 1.54
PR/39240: Satoshi Suetake: Don't fail when attempting to resolve weak symbols
when we are doing immediate binding, leave them alone and they will be dealt
with later during lazy binding. From skrll@
Implement negative cache checks for symbol lookups.
Uses the Donelist idea from FreeBSD.
Use alloca(3) instead of local xmalloc for creating our DoneLists.
This allows threaded programs to use us a little better, PR lib/43005.
Implement dl_iterate_phdr.
Somewhat taken from FreeBSD. Manual page from OpenBSD.

Revision 1.157 / (download) - annotate - [select for diffs], Tue Mar 13 21:00:31 2012 UTC (8 years, 10 months ago) by joerg
Branch: MAIN
CVS Tags: yamt-pagecache-base5, yamt-pagecache-base4
Changes since 1.156: +4 -3 lines
Diff to previous 1.156 (colored)

Mark _rtld_debug_state as not to be inlined. Add an explicit instruction
barrier to prevent removal of calls to it.

Revision 1.156 / (download) - annotate - [select for diffs], Thu Feb 16 23:00:39 2012 UTC (8 years, 11 months ago) by joerg
Branch: MAIN
Changes since 1.155: +11 -5 lines
Diff to previous 1.155 (colored)

Add _dlauxinfo helper function to provide access to the ELF auxilary
vector. This can normally be found via __ps_strings, but libc is
initialised too early when linked dynamically and doesn't have access to
it yet, so provide an alternative mechanism via ld.elf_so.
Bump libc minor.

Revision 1.155 / (download) - annotate - [select for diffs], Fri Nov 25 21:27:15 2011 UTC (9 years, 1 month ago) by joerg
Branch: MAIN
CVS Tags: netbsd-6-base, 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, matt-nb6-plus-nbase, matt-nb6-plus-base
Branch point for: netbsd-6-0, netbsd-6, matt-nb6-plus
Changes since 1.154: +17 -11 lines
Diff to previous 1.154 (colored)

Unbreak RTLD_NEXT and co on platforms that don't inline or tail call
do_dlsym.

Revision 1.154 / (download) - annotate - [select for diffs], Thu Nov 17 16:20:11 2011 UTC (9 years, 2 months ago) by joerg
Branch: MAIN
Changes since 1.153: +13 -4 lines
Diff to previous 1.153 (colored)

FreeBSD bug report 161344: TLS area for the main thread is set up to
early, if e.g. pointers to functions are used as initializers.

Revision 1.153 / (download) - annotate - [select for diffs], Sun Oct 23 21:06:07 2011 UTC (9 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base
Branch point for: yamt-pagecache
Changes since 1.152: +3 -2 lines
Diff to previous 1.152 (colored)

Don't block SIGTRAP so that on architectures where the debugger needs to
be able to receive sigtrap for breakpoints to work, it can. For example
we are setting breakpoints inside dlopen(), after we've blocked the signal,
so the process keep trapping and looping over the trap instruction without
being able to send the signal. Another way would be to move the
_rtld_debug_state() calls outside the critical section...

Revision 1.152 / (download) - annotate - [select for diffs], Sat Aug 13 22:24:24 2011 UTC (9 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.151: +4 -2 lines
Diff to previous 1.151 (colored)

disable debugging that makes us core dump

Revision 1.151 / (download) - annotate - [select for diffs], Sat Jun 25 05:45:12 2011 UTC (9 years, 6 months ago) by nonaka
Branch: MAIN
Changes since 1.150: +60 -20 lines
Diff to previous 1.150 (colored)

PR/45015: ld.elf_so: support ELF symbol versioning
Applied latest patch.

Revision 1.150 / (download) - annotate - [select for diffs], Sat Apr 2 16:49:49 2011 UTC (9 years, 9 months ago) by joerg
Branch: MAIN
CVS Tags: cherry-xenmp-base, cherry-xenmp
Changes since 1.149: +2 -20 lines
Diff to previous 1.149 (colored)

Revert pthread_atfork related change not intended for commit yet.

Revision 1.149 / (download) - annotate - [select for diffs], Sat Apr 2 12:30:41 2011 UTC (9 years, 9 months ago) by joerg
Branch: MAIN
Changes since 1.148: +23 -2 lines
Diff to previous 1.148 (colored)

Unbreak HPPA

Revision 1.148 / (download) - annotate - [select for diffs], Tue Mar 29 20:56:35 2011 UTC (9 years, 9 months ago) by joerg
Branch: MAIN
Changes since 1.147: +49 -36 lines
Diff to previous 1.147 (colored)

Block signals when using the exclusive lock.

Revision 1.147 / (download) - annotate - [select for diffs], Mon Mar 28 00:37:40 2011 UTC (9 years, 9 months ago) by joerg
Branch: MAIN
Changes since 1.146: +54 -18 lines
Diff to previous 1.146 (colored)

Refine locking scheme around init/fini to not hold the exclusive lock.
Use a simple generation count instead and restart looking for work if it
changed (e.g. due to an dlopen call from an init function).
Leave the possible dlclose() race for now.

Revision 1.146 / (download) - annotate - [select for diffs], Sun Mar 27 22:20:51 2011 UTC (9 years, 9 months ago) by joerg
Branch: MAIN
Changes since 1.145: +3 -3 lines
Diff to previous 1.145 (colored)

exit, not enter

Revision 1.145 / (download) - annotate - [select for diffs], Sun Mar 27 21:58:50 2011 UTC (9 years, 9 months ago) by joerg
Branch: MAIN
Changes since 1.144: +6 -2 lines
Diff to previous 1.144 (colored)

Handle _rtld_exit as full entry point since other threads may still be
running at the time.

Revision 1.144 / (download) - annotate - [select for diffs], Sun Mar 27 13:15:34 2011 UTC (9 years, 9 months ago) by joerg
Branch: MAIN
Changes since 1.143: +13 -2 lines
Diff to previous 1.143 (colored)

Add some debug messages for explicit rtld entry points

Revision 1.143 / (download) - annotate - [select for diffs], Sun Mar 27 13:14:42 2011 UTC (9 years, 9 months ago) by joerg
Branch: MAIN
Changes since 1.142: +13 -4 lines
Diff to previous 1.142 (colored)

Locking around dlclose()

Revision 1.142 / (download) - annotate - [select for diffs], Sat Mar 26 21:40:37 2011 UTC (9 years, 9 months ago) by joerg
Branch: MAIN
Changes since 1.141: +4 -2 lines
Diff to previous 1.141 (colored)

Fix merge error that broke HPPA

Revision 1.141 / (download) - annotate - [select for diffs], Fri Mar 25 18:07:04 2011 UTC (9 years, 10 months ago) by joerg
Branch: MAIN
Changes since 1.140: +182 -12 lines
Diff to previous 1.140 (colored)

Add basic locking to ld.elf_so.

Revision 1.140 / (download) - annotate - [select for diffs], Sun Mar 13 21:08:45 2011 UTC (9 years, 10 months ago) by joerg
Branch: MAIN
Changes since 1.139: +6 -6 lines
Diff to previous 1.139 (colored)

Fill in TLS related fields in dl_iterate_phdr if TLS is supported

Revision 1.139 / (download) - annotate - [select for diffs], Wed Mar 9 23:10:07 2011 UTC (9 years, 10 months ago) by joerg
Branch: MAIN
Changes since 1.138: +15 -2 lines
Diff to previous 1.138 (colored)

Add TLS support infrastructure. For dynamic binaries, ld.elf_so exports
_rtld_tls_allocate and _rtld_tls_free. libpthread uses this functions to
setup the thread private area of all new threads. ld.elf_so is
responsible for setting up the private area for the initial thread.
Similar functions are called from _libc_init for static binaries, using
dl_iterate_phdr to access the ELF Program Header.

Add test cases to exercise the different TLS storage models. Test cases
are compiled and installed on all platforms, but are skipped on
platforms not marked for TLS support.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.

It is inspired by the TLS support in FreeBSD by Doug Rabson and the
clean ups of the DragonFly port of the original FreeBSD modifications.

Revision 1.137.2.1 / (download) - annotate - [select for diffs], Sat Mar 5 15:09:24 2011 UTC (9 years, 10 months ago) by bouyer
Branch: bouyer-quota2
Changes since 1.137: +5 -3 lines
Diff to previous 1.137 (colored) next main 1.138 (colored)

Sync with HEAD

Revision 1.138 / (download) - annotate - [select for diffs], Thu Feb 24 10:58:54 2011 UTC (9 years, 10 months ago) by pooka
Branch: MAIN
CVS Tags: bouyer-quota2-nbase
Changes since 1.137: +5 -3 lines
Diff to previous 1.137 (colored)

make DEBUG compile without RTLD_DEBUG

Revision 1.137 / (download) - annotate - [select for diffs], Fri Dec 24 12:41:43 2010 UTC (10 years, 1 month ago) by skrll
Branch: MAIN
CVS Tags: matt-mips64-premerge-20101231, bouyer-quota2-base
Branch point for: bouyer-quota2
Changes since 1.136: +47 -8 lines
Diff to previous 1.136 (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.136 / (download) - annotate - [select for diffs], Sun Dec 19 17:26:51 2010 UTC (10 years, 1 month ago) by skrll
Branch: MAIN
Changes since 1.135: +3 -3 lines
Diff to previous 1.135 (colored)

Sprinkle some KNF.

Revision 1.135 / (download) - annotate - [select for diffs], Sun Dec 19 17:17:50 2010 UTC (10 years, 1 month ago) by skrll
Branch: MAIN
Changes since 1.134: +2 -4 lines
Diff to previous 1.134 (colored)

Remove unnecessary #ifdef RTLD_DEBUG

Revision 1.134 / (download) - annotate - [select for diffs], Thu Dec 16 22:47:27 2010 UTC (10 years, 1 month ago) by joerg
Branch: MAIN
Changes since 1.133: +59 -16 lines
Diff to previous 1.133 (colored)

Don't use normal environment handling functions from libc, but iterate
once over the array and clean out entries as needed.

Revision 1.133 / (download) - annotate - [select for diffs], Thu Dec 16 19:59:39 2010 UTC (10 years, 1 month ago) by skrll
Branch: MAIN
Changes since 1.132: +3 -3 lines
Diff to previous 1.132 (colored)

s/rdbg/dbg/ in a few places.

Revision 1.132 / (download) - annotate - [select for diffs], Fri Oct 29 15:08:17 2010 UTC (10 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.131: +4 -4 lines
Diff to previous 1.131 (colored)

PR/44010: YAMAMOTO Takashi: sbrk: grow 0xb3ba2000 failed, error = 12"
(due to setenv changes?)
Provide a mini unsetenv that does not allocate/free memory and does not
bother about locking.

Revision 1.131 / (download) - annotate - [select for diffs], Sat Oct 16 10:27:07 2010 UTC (10 years, 3 months ago) by skrll
Branch: MAIN
Changes since 1.130: +38 -3 lines
Diff to previous 1.130 (colored)

Implement dl_iterate_phdr.

Somewhat taken from FreeBSD. Manual page from OpenBSD.

Revision 1.123.8.2 / (download) - annotate - [select for diffs], Thu Aug 19 15:35:18 2010 UTC (10 years, 5 months ago) by matt
Branch: matt-nb5-mips64
CVS Tags: matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-k15
Changes since 1.123.8.1: +7 -3 lines
Diff to previous 1.123.8.1 (colored) to branchpoint 1.123 (colored) next main 1.124 (colored)

Rework the debug printfs for env so that if the env array is corrupt at
least some output happens.

Revision 1.123.8.1 / (download) - annotate - [select for diffs], Wed Apr 21 05:26:10 2010 UTC (10 years, 9 months ago) by matt
Branch: matt-nb5-mips64
Changes since 1.123: +47 -5 lines
Diff to previous 1.123 (colored)

sync to netbsd-5

Revision 1.130 / (download) - annotate - [select for diffs], Thu Mar 18 22:17:55 2010 UTC (10 years, 10 months ago) by roy
Branch: MAIN
Changes since 1.129: +2 -6 lines
Diff to previous 1.129 (colored)

Use alloca(3) instead of local xmalloc for creating our DoneLists.
This allows threaded programs to use us a little better, PR lib/43005.
We need to disable SSP when using alloca.

Revision 1.129 / (download) - annotate - [select for diffs], Sat Feb 27 11:16:38 2010 UTC (10 years, 10 months ago) by roy
Branch: MAIN
Changes since 1.128: +22 -5 lines
Diff to previous 1.128 (colored)

Implement negative cache checks for symbol lookups.
Uses the Donelist idea from FreeBSD.

Revision 1.128 / (download) - annotate - [select for diffs], Sun Jan 10 06:37:32 2010 UTC (11 years ago) by skrll
Branch: MAIN
Changes since 1.127: +7 -5 lines
Diff to previous 1.127 (colored)

Fixup comment.

Revision 1.123.2.2 / (download) - annotate - [select for diffs], Thu Dec 3 09:33:37 2009 UTC (11 years, 1 month ago) by sborrill
Branch: netbsd-5
CVS Tags: 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, matt-nb5-pq3-base, matt-nb5-pq3
Changes since 1.123.2.1: +6 -5 lines
Diff to previous 1.123.2.1 (colored) to branchpoint 1.123 (colored)

Pull up the following revisions(s) (requested by tron in ticket #1179):
	libexec/ld.elf_so/rtld.c:	revision 1.127

If the environment is corrupt, die. From FreeBSD.

Revision 1.127 / (download) - annotate - [select for diffs], Wed Dec 2 15:50:13 2009 UTC (11 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: matt-premerge-20091211
Changes since 1.126: +6 -5 lines
Diff to previous 1.126 (colored)

If the environment is corrupt, die. From FreeBSD.

Revision 1.126 / (download) - annotate - [select for diffs], Tue Nov 17 18:44:33 2009 UTC (11 years, 2 months ago) by skrll
Branch: MAIN
Changes since 1.125: +3 -3 lines
Diff to previous 1.125 (colored)

Make _rtld_pagesz of type size_t.

Fixes round_down for alpha which made ldd(1) break.

Revision 1.123.2.1 / (download) - annotate - [select for diffs], Wed Oct 14 09:31:27 2009 UTC (11 years, 3 months ago) by sborrill
Branch: netbsd-5
Changes since 1.123: +43 -2 lines
Diff to previous 1.123 (colored)

Pull up the following revisions(s) (requested by pooka in ticket #1088):
	include/dlfcn.h:	revision 1.20
	lib/libc/dlfcn/dlfcn_elf.c:	revision 1.6
	libexec/ld.elf_so/reloc.c:	revision 1.97
	libexec/ld.elf_so/rtld.c:	revision 1.125
	libexec/ld.elf_so/rtld.h:	revision 1.81
	libexec/ld.elf_so/symbol.c:	revision 1.48

Add Solarisa-like dlinfo() interface to the ELF dynamic linker.
Implement RTLD_DI_LINKMAP which returns a pointer to the linkmap
chain at the given object.  Other Solaris queries are currently
unimplemented.

Revision 1.125 / (download) - annotate - [select for diffs], Thu Sep 24 21:21:34 2009 UTC (11 years, 3 months ago) by pooka
Branch: MAIN
Changes since 1.124: +43 -2 lines
Diff to previous 1.124 (colored)

Add Solarisa-like dlinfo() interface to the ELF dynamic linker.
Implement RTLD_DI_LINKMAP which returns a pointer to the linkmap
chain at the given object.  Other Solaris queries are currently
unimplemented.

Revision 1.124 / (download) - annotate - [select for diffs], Tue May 19 20:44:52 2009 UTC (11 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.123: +4 -4 lines
Diff to previous 1.123 (colored)

warns=4

Revision 1.111.2.2 / (download) - annotate - [select for diffs], Fri Oct 31 21:00:36 2008 UTC (12 years, 2 months ago) by snj
Branch: netbsd-4
Changes since 1.111.2.1: +10 -8 lines
Diff to previous 1.111.2.1 (colored) to branchpoint 1.111 (colored) next main 1.112 (colored)

Pull up following revision(s) (requested by jmcneill in ticket #1211):
        libexec/ld.elf_so/symbol.c: revision 1.47
        libexec/ld.elf_so/rtld.h: revision 1.79
        libexec/ld.elf_so/rtld.c: revision 1.122
lib/39649: dlsym(3) does not follow dependencies
Pull across code from FreeBSD to do a search of the passed object and its
NEEDED objects (dependencies).

Revision 1.123 / (download) - annotate - [select for diffs], Sun Oct 26 07:11:54 2008 UTC (12 years, 2 months ago) by mrg
Branch: MAIN
CVS Tags: netbsd-5-base, 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, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20091211, matt-nb4-mips64-k7-u2a-k9b, jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend
Branch point for: netbsd-5, matt-nb5-mips64
Changes since 1.122: +7 -2 lines
Diff to previous 1.122 (colored)

if LD32DIR is defined:
- look in src/compat/lib/libc for libc_pic.
- define RTLD_ARCH_SUBDIR to "i386" or "sparc" for amd64 and sparc64
  builds, respectively
if RTLD_ARCH_SUBDIR is defined, add this path before
RTLD_DEFAULT_LIBRARY_PATH in the default search path.

Revision 1.107.2.2 / (download) - annotate - [select for diffs], Wed Oct 8 19:17:03 2008 UTC (12 years, 3 months ago) by bouyer
Branch: netbsd-3
Changes since 1.107.2.1: +8 -6 lines
Diff to previous 1.107.2.1 (colored) to branchpoint 1.107 (colored) next main 1.108 (colored)

Pull up following revision(s) (requested by jmcneill in ticket #1973):
	libexec/ld.elf_so/symbol.c: revision 1.47
	libexec/ld.elf_so/rtld.h: revision 1.79
	libexec/ld.elf_so/rtld.c: revision 1.122
lib/39649: dlsym(3) does not follow dependencies
Pull across code from FreeBSD to do a search of the passed object and it's
NEEDED objects (dependencies).
Reviewed by gimpy.

Revision 1.122 / (download) - annotate - [select for diffs], Sat Oct 4 09:37:12 2008 UTC (12 years, 3 months ago) by skrll
Branch: MAIN
CVS Tags: matt-mips64-base2
Changes since 1.121: +10 -8 lines
Diff to previous 1.121 (colored)

lib/39649: dlsym(3) does not follow dependencies

Pull across code from FreeBSD to do a search of the passed object and it's
NEEDED objects (dependencies).

Reviewed by gimpy.

Revision 1.121 / (download) - annotate - [select for diffs], Sat Sep 27 03:52:05 2008 UTC (12 years, 3 months ago) by macallan
Branch: MAIN
Changes since 1.120: +15 -3 lines
Diff to previous 1.120 (colored)

avoid usind __builtin_return_address(0) on PowerPC because it fails in
Xorg's module loader.
Should fix PR37812

Revision 1.117.8.2 / (download) - annotate - [select for diffs], Thu Sep 18 04:39:17 2008 UTC (12 years, 4 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.117.8.1: +20 -10 lines
Diff to previous 1.117.8.1 (colored) to branchpoint 1.117 (colored) next main 1.118 (colored)

Sync with wrstuden-revivesa-base-2.

Revision 1.120 / (download) - annotate - [select for diffs], Thu Jul 24 04:39:25 2008 UTC (12 years, 6 months ago) by matt
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-3, wrstuden-revivesa-base-2
Changes since 1.119: +19 -10 lines
Diff to previous 1.119 (colored)

Refactor common code to _rtld_relocate_plt_object to i386 and arm so they
act like the other versions.
In _rtld_bind, if the result is 0, call _rtld_die.
Initialize _rtld_sym_zero.st_value to -_rtld_objself.maprelocbase.  Now when
the symbol is resolved, st_value + maprelocbase will equal 0 and the above
check in _rtld_bind will fire and a call to NULL will be avoided.

Revision 1.119 / (download) - annotate - [select for diffs], Wed Jul 23 18:16:42 2008 UTC (12 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.118: +3 -2 lines
Diff to previous 1.118 (colored)

abort() if we are trying to use an undefined weak symbol from the plt. Remove
check from relocate_plt_object() since we cannot return _rtld_sym_zero anymore.
Code from gimpy.

Revision 1.117.8.1 / (download) - annotate - [select for diffs], Mon Jun 23 04:29:56 2008 UTC (12 years, 7 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.117: +4 -2 lines
Diff to previous 1.117 (colored)

Sync w/ -current. 34 merge conflicts to follow.

Revision 1.117.6.1 / (download) - annotate - [select for diffs], Tue Jun 17 09:13:39 2008 UTC (12 years, 7 months ago) by yamt
Branch: yamt-pf42
Changes since 1.117: +4 -2 lines
Diff to previous 1.117 (colored) next main 1.118 (colored)

sync with head.

Revision 1.118 / (download) - annotate - [select for diffs], Tue Jun 3 19:32:32 2008 UTC (12 years, 7 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-base4, wrstuden-revivesa-base-1, wrstuden-revivesa-base
Changes since 1.117: +4 -2 lines
Diff to previous 1.117 (colored)

Don't bother unmapping the ELF header unless it overlaps the first load
section.

Revision 1.113.4.2 / (download) - annotate - [select for diffs], Wed Jan 9 01:37:12 2008 UTC (13 years ago) by matt
Branch: matt-armv6
Changes since 1.113.4.1: +138 -25 lines
Diff to previous 1.113.4.1 (colored) to branchpoint 1.113 (colored) next main 1.114 (colored)

sync with HEAD

Revision 1.117 / (download) - annotate - [select for diffs], Fri Dec 7 20:34:05 2007 UTC (13 years, 1 month ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base3, yamt-pf42-base2, yamt-pf42-base, matt-armv6-nbase, matt-armv6-base, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-nbase, hpcarm-cleanup-base, cube-autoconf-base, cube-autoconf
Branch point for: yamt-pf42, wrstuden-revivesa
Changes since 1.116: +138 -25 lines
Diff to previous 1.116 (colored)

rtld changes for PR bin/37347:

- Apply patch from J.T. Conklin to execute .init/.fini functions in order.
- Support DF_1_INITFIRST and mark libc with DF_1_INITFIRST. Shared libs
  should be recording a dependency on libc, but it's too late to do that.

Ok christos@.

Revision 1.113.4.1 / (download) - annotate - [select for diffs], Tue Nov 6 23:12:10 2007 UTC (13 years, 2 months ago) by matt
Branch: matt-armv6
CVS Tags: matt-armv6-prevmlocking
Changes since 1.113: +20 -9 lines
Diff to previous 1.113 (colored)

sync with HEAD

Revision 1.116 / (download) - annotate - [select for diffs], Fri Oct 5 22:21:07 2007 UTC (13 years, 3 months ago) by ad
Branch: MAIN
Changes since 1.115: +3 -3 lines
Diff to previous 1.115 (colored)

- Don't use the names malloc/free/etc, since we can end up pulling in libc's
  malloc which is not what we want.
- Remove ancient memory compaction hack. Realloc on free memory is now an
  error again (from joerg@).

Ok christos@.

Revision 1.115 / (download) - annotate - [select for diffs], Fri Sep 21 13:57:09 2007 UTC (13 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.114: +3 -2 lines
Diff to previous 1.114 (colored)

Don't trust AT_SUN_EXECNAME, if we are set{u,g}id.

Revision 1.114 / (download) - annotate - [select for diffs], Thu Sep 20 14:14:26 2007 UTC (13 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.113: +18 -8 lines
Diff to previous 1.113 (colored)

Use AT_SUN_EXECPATH instead of argv[0] for the executable name. This needs
kernel support, which is not there yet, thus $ORIGIN is broken at this time.
This is ok, nothing uses it yet.

Revision 1.111.4.1 / (download) - annotate - [select for diffs], Mon Sep 3 07:02:25 2007 UTC (13 years, 4 months ago) by wrstuden
Branch: wrstuden-fixsa
Changes since 1.111: +3 -3 lines
Diff to previous 1.111 (colored) next main 1.112 (colored)

Sync w/ NetBSD-4-RC_1

Revision 1.111.2.1 / (download) - annotate - [select for diffs], Thu Jul 19 14:38:16 2007 UTC (13 years, 6 months ago) by liamjfoy
Branch: netbsd-4
CVS Tags: wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-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
Changes since 1.111: +3 -3 lines
Diff to previous 1.111 (colored)

Pull up following revision(s) (requested by soren in ticket #774):
	build.sh: revision 1.169
	gnu/usr.bin/gcc4/backend/Makefile: revision 1.9
	sys/arch/evbsh5/README: revision 1.1
	distrib/notes/common/contents: revision 1.124
	usr.sbin/ndbootd/ndbootd.c: revision 1.12
	gnu/lib/libopcodes/arch/sh3eb/defs.mk: revision 1.4
	gnu/lib/libbfd/arch/sh3eb/defs.mk: revision 1.8
	libexec/ld.elf_so/Makefile: revision 1.78
	gnu/dist/binutils/bfd/config.bfd: revision 1.14
	doc/HACKS: revision 1.93
	distrib/cdrom/current.conf: revision 1.8
	gnu/lib/libgcc4/Makefile.inc: revision 1.6
	share/mk/sys.mk: revision 1.90
	distrib/sets/lists/base/mi: revision 1.700
	libexec/ld.elf_so/rtld.c: revision 1.112
	distrib/sets/lists/base/mi: revision 1.702
	sys/arch/sh5/README: revision 1.1
	gnu/lib/libbfd/arch/sh3el/bfd.h: revision 1.7
	usr.sbin/traceroute/traceroute.c: revision 1.69
	distrib/notes/common/main: revision 1.330
	distrib/notes/common/list-setsizes.sh: revision 1.2
	sys/arch/Makefile: revision 1.35
	gnu/lib/libopcodes/arch/sh3el/defs.mk: revision 1.4
	gnu/lib/libbfd/arch/sh3el/defs.mk: revision 1.8
	share/mk/bsd.own.mk: revision 1.495
	gnu/lib/libbfd/arch/sh3eb/bfd.h: revision 1.7
	x11/lib/OSmesa/Makefile: revision 1.20
	sys/dev/dkwedge/dkwedge_bsdlabel.c: revision 1.13
	gnu/dist/binutils/opcodes/configure.in: revision 1.2
	gnu/dist/binutils/opcodes/configure: revision 1.2
	gnu/usr.bin/send-pr/categories: revision 1.53
	etc/mtree/NetBSD.dist: revision 1.339
	sys/arch/README: revision 1.42
	lib/libc/gdtoa/Makefile.inc: revision 1.6
	usr.bin/crunch/crunchide/Makefile: revision 1.16
	sys/lkm/net/bsdcomp/Makefile: revision 1.5
	regress/sys/uvm/Makefile: revision 1.6
	etc/MAKEDEV.awk: revision 1.18
	x11/Xserver/GL/GLcore/Makefile.GLcore: revision 1.10
	sys/contrib/dev/ath/netbsd/Makefile.ath.inc: revision 1.14
	gnu/lib/libbfd/Makefile: revision 1.42
	doc/RESPONSIBLE: revision 1.78
Remove evbsh5.

Revision 1.113 / (download) - annotate - [select for diffs], Fri May 18 21:44:08 2007 UTC (13 years, 8 months ago) by christos
Branch: MAIN
CVS Tags: matt-mips64-base, matt-mips64, hpcarm-cleanup
Branch point for: matt-armv6
Changes since 1.112: +11 -10 lines
Diff to previous 1.112 (colored)

Support Solaris-like $ORIGIN etc. expansions in paths.

Revision 1.112 / (download) - annotate - [select for diffs], Sun Apr 8 10:02:35 2007 UTC (13 years, 9 months ago) by scw
Branch: MAIN
Changes since 1.111: +3 -3 lines
Diff to previous 1.111 (colored)

Remove a test for defined(__SH5__).

Revision 1.111 / (download) - annotate - [select for diffs], Wed Nov 22 21:46:36 2006 UTC (14 years, 2 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-4-base
Branch point for: wrstuden-fixsa, netbsd-4
Changes since 1.110: +15 -9 lines
Diff to previous 1.110 (colored)

From defend dot the dot world at gmail dot com: Sanitize environment variables
for set{u,g}id binaries, so that in case they are playing with set{u,g}id
and exec'ing other binaries they don't get affected by the
LD_{PRELOAD,DEBUG,LIBRARY_PATH} environment setup. We leave LD_BIND_NOW alone.
There are no binaries affected in the base system.

Revision 1.110 / (download) - annotate - [select for diffs], Tue Mar 21 17:48:10 2006 UTC (14 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.109: +4 -4 lines
Diff to previous 1.109 (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.107.2.1 / (download) - annotate - [select for diffs], Wed Feb 1 20:38:06 2006 UTC (14 years, 11 months ago) by tron
Branch: netbsd-3
CVS Tags: 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
Changes since 1.107: +13 -3 lines
Diff to previous 1.107 (colored)

Pull up following revision(s) (requested by christos in ticket #1150):
	libexec/ld.elf_so/rtld.c: revision 1.109
Bring across a change from FreeBSD from back in 1998:
"Fix a bug that showed up when debugging dynamically linked programs.
References from GDB to "printf" and various other functions would
find the versions in the dynamic linker itself, rather than the
versions in the program's libc.  This fix moves the GDB link map
entry for the dynamic linker to the end of the search list, where
its symbols will be found only if they are not found anywhere else."
"printf" isn't true for us, but various libc symbols are, e.g. "malloc".
Fixes PR 32074 as noted by uwe@
OK'd by christos@

Revision 1.109 / (download) - annotate - [select for diffs], Thu Jan 12 22:40:17 2006 UTC (15 years ago) by skrll
Branch: MAIN
Changes since 1.108: +14 -4 lines
Diff to previous 1.108 (colored)

Bring across a change from FreeBSD from back in 1998:

"Fix a bug that showed up when debugging dynamically linked programs.
References from GDB to "printf" and various other functions would
find the versions in the dynamic linker itself, rather than the
versions in the program's libc.  This fix moves the GDB link map
entry for the dynamic linker to the end of the search list, where
its symbols will be found only if they are not found anywhere else."

"printf" isn't true for us, but various libc symbols are, e.g. "malloc".

Fixes PR 32074 as noted by uwe@

OK'd by christos@

Revision 1.108 / (download) - annotate - [select for diffs], Wed Jan 11 21:40:12 2006 UTC (15 years ago) by uwe
Branch: MAIN
Changes since 1.107: +8 -2 lines
Diff to previous 1.107 (colored)

_GLOBAL_OFFSET_TABLE_ is only used if RTLD_DEBUG, so wrap its
declaration too.

32-bit SuperH can not pretend that _GLOBAL_OFFSET_TABLE_ is a normal
variable, because of the way PIC variable references is generated, but
as compiler arranges for _GLOBAL_OFFSET_TABLE_ address to be in r12
anyway, just use that value by declaring it as a global register
variable.  Makes sh3 compile with RTLD_DEBUG.

Revision 1.107 / (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-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
Branch point for: netbsd-3
Changes since 1.106: +6 -1 lines
Diff to previous 1.106 (colored)

Add __RCSIDs.

OK'd by mycroft.

Revision 1.101.2.1 / (download) - annotate - [select for diffs], Mon Jul 19 09:06:52 2004 UTC (16 years, 6 months ago) by tron
Branch: netbsd-2-0
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-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
Changes since 1.101: +6 -1 lines
Diff to previous 1.101 (colored) next main 1.102 (colored)

Pull up revision 1.106 (requested by thorpej in ticket #676):
- Change the strong dlfcn names in libc to ___name, and make the __name
versions used by others in libc weak, so that we have:
name: weak
__name: weak
___name: strong
- Add __name strong aliases of the dlfcn names in ld.elf_so, so that
we have:
name: strong
__name: strong
This allows ld.elf_so to self-resolve both the name and __name variants
of the dlfcn functions, the former being required for dlfcn support in
applications, the latter being required for dlfcn support in libc.
Fixes the problem described in:
http://mail-index.netbsd.org/tech-toolchain/2004/07/17/0000.html
Reviewed by Nick.

Revision 1.106 / (download) - annotate - [select for diffs], Sun Jul 18 17:26:19 2004 UTC (16 years, 6 months ago) by thorpej
Branch: MAIN
Changes since 1.105: +6 -1 lines
Diff to previous 1.105 (colored)

- Change the strong dlfcn names in libc to ___name, and make the __name
  versions used by others in libc weak, so that we have:
	name: weak
	__name: weak
	___name: strong
- Add __name strong aliases of the dlfcn names in ld.elf_so, so that we have:
	name: strong
	__name: strong

This allows ld.elf_so to self-resolve both the name and __name variants
of the dlfcn functions, the former being required for dlfcn support in
applications, the latter being required for dlfcn support in libc.

Fixes the problem described in:

    http://mail-index.netbsd.org/tech-toolchain/2004/07/17/0000.html

Reviewed by Nick.

Revision 1.48.2.2 / (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.48.2.1: +220 -285 lines
Diff to previous 1.48.2.1 (colored) to branchpoint 1.48 (colored) next main 1.49 (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
- RTLD_SELF, RTLD_NEXT, RTLD_DEFAULT support
- much better structured code
- closes PR bin/25464

Revision 1.105 / (download) - annotate - [select for diffs], Mon May 17 13:16:02 2004 UTC (16 years, 8 months ago) by skrll
Branch: MAIN
Changes since 1.104: +9 -3 lines
Diff to previous 1.104 (colored)

Fix the dynamic linker for hppa using ELF.

Lazy binding doesn't work 100% of the time so force immediate binding.
One possible reason is that the PLT stub blows away r20 which the
compiler might not take into account.

Revision 1.104 / (download) - annotate - [select for diffs], Mon May 17 11:00:01 2004 UTC (16 years, 8 months ago) by skrll
Branch: MAIN
Changes since 1.103: +3 -3 lines
Diff to previous 1.103 (colored)

Test before commit.

Revision 1.103 / (download) - annotate - [select for diffs], Mon May 17 10:23:58 2004 UTC (16 years, 8 months ago) by skrll
Branch: MAIN
Changes since 1.102: +7 -4 lines
Diff to previous 1.102 (colored)

Re-arrange/correct some asserts.

Revision 1.102 / (download) - annotate - [select for diffs], Wed May 12 20:23:29 2004 UTC (16 years, 8 months ago) by skrll
Branch: MAIN
Changes since 1.101: +1 -5 lines
Diff to previous 1.101 (colored)

Garbage collect the RTLD_RELOCATE_SELF error.

Revision 1.101 / (download) - annotate - [select for diffs], Sun Sep 7 22:17:43 2003 UTC (17 years, 4 months ago) by mycroft
Branch: MAIN
CVS Tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Changes since 1.100: +1 -0 lines
Diff to previous 1.100 (colored)

Back out revision 1.100.  There is something screwier going on.

Revision 1.48.2.1 / (download) - annotate - [select for diffs], Fri Sep 5 19:15:01 2003 UTC (17 years, 4 months ago) by tron
Branch: netbsd-1-6
CVS Tags: 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
Changes since 1.48: +1 -8 lines
Diff to previous 1.48 (colored)

Pull up revision 1.54 via patch (requested by dmcmahill in ticket #1395):
Remove all of the `mark' code.  This is responsible for the `undefined
PLT
symbol' errors, probably because the increment gets interrupted
occasionally by
a signal.  In general, _rtld_bind() should not modify ANY internal
state.

Revision 1.100 / (download) - annotate - [select for diffs], Sun Aug 31 21:52:01 2003 UTC (17 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.99: +1 -2 lines
Diff to previous 1.99 (colored)

dlsym() should not leave an error set.  It confuses programs that check
dlerror() (such as pkgsrc/graphics/transcode).

Revision 1.99 / (download) - annotate - [select for diffs], Tue Aug 12 09:18:48 2003 UTC (17 years, 5 months ago) by skrll
Branch: MAIN
Changes since 1.98: +10 -7 lines
Diff to previous 1.98 (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.98 / (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.97: +34 -58 lines
Diff to previous 1.97 (colored)

ANSIfy and de-__P().

Revision 1.97 / (download) - annotate - [select for diffs], Mon Jul 21 15:17:55 2003 UTC (17 years, 6 months ago) by skrll
Branch: MAIN
Changes since 1.96: +3 -3 lines
Diff to previous 1.96 (colored)

arm and sh5 also have bogus DT_TEXTRELs. sh5 was already covered so just
update the comment.

Revision 1.96 / (download) - annotate - [select for diffs], Thu Jul 17 13:56:32 2003 UTC (17 years, 6 months ago) by skrll
Branch: MAIN
Changes since 1.95: +2 -2 lines
Diff to previous 1.95 (colored)

Correct the in_plt parameter of a couple of _rtld_find_symdef calls.

The mips_reloc.c case is a no-op as _rtld_symlook_obj ignores in_plt for
MIPS.

OK'ed by Charles.

Revision 1.95 / (download) - annotate - [select for diffs], Mon Jun 30 00:49:25 2003 UTC (17 years, 6 months ago) by marcus
Branch: MAIN
Changes since 1.94: +3 -3 lines
Diff to previous 1.94 (colored)

SH also has a bogus DT_TEXTREL, it seems.

Revision 1.94 / (download) - annotate - [select for diffs], Thu Jun 5 10:41:33 2003 UTC (17 years, 7 months ago) by simonb
Branch: MAIN
Changes since 1.93: +9 -1 lines
Diff to previous 1.93 (colored)

KNF- blank lines before code at start of functions.

Revision 1.93 / (download) - annotate - [select for diffs], Fri May 30 15:43:33 2003 UTC (17 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.92: +38 -17 lines
Diff to previous 1.92 (colored)

Add RTLD_FIRST, RTLD_NEXT, RTLD_DEFAULT, from FreeBSD

Revision 1.92 / (download) - annotate - [select for diffs], Thu Apr 24 16:55:29 2003 UTC (17 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.91: +38 -8 lines
Diff to previous 1.91 (colored)

Back out previous change for now -- it needs more work.

Revision 1.91 / (download) - annotate - [select for diffs], Wed Apr 23 17:40:25 2003 UTC (17 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.90: +9 -39 lines
Diff to previous 1.90 (colored)

Attempt to give dlsym() the same symbol-searching semantics as _rtld_bind().
Tested in a handful of cases.
Reviewed by: a dead silence

Revision 1.90 / (download) - annotate - [select for diffs], Sat Dec 14 15:37:57 2002 UTC (18 years, 1 month ago) by junyoung
Branch: MAIN
CVS Tags: fvdl_fs64_base
Changes since 1.89: +5 -2 lines
Diff to previous 1.89 (colored)

Gracefully exit when invoked directly. Use of assert() here caused a segfault.
Address PR#11785.

Revision 1.89 / (download) - annotate - [select for diffs], Thu Dec 5 04:56:57 2002 UTC (18 years, 1 month ago) by junyoung
Branch: MAIN
Changes since 1.88: +3 -1 lines
Diff to previous 1.88 (colored)

A bit speedup: in _rtld_load_object(), save the number of calls to
strcmp() by performing path name length comparison first. In the test
with Mozilla, the number was reduced to 1068 from 7182 (yes, we saved
6114 strcmp()!).

Revision 1.88 / (download) - annotate - [select for diffs], Sun Nov 24 18:13:30 2002 UTC (18 years, 2 months ago) by fvdl
Branch: MAIN
Changes since 1.87: +3 -3 lines
Diff to previous 1.87 (colored)

For the debug case, print relocbase as well at the start of _rtld().

Revision 1.87 / (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.86: +2 -1 lines
Diff to previous 1.86 (colored)

Minor cleanup.

Revision 1.86 / (download) - annotate - [select for diffs], Fri Oct 4 18:50:43 2002 UTC (18 years, 3 months ago) by mycroft
Branch: MAIN
Changes since 1.85: +1 -4 lines
Diff to previous 1.85 (colored)

Rearrange _rtld_map_object() a little, so that we don't have to have the first
page of the object double-mapped.  Not that it matters much, but someone was
whinging about it.
While I'm at it, nuke obj->phdr and obj->phsize; they're unused.

Revision 1.85 / (download) - annotate - [select for diffs], Fri Oct 4 03:59:41 2002 UTC (18 years, 3 months ago) by mycroft
Branch: MAIN
Changes since 1.84: +1 -4 lines
Diff to previous 1.84 (colored)

Move the definition of _rtld_list_main so ldd builds again.

Revision 1.84 / (download) - annotate - [select for diffs], Thu Oct 3 20:35:20 2002 UTC (18 years, 3 months ago) by mycroft
Branch: MAIN
Changes since 1.83: +23 -16 lines
Diff to previous 1.83 (colored)

As seen on tech-userlevel...

There are several optimizations here:

1) Objects on _rtld_list_main do not participate in the DAG structures
   at all.  This is okay because all symbols must be resolvable at
   link/load time, and _rtld_list_main is always searched first, so
   any references from those objects must necessarily be resolved to
   other objects on _rtld_list_main.

   (Making this work completely required setting obj->main a bit
   earlier; hence the RTLD_MAIN hack.)

2) Objects on _rtld_list_main are not put on _rtld_list_global,
   preventing an extra search.

3) A bit is used to keep track of whether an object is on
   _rtld_list_global, so we don't have to do a silly linear search.

4) A small attempt is made to prevent objects being put on the DAG
   lists multiple times (using a silly linear search).

The sum of this appears to be a ~10% (.3s) reduction in Mozilla's
startup time on my 800MHz box.

Also, make sure _rtld_objmain->path is always set, just to make the
debug output nicer.

Revision 1.83 / (download) - annotate - [select for diffs], Thu Oct 3 01:09:21 2002 UTC (18 years, 3 months ago) by mycroft
Branch: MAIN
Changes since 1.82: +6 -3 lines
Diff to previous 1.82 (colored)

Do not put objects on _rtld_list_main on any DAG member list -- any symbol we
will have already been found during the _rtld_list_main walk, so there's no
point in doing it again.

Revision 1.82 / (download) - annotate - [select for diffs], Thu Sep 26 22:26:26 2002 UTC (18 years, 3 months ago) by mycroft
Branch: MAIN
Changes since 1.81: +1 -5 lines
Diff to previous 1.81 (colored)

Implement a self-relocate function for the VAX.

Revision 1.81 / (download) - annotate - [select for diffs], Thu Sep 26 20:42:10 2002 UTC (18 years, 3 months ago) by mycroft
Branch: MAIN
Changes since 1.80: +4 -4 lines
Diff to previous 1.80 (colored)

Remove the `self' args to _rtld_relocate_objects() and
_rtld_relocate_nonplt_objects().

Revision 1.80 / (download) - annotate - [select for diffs], Thu Sep 26 20:35:56 2002 UTC (18 years, 3 months ago) by mycroft
Branch: MAIN
Changes since 1.79: +15 -35 lines
Diff to previous 1.79 (colored)

Clean up _rtld_init() -- there is no need to avoid globals.
Remove the call to _rtld_relocate_objects() completely -- except on VAX, where
we TEMPORARILY call _rtld_relocate_nonplt_objects() directly.
Also add more assertions -- ld.elf_so should never have PLT relocations.

Revision 1.79 / (download) - annotate - [select for diffs], Thu Sep 26 13:43:52 2002 UTC (18 years, 3 months ago) by mycroft
Branch: MAIN
Changes since 1.78: +2 -2 lines
Diff to previous 1.78 (colored)

Hm, the const isn't going to work.

Revision 1.78 / (download) - annotate - [select for diffs], Thu Sep 26 13:42:05 2002 UTC (18 years, 3 months ago) by mycroft
Branch: MAIN
Changes since 1.77: +3 -5 lines
Diff to previous 1.77 (colored)

Do not attempt to free(_rtld_objself.path) -- it's a pointer into our data
segment.

Revision 1.77 / (download) - annotate - [select for diffs], Wed Sep 25 06:43:46 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.76: +2 -2 lines
Diff to previous 1.76 (colored)

#if defined -> #ifdef

Revision 1.76 / (download) - annotate - [select for diffs], Tue Sep 24 20:23:11 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.75: +6 -6 lines
Diff to previous 1.75 (colored)

Put back the `in_plt' nonsense for now.
It turns out there is some deep-seated wackiness WRT function pointer
comparisons...

Revision 1.75 / (download) - annotate - [select for diffs], Tue Sep 24 18:25:54 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.74: +7 -3 lines
Diff to previous 1.74 (colored)

Touch up a little more -- some of the dbg()s never actually printed anything.

Revision 1.74 / (download) - annotate - [select for diffs], Tue Sep 24 18:23:14 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.73: +1 -8 lines
Diff to previous 1.73 (colored)

Previous change was done wrong.

Revision 1.73 / (download) - annotate - [select for diffs], Tue Sep 24 17:51:11 2002 UTC (18 years, 4 months ago) by junyoung
Branch: MAIN
Changes since 1.72: +3 -1 lines
Diff to previous 1.72 (colored)

Make sure that dbg() is disabled if LD_DEBUG is not defined. Now
debugging is easier with RTLD_DEBUG_RELOC.

Revision 1.72 / (download) - annotate - [select for diffs], Tue Sep 24 12:18:32 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.71: +2 -2 lines
Diff to previous 1.71 (colored)

Change the comment about l_offs.

Revision 1.71 / (download) - annotate - [select for diffs], Tue Sep 24 08:56:30 2002 UTC (18 years, 4 months ago) by junyoung
Branch: MAIN
Changes since 1.70: +6 -6 lines
Diff to previous 1.70 (colored)

Remove '\n' at the end of dbg strings.

Revision 1.70 / (download) - annotate - [select for diffs], Tue Sep 24 06:43:14 2002 UTC (18 years, 4 months ago) by junyoung
Branch: MAIN
Changes since 1.69: +1 -3 lines
Diff to previous 1.69 (colored)

END_SYM is no longer used.

Revision 1.69 / (download) - annotate - [select for diffs], Tue Sep 24 01:24:44 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.68: +8 -55 lines
Diff to previous 1.68 (colored)

Use/require AT_PAGESZ on all platforms.  (The kernel has exported it for ~3
years now.)  Use _rtld_pagesz instead of getpagesize() to determine the page
size in our local malloc().  Saves a system call.

Also, since we're now relocated early, we don't need to be careful to avoid
globals, so most of the VARPSZ hacks are eliminated.

Revision 1.68 / (download) - annotate - [select for diffs], Tue Sep 24 00:33:39 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.67: +2 -6 lines
Diff to previous 1.67 (colored)

Um, a little bit of sanity here:
l_addr is always supposed to be obj->relocbase -- or so says the GDB code that
uses it.  So, set it to this on all platforms.  It already was on VAX
explicitly, and on everything else except MIPS implicitly (because
mapbase==relocbase for all existing shlibs).  For some silly/stupid reason, a
new field was created that the MIPS GDB currently uses.
Another MD #ifdef bites it.

Revision 1.67 / (download) - annotate - [select for diffs], Mon Sep 23 23:56:48 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.66: +11 -23 lines
Diff to previous 1.66 (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().

Also:

* 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 1.66 / (download) - annotate - [select for diffs], Sat Sep 21 05:24:17 2002 UTC (18 years, 4 months ago) by junyoung
Branch: MAIN
Changes since 1.65: +3 -2 lines
Diff to previous 1.65 (colored)

Print the name of dynamic linker actually loaded.

Revision 1.65 / (download) - annotate - [select for diffs], Fri Sep 20 03:39:22 2002 UTC (18 years, 4 months ago) by junyoung
Branch: MAIN
Changes since 1.64: +9 -4 lines
Diff to previous 1.64 (colored)

Cosmetic changes (long lines).

Revision 1.64 / (download) - annotate - [select for diffs], Thu Sep 19 13:59:46 2002 UTC (18 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.63: +9 -5 lines
Diff to previous 1.63 (colored)

don't core dump setting progname if argv[0] == NULL. From xs@kittenz.org

Revision 1.63 / (download) - annotate - [select for diffs], Fri Sep 13 15:27:30 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.62: +2 -2 lines
Diff to previous 1.62 (colored)

The textrel special case is only needed for MIPS (due to a bug in BFD).

Revision 1.62 / (download) - annotate - [select for diffs], Fri Sep 13 14:23:07 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.61: +1 -5 lines
Diff to previous 1.61 (colored)

Kill the sparc64 argc conversion hack.

Revision 1.61 / (download) - annotate - [select for diffs], Fri Sep 13 03:17:21 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.60: +1 -5 lines
Diff to previous 1.60 (colored)

Nuke an unneeded hack for the Alpha.

Revision 1.60 / (download) - annotate - [select for diffs], Thu Sep 12 22:56:29 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.59: +17 -24 lines
Diff to previous 1.59 (colored)

Nuke -DRTLD_RELOCATE_SELF and `dodebug' from orbit.

Revision 1.59 / (download) - annotate - [select for diffs], Thu Sep 12 19:43:03 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.58: +2 -3 lines
Diff to previous 1.58 (colored)

ld.elf_so has no textrels on arm, i386 or vax -- and shouldn't on any platform,
but that's beside the point.

Revision 1.58 / (download) - annotate - [select for diffs], Thu Sep 12 17:45:41 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.57: +13 -20 lines
Diff to previous 1.57 (colored)

Add a `relocbase' argument to _rtld() and _rtld_init(), which is passed in
from the glue code in _rtld_start().  This is used to set objself.relocbase,
rather than assuming that it's the same as objself.mapbase (or 0 on MIPS).
Now -- with a bug fix to the kernel -- ld.elf_so can be linked at any VMA.

Revision 1.57 / (download) - annotate - [select for diffs], Wed Sep 11 20:48:21 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.56: +1 -1 lines
Diff to previous 1.56 (colored)

This is a gratuitous null commit to force rtld.o to be rebuilt.

Revision 1.56 / (download) - annotate - [select for diffs], Fri Sep 6 15:17:53 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.55: +4 -4 lines
Diff to previous 1.55 (colored)

Pass down an additional flag to _rtld_relocate_nonplt_objects() which
indicates whether we're relocating ld.elf_so itself.  Use this in some places
rather than hackish tests on `dodebug'.  (The Alpha and HPPA `dodebug' tests
were actually noops, because RTLD_RELOCATE_SELF is not set, and therefore
dodebug is always true.)

Revision 1.55 / (download) - annotate - [select for diffs], Fri Sep 6 13:27:48 2002 UTC (18 years, 4 months ago) by junyoung
Branch: MAIN
Changes since 1.54: +1 -7 lines
Diff to previous 1.54 (colored)

Remove typedef which was never used. Meaningless comment as well.

Revision 1.54 / (download) - annotate - [select for diffs], Thu Sep 5 21:57:09 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.53: +3 -8 lines
Diff to previous 1.53 (colored)

Remove all of the `mark' code.  This is responsible for the `undefined PLT
symbol' errors, probably because the increment gets interrupted occasionally by
a signal.  In general, _rtld_bind() should not modify ANY internal state.

Revision 1.53 / (download) - annotate - [select for diffs], Mon Aug 26 21:09:55 2002 UTC (18 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.52: +20 -3 lines
Diff to previous 1.52 (colored)

save 4 system calls by using AT_{R,E}{U,G}ID.

Revision 1.52 / (download) - annotate - [select for diffs], Fri Aug 9 10:03:08 2002 UTC (18 years, 5 months ago) by soren
Branch: MAIN
Changes since 1.51: +2 -2 lines
Diff to previous 1.51 (colored)

Remove extraneous \n's in {err,warn}{,x}.

Revision 1.51 / (download) - annotate - [select for diffs], Wed Jul 10 15:12:36 2002 UTC (18 years, 6 months ago) by fredette
Branch: MAIN
Changes since 1.50: +22 -3 lines
Diff to previous 1.50 (colored)

Add support for dynamic linking on HP PA-RISC.

Revision 1.50 / (download) - annotate - [select for diffs], Sat Jun 1 23:50:53 2002 UTC (18 years, 7 months ago) by lukem
Branch: MAIN
Changes since 1.49: +3 -13 lines
Diff to previous 1.49 (colored)

SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field).  whilst it's O(n),
  this mirrors the functionality of SLIST_REMOVE() (the other
  singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
  this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
  singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups

Revision 1.49 / (download) - annotate - [select for diffs], Sun May 26 00:02:07 2002 UTC (18 years, 8 months ago) by wiz
Branch: MAIN
Changes since 1.48: +2 -13 lines
Diff to previous 1.48 (colored)

__STDC__ is always defined on NetBSD.

Revision 1.48 / (download) - annotate - [select for diffs], Sun Feb 3 23:34:42 2002 UTC (18 years, 11 months ago) by thorpej
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-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.47: +4 -4 lines
Diff to previous 1.47 (colored)

Add support for dynamic linking on the SuperH.  From Marcus Comstedt,
with some bug fixes (namely, don't forget to consider the addend when
processing relocations) from me.

Revision 1.47 / (download) - annotate - [select for diffs], Fri Dec 14 21:25:22 2001 UTC (19 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.46: +2 -10 lines
Diff to previous 1.46 (colored)

Garbage-collect the OLD_GOT stuff.

Revision 1.46 / (download) - annotate - [select for diffs], Fri Dec 14 21:21:27 2001 UTC (19 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.45: +3 -2 lines
Diff to previous 1.45 (colored)

binutils-current ld emits DT_TEXTREL into _DYNAMIC on arm-elf.  Handle
this.

Revision 1.34.2.3 / (download) - annotate - [select for diffs], Sun Dec 9 17:21:33 2001 UTC (19 years, 1 month ago) by he
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-PATCH003
Changes since 1.34.2.2: +34 -45 lines
Diff to previous 1.34.2.2 (colored) to branchpoint 1.34 (colored) next main 1.35 (colored)

Pull up revisions 1.42-1.45 (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.45 / (download) - annotate - [select for diffs], Thu May 10 20:19:25 2001 UTC (19 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.44: +2 -1 lines
Diff to previous 1.44 (colored)

Unloading objects, can cause other objects whose reference count becomes
0 to be unloaded. Make sure that when we unload those objects we remove
any references to them from the globals list... This fixes SIGSEGV with
apache+mod_php+mysql.

XXX: This fix should be pulled up.

christos

Revision 1.44 / (download) - annotate - [select for diffs], Sat Feb 3 13:25:00 2001 UTC (19 years, 11 months ago) by pk
Branch: MAIN
Changes since 1.43: +30 -11 lines
Diff to previous 1.43 (colored)

Avoid the use of a `switch(){}' statement before _rtld_init() is called.
`switch()' code may be translated using a jump table approach which causes
it to reference the equivalent of a global variable, something that must
be avoided before _rtld_init() has run.

Revision 1.43 / (download) - annotate - [select for diffs], Fri Nov 10 23:53:04 2000 UTC (20 years, 2 months ago) by mycroft
Branch: MAIN
Changes since 1.42: +1 -27 lines
Diff to previous 1.42 (colored)

Make ldd(1) build again.

Revision 1.42 / (download) - annotate - [select for diffs], Fri Nov 10 21:31:30 2000 UTC (20 years, 2 months ago) by mycroft
Branch: MAIN
Changes since 1.41: +6 -11 lines
Diff to previous 1.41 (colored)

When dlopen()ing with RTLD_GLOBAL, also make dependent libraries RTLD_GLOBAL.

Revision 1.34.2.2 / (download) - annotate - [select for diffs], Tue Aug 29 01:47:42 2000 UTC (20 years, 4 months ago) by scottb
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-RELEASE, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA
Changes since 1.34.2.1: +5 -2 lines
Diff to previous 1.34.2.1 (colored) to branchpoint 1.34 (colored)

pullup version 1.41 (approved by thorpej):
  copy the real object filename to the rtld object path so that the
  Dl_info structure can be properly filled by dladdr().

Revision 1.41 / (download) - annotate - [select for diffs], Mon Aug 28 04:15:54 2000 UTC (20 years, 4 months ago) by scottb
Branch: MAIN
Changes since 1.40: +5 -2 lines
Diff to previous 1.40 (colored)

copy the real object filename to the rtld object path so that the
Dl_info structure can be properly filled by dladdr().

Revision 1.34.2.1 / (download) - annotate - [select for diffs], Wed Jul 26 23:45:22 2000 UTC (20 years, 6 months ago) by mycroft
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-ALPHA2
Changes since 1.34: +39 -10 lines
Diff to previous 1.34 (colored)

Approved by thorpej:
Add support for sparc64, including MD code and variable page size support.
Modify some variable types to insure they are the correct width on sparc64.

basesrc/libexec/ld.elf_so/arch/sparc64/Makefile.inc	0 -> 1.1
basesrc/libexec/ld.elf_so/arch/sparc64/mdreloc.c	0 -> 1.3
basesrc/libexec/ld.elf_so/arch/sparc64/rtld_start.S	0 -> 1.2
basesrc/libexec/ld.elf_so/headers.c			1.6 -> 1.8
basesrc/libexec/ld.elf_so/reloc.c			1.26 -> 1.27
basesrc/libexec/ld.elf_so/reloc.c			1.29 -> 1.31
basesrc/libexec/ld.elf_so/rtld.c			1.34 -> 1.35
basesrc/libexec/ld.elf_so/rtld.c			1.36 -> 1.40
basesrc/libexec/ld.elf_so/rtld.h			1.26 -> 1.27
basesrc/libexec/ld.elf_so/symbol.c			1.7 -> 1.9

Revision 1.40 / (download) - annotate - [select for diffs], Wed Jul 26 15:40:07 2000 UTC (20 years, 6 months ago) by mycroft
Branch: MAIN
Changes since 1.39: +7 -3 lines
Diff to previous 1.39 (colored)

The ELF ABI declares that argc must fill an `argument slot'.  Make it so.
For __sparc_v9__ only, do a hack to make executables work temporarily before
and after the kernel is switched.

Revision 1.39 / (download) - annotate - [select for diffs], Wed Jul 26 02:07:35 2000 UTC (20 years, 6 months ago) by mycroft
Branch: MAIN
Changes since 1.38: +7 -5 lines
Diff to previous 1.38 (colored)

Catch up with type changes.  Also:
* Apply DT_PLTRELSZ to (one of) pltrel or pltrela *after* we've finished
  parsing the headers, so we know which one.
* Fix sparc64 bogons.  (It works now!)

Revision 1.38 / (download) - annotate - [select for diffs], Wed Jul 19 15:01:16 2000 UTC (20 years, 6 months ago) by thorpej
Branch: MAIN
Changes since 1.37: +7 -3 lines
Diff to previous 1.37 (colored)

Make it build on non-VARPSZ again.

Revision 1.37 / (download) - annotate - [select for diffs], Tue Jul 18 22:33:55 2000 UTC (20 years, 6 months ago) by eeh
Branch: MAIN
Changes since 1.36: +15 -5 lines
Diff to previous 1.36 (colored)

Fix some issues with SPARC V9 ELF binaries.

Revision 1.36 / (download) - annotate - [select for diffs], Mon Jul 17 02:55:53 2000 UTC (20 years, 6 months ago) by matt
Branch: MAIN
Changes since 1.35: +5 -1 lines
Diff to previous 1.35 (colored)

More VAX ELF changes.

Revision 1.35 / (download) - annotate - [select for diffs], Fri Jul 14 21:59:58 2000 UTC (20 years, 6 months ago) by matt
Branch: MAIN
Changes since 1.34: +11 -2 lines
Diff to previous 1.34 (colored)

Initialize ld.elf_so's textsize.

Revision 1.31.2.1 / (download) - annotate - [select for diffs], Thu Jun 22 15:58:31 2000 UTC (20 years, 7 months ago) by minoura
Branch: minoura-xpg4dl
Changes since 1.31: +14 -6 lines
Diff to previous 1.31 (colored) next main 1.32 (colored)

Sync w/ netbsd-1-5-base.

Revision 1.34 / (download) - annotate - [select for diffs], Fri Jun 16 19:51:05 2000 UTC (20 years, 7 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-5-base
Branch point for: netbsd-1-5
Changes since 1.33: +9 -4 lines
Diff to previous 1.33 (colored)

Also set __mainprog_obj so .ini sections can call dlopen()

Revision 1.33 / (download) - annotate - [select for diffs], Sat Jun 3 06:51:57 2000 UTC (20 years, 7 months ago) by jdolecek
Branch: MAIN
Changes since 1.32: +2 -2 lines
Diff to previous 1.32 (colored)

slighly move the assert() added in last commit, so that it's
  actually useful

Revision 1.32 / (download) - annotate - [select for diffs], Fri Jun 2 22:52:28 2000 UTC (20 years, 7 months ago) by jdolecek
Branch: MAIN
Changes since 1.31: +6 -3 lines
Diff to previous 1.31 (colored)

_rtld_unref_dag(): needed->obj might be null if the unreffed object has
	some unsatisfied references (most often when compiled without necessary
	-Wl,-R), so check for that instead of causing null-dereference;
	this way the code has a chance to cleanup after itself and report
	the error to caller

Thanks to Jason Thorpe for helping fix this!

Revision 1.31 / (download) - annotate - [select for diffs], Sat Apr 15 05:41:46 2000 UTC (20 years, 9 months ago) by erh
Branch: MAIN
CVS Tags: minoura-xpg4dl-base
Branch point for: minoura-xpg4dl
Changes since 1.30: +40 -1 lines
Diff to previous 1.30 (colored)

Cause ld.elf_so to find the symbols for __progname and environ and set them.  If we wait until crt0 gets around to doing it it's too late for any library init functions.

Revision 1.30 / (download) - annotate - [select for diffs], Sat Apr 15 05:27:49 2000 UTC (20 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.29: +42 -42 lines
Diff to previous 1.29 (colored)

re-indent sanely _rtld_dlsym() [no functional change]

Revision 1.29 / (download) - annotate - [select for diffs], Mon Feb 7 19:02:49 2000 UTC (20 years, 11 months ago) by kleink
Branch: MAIN
Changes since 1.28: +2 -30 lines
Diff to previous 1.28 (colored)

Change _rtld_dlclose() to unload the object via _rtld_unload_object() rather
than by itself.  Besides being duplicated code the open-coded version
also did not take care of cleaning up after the object's DAG(!).
Fixes PR bin/8905.

Revision 1.23.2.1 / (download) - annotate - [select for diffs], Mon Dec 27 18:30:14 1999 UTC (21 years ago) by wrstuden
Branch: wrstuden-devbsize
Changes since 1.23: +317 -47 lines
Diff to previous 1.23 (colored) next main 1.24 (colored)

Pull up to last week's -current.

Revision 1.28 / (download) - annotate - [select for diffs], Mon Dec 13 09:09:34 1999 UTC (21 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221
Changes since 1.27: +10 -5 lines
Diff to previous 1.27 (colored)

Enable parsing and mapping of hardware dependent libraries in ld.so.conf
To be documented in the man page.

Revision 1.27 / (download) - annotate - [select for diffs], Wed Nov 10 18:48:19 1999 UTC (21 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.26: +6 -6 lines
Diff to previous 1.26 (colored)

Name consistencty nit: curmark -> _rtld_curmark

Revision 1.26 / (download) - annotate - [select for diffs], Wed Nov 10 18:34:49 1999 UTC (21 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.25: +2 -2 lines
Diff to previous 1.25 (colored)

Some slight cosmetic cleanup.

Revision 1.25 / (download) - annotate - [select for diffs], Sun Nov 7 00:21:13 1999 UTC (21 years, 2 months ago) by mycroft
Branch: MAIN
Changes since 1.24: +293 -28 lines
Diff to previous 1.24 (colored)

Changes from msaitoh to fix local/global symbol confusion, and to fix weak
symbol support -- updated by me for elf.h changes.

Revision 1.24 / (download) - annotate - [select for diffs], Mon Oct 25 13:57:12 1999 UTC (21 years, 3 months ago) by kleink
Branch: MAIN
CVS Tags: comdex-fall-1999-base, comdex-fall-1999
Changes since 1.23: +18 -18 lines
Diff to previous 1.23 (colored)

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

Revision 1.23 / (download) - annotate - [select for diffs], Thu Aug 19 23:42:15 1999 UTC (21 years, 5 months ago) by christos
Branch: MAIN
Branch point for: wrstuden-devbsize
Changes since 1.22: +2 -1 lines
Diff to previous 1.22 (colored)

enable /etc/ld.so.conf processing
[reviewed by thorpej]

Revision 1.22 / (download) - annotate - [select for diffs], Sun Aug 1 19:47:07 1999 UTC (21 years, 5 months ago) by kleink
Branch: MAIN
Changes since 1.21: +3 -2 lines
Diff to previous 1.21 (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.21 / (download) - annotate - [select for diffs], Thu Jul 22 00:18:19 1999 UTC (21 years, 6 months ago) by thorpej
Branch: MAIN
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

When dlopen()'ing a shared object without an absolute pathname, search
for it in the rpath of the main program as well as the path specified
in LD_LIBRARY_PATH.

Revision 1.17.2.1 / (download) - annotate - [select for diffs], Wed Jun 23 15:06:02 1999 UTC (21 years, 7 months ago) by perry
Branch: netbsd-1-4
CVS Tags: netbsd-1-4-PATCH003, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001
Changes since 1.17: +9 -1 lines
Diff to previous 1.17 (colored) next main 1.18 (colored)

pullup 1.18->1.19 (klienk): LD_PRELOAD support

Revision 1.20 / (download) - annotate - [select for diffs], Tue Jun 15 15:54:28 1999 UTC (21 years, 7 months ago) by kleink
Branch: MAIN
Changes since 1.19: +3 -1 lines
Diff to previous 1.19 (colored)

Don't include the ident .note assembly when linting.

Revision 1.19 / (download) - annotate - [select for diffs], Mon May 31 14:48:16 1999 UTC (21 years, 7 months ago) by kleink
Branch: MAIN
Changes since 1.18: +9 -1 lines
Diff to previous 1.18 (colored)

Implement LD_PRELOAD support.

Revision 1.18 / (download) - annotate - [select for diffs], Sun Apr 18 19:40:06 1999 UTC (21 years, 9 months ago) by ws
Branch: MAIN
Changes since 1.17: +20 -1 lines
Diff to previous 1.17 (colored)

Add code to use the kernel provided page size.
Enable this on the powerpc only for now.

Revision 1.17 / (download) - annotate - [select for diffs], Mon Mar 8 10:44:25 1999 UTC (21 years, 10 months ago) by kleink
Branch: MAIN
CVS Tags: netbsd-1-4-base, netbsd-1-4-RELEASE
Branch point for: netbsd-1-4
Changes since 1.16: +4 -6 lines
Diff to previous 1.16 (colored)

Update an i386-ismed comment.

Revision 1.16 / (download) - annotate - [select for diffs], Wed Mar 3 21:18:00 1999 UTC (21 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored)

Make this compile without -DRTLD_LOADER and fix printf format problems on
the alpha.

Revision 1.15 / (download) - annotate - [select for diffs], Mon Mar 1 16:40:07 1999 UTC (21 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.14: +361 -344 lines
Diff to previous 1.14 (colored)

KNF

Revision 1.14 / (download) - annotate - [select for diffs], Sat Feb 27 10:35:16 1999 UTC (21 years, 10 months ago) by pk
Branch: MAIN
Changes since 1.13: +66 -56 lines
Diff to previous 1.13 (colored)

Just initialize the stack-based temporary `rtld self' object.

Revision 1.13 / (download) - annotate - [select for diffs], Wed Feb 24 18:31:00 1999 UTC (21 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.12: +51 -33 lines
Diff to previous 1.12 (colored)

Cleanup global variable access so rtld can be self relocating. Also KNF
reloc.c and move md sparc parts to arch/sparc/mdreloc.c
Now we don't need to load at address 0 on the i386 and the mips should be
trivial to fix.

Revision 1.12 / (download) - annotate - [select for diffs], Sun Jan 10 18:18:56 1999 UTC (22 years ago) by christos
Branch: MAIN
Changes since 1.11: +18 -10 lines
Diff to previous 1.11 (colored)

Add i386 bits

Revision 1.11 / (download) - annotate - [select for diffs], Sat Jan 9 18:10:19 1999 UTC (22 years ago) by castor
Branch: MAIN
Changes since 1.10: +2 -1 lines
Diff to previous 1.10 (colored)

Restore missing variable declaration with -DRTLD_DEBUG

Revision 1.10 / (download) - annotate - [select for diffs], Wed Oct 7 02:53:27 1998 UTC (22 years, 3 months ago) by ross
Branch: MAIN
Changes since 1.9: +32 -25 lines
Diff to previous 1.9 (colored)

Rewrite AuxInfo handling to track AuxID changes in sys/exec_elf.h.

Revision 1.5.2.2 / (download) - annotate - [select for diffs], Sun Sep 27 23:18:23 1998 UTC (22 years, 3 months ago) by cgd
Branch: netbsd-1-3
CVS Tags: netbsd-1-3-PATCH003-CANDIDATE2, netbsd-1-3-PATCH003-CANDIDATE1, netbsd-1-3-PATCH003-CANDIDATE0, netbsd-1-3-PATCH003
Changes since 1.5.2.1: +3 -1 lines
Diff to previous 1.5.2.1 (colored) to branchpoint 1.5 (colored) next main 1.6 (colored)

pull up rev 1.7 from trunk (mhitch).

Revision 1.9 / (download) - annotate - [select for diffs], Wed Jul 15 11:26:28 1998 UTC (22 years, 6 months ago) by tv
Branch: MAIN
Changes since 1.8: +5 -15 lines
Diff to previous 1.8 (colored)

Some local changes accidentally made it into the last commit; back that
part out (noticed by mycroft; thanks!)

Revision 1.8 / (download) - annotate - [select for diffs], Tue Jul 14 22:18:37 1998 UTC (22 years, 6 months ago) by tv
Branch: MAIN
Changes since 1.7: +16 -10 lines
Diff to previous 1.7 (colored)

Change ld.so default behavior to RTLD_LOCAL, and make RTLD_LOCAL into a
new flag bit.  Keep RTLD_GLOBAL as an actual flag bit so it won't be
re-used, or may be used for something later.  Mask the dlopen() mode bits
in ld.elf_so so a comparison against RTLD_NOW works.  (RTLD_{LOCAL,GLOBAL}
needs to be implemented for ld.elf_so.)

Revision 1.7 / (download) - annotate - [select for diffs], Tue Jun 16 03:24:13 1998 UTC (22 years, 7 months ago) by mhitch
Branch: MAIN
Changes since 1.6: +3 -1 lines
Diff to previous 1.6 (colored)

Don't forget to update _rtld_objtail when _rtld_dlclose() removes the
current tail entry.

Revision 1.5.2.1 / (download) - annotate - [select for diffs], Fri May 8 17:39:12 1998 UTC (22 years, 8 months ago) by mycroft
Branch: netbsd-1-3
CVS Tags: netbsd-1-3-PATCH002
Changes since 1.5: +16 -2 lines
Diff to previous 1.5 (colored)

Sync with trunk, per request of mycroft.

Revision 1.6 / (download) - annotate - [select for diffs], Wed Mar 25 04:13:02 1998 UTC (22 years, 10 months ago) by mhitch
Branch: MAIN
Changes since 1.5: +16 -2 lines
Diff to previous 1.5 (colored)

Add support for mips.

Revision 1.5 / (download) - annotate - [select for diffs], Wed Oct 8 08:55:37 1997 UTC (23 years, 3 months ago) by mrg
Branch: MAIN
CVS Tags: netbsd-1-3-base, netbsd-1-3-RELEASE, netbsd-1-3-PATCH001, netbsd-1-3-BETA
Branch point for: netbsd-1-3
Changes since 1.4: +3 -1 lines
Diff to previous 1.4 (colored)

WARNS?=1

Revision 1.4 / (download) - annotate - [select for diffs], Tue Apr 15 07:15:46 1997 UTC (23 years, 9 months ago) by cgd
Branch: MAIN
Changes since 1.3: +3 -2 lines
Diff to previous 1.3 (colored)

make sure that ld.elf_so's path is in the data segment

Revision 1.3 / (download) - annotate - [select for diffs], Fri Mar 21 05:39:42 1997 UTC (23 years, 10 months ago) by cgd
Branch: MAIN
Changes since 1.2: +4 -2 lines
Diff to previous 1.2 (colored)

put in two identifying notes, which new binutils snapshots will turn
into PT_NOTE sections so they can be examined by execve() to figure
out whether this is a native binary, what emulation it's to be run under,
etc.

Revision 1.2 / (download) - annotate - [select for diffs], Wed Dec 18 22:27:29 1996 UTC (24 years, 1 month ago) by cgd
Branch: MAIN
Changes since 1.1: +5 -4 lines
Diff to previous 1.1 (colored)

nclude dlfcn.h, and pull RLTD_LAZY in from there.  Assume that RTLD_NOW is
RLTD_LAZY + 1 (for now), if it's not defined.  RTLD_NOW should be defined
in dlfcn.h, since some code (e.g. X11) wants it and assumes that it has
the value currently used by our RTLD_LAZY.

Revision 1.1 / (download) - annotate - [select for diffs], Mon Dec 16 20:38:03 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 <matt@3am-software.com>, 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 <webmaster@jp.NetBSD.org>