The NetBSD Project

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

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.69.4.1 / (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.69: +220 -113 lines
Diff to previous 1.69 (colored) next main 1.70 (colored)

Merge changes from current as of 20200406

Revision 1.73 / (download) - annotate - [select for diffs], Sat Feb 29 18:45:20 2020 UTC (10 months, 2 weeks ago) by kamil
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, is-mlppp-base, is-mlppp, HEAD
Changes since 1.72: +3 -3 lines
Diff to previous 1.72 (colored)

Fix vax and mips build

Revision 1.72 / (download) - annotate - [select for diffs], Sat Feb 29 04:24:33 2020 UTC (10 months, 2 weeks ago) by kamil
Branch: MAIN
Changes since 1.71: +82 -7 lines
Diff to previous 1.71 (colored)

Implement DT_GNU_HASH

DT_GNU_HASH serves the same purpose as DT_HASH, however it is a distinct
and faster apprach implemented and designed in the GNU toolchain in 2006.

DT_GNU_HASH is preferred whenever available.

Original GNU benchmarks claim 50% faster dynamic linking time.
https://www.sourceware.org/ml/binutils/2006-06/msg00418.html

Code based on FreeBSD and OpenBSD, both were based on DragonFlyBSD.

Revision 1.71 / (download) - annotate - [select for diffs], Sat Feb 29 04:23:05 2020 UTC (10 months, 2 weeks ago) by kamil
Branch: MAIN
Changes since 1.70: +28 -11 lines
Diff to previous 1.70 (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.70 / (download) - annotate - [select for diffs], Sat Feb 29 04:21:42 2020 UTC (10 months, 2 weeks ago) by kamil
Branch: MAIN
Changes since 1.69: +118 -103 lines
Diff to previous 1.69 (colored)

Separate matched symbol functionality out of _rtld_symlook_obj()

Simplifies the code and it will allow to use the matched symbol
functionality by other users.

Revision 1.67.6.2 / (download) - annotate - [select for diffs], Thu Aug 31 08:36:58 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.67.6.1: +17 -2 lines
Diff to previous 1.67.6.1 (colored) to branchpoint 1.67 (colored) next main 1.68 (colored)

Pull up following revision(s) (requested by joerg in ticket #236):
	libexec/ld.elf_so/symbol.c: revision 1.69
If a DF_1_NODELETE DSO has been removed from the DAG list, it still
needs to be able to resolve relocations against itself. As such, search
the referencing object explicitly last, if it hasn't been searched
before.

Revision 1.69 / (download) - annotate - [select for diffs], Wed Aug 9 18:44:32 2017 UTC (3 years, 5 months ago) by joerg
Branch: MAIN
CVS Tags: phil-wifi-base, phil-wifi-20191119, phil-wifi-20190609, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, netbsd-9-base, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9
Branch point for: phil-wifi
Changes since 1.68: +17 -2 lines
Diff to previous 1.68 (colored)

If a DF_1_NODELETE DSO has been removed from the DAG list, it still
needs to be able to resolve relocations against itself. As such, search
the referencing object explicitly last, if it hasn't been searched
before.

Revision 1.67.6.1 / (download) - annotate - [select for diffs], Tue Jul 4 12:47:58 2017 UTC (3 years, 6 months ago) by martin
Branch: netbsd-8
Changes since 1.67: +2 -48 lines
Diff to previous 1.67 (colored)

Pull up following revision(s) (requested by joerg in ticket #64):
	libexec/ld.elf_so/arch/arm/mdreloc.c: revision 1.40
	libexec/ld.elf_so/arch/arm/mdreloc.c: revision 1.41
	libexec/ld.elf_so/arch/hppa/hppa_reloc.c: revision 1.44
	libexec/ld.elf_so/arch/riscv/mdreloc.c: revision 1.3
	libexec/ld.elf_so/arch/aarch64/mdreloc.c: revision 1.3
	libexec/ld.elf_so/arch/sparc64/mdreloc.c: revision 1.60
	libexec/ld.elf_so/arch/m68k/mdreloc.c: revision 1.32
	libexec/ld.elf_so/arch/sparc64/mdreloc.c: revision 1.61
	libexec/ld.elf_so/arch/or1k/mdreloc.c: revision 1.2
	libexec/ld.elf_so/arch/sparc/mdreloc.c: revision 1.50
	libexec/ld.elf_so/arch/sh3/mdreloc.c: revision 1.33
	libexec/ld.elf_so/arch/sh3/mdreloc.c: revision 1.34
	libexec/ld.elf_so/arch/arm/mdreloc.c: revision 1.39
	libexec/ld.elf_so/symbol.c: revision 1.68
	libexec/ld.elf_so/arch/mips/mips_reloc.c: revision 1.66
	libexec/ld.elf_so/arch/mips/mips_reloc.c: revision 1.67
	libexec/ld.elf_so/arch/mips/mips_reloc.c: revision 1.68
	libexec/ld.elf_so/arch/x86_64/mdreloc.c: revision 1.42
	libexec/ld.elf_so/arch/powerpc/ppc_reloc.c: revision 1.54
	libexec/ld.elf_so/Makefile: revision 1.137
	libexec/ld.elf_so/arch/vax/mdreloc.c: revision 1.32
	libexec/ld.elf_so/rtld.h: revision 1.127
	libexec/ld.elf_so/arch/vax/mdreloc.c: revision 1.33
	libexec/ld.elf_so/arch/i386/mdreloc.c: revision 1.38
	libexec/ld.elf_so/arch/alpha/alpha_reloc.c: revision 1.42
	libexec/ld.elf_so/map_object.c: revision 1.58
	libexec/ld.elf_so/arch/sparc/mdreloc.c: revision 1.49
Replace COMBREL with just-in-time check in _rtld_relocate_nonplt_objects.
The COMBREL logic predates thread-safety of the dynamic linker and
breaks the use of shared locks for the common symbol lookup case. It is
unlikely to provide any benefit for lazy binding or PLT lookups, so
provide equivalent functionality in the non-PLT relocation handling loop
by checking if the symbol used by the current relocation is the same as
the one used during the last lookup. No inter-object cachine is done as
it is also unlikely to be benefical.
Testing with Firefox startup on AMD64 shows a small performance gain by
the new method.
Drop symbol number from default branch diagnostic, it isn't set at this
point and most likely not valid either.
Expand symnum, GCC's uninitialized used tracking is too imprecise.
Fix C&P bug. Deal with more MIPS hacks overriding def.
Add last_symnum, move up def and defobj.
Add back symnum, fix debug print.
Replace last use of r_type.
Fix indentation.
Fix indentation.

Revision 1.68 / (download) - annotate - [select for diffs], Mon Jun 19 11:57:01 2017 UTC (3 years, 6 months ago) by joerg
Branch: MAIN
CVS Tags: perseant-stdc-iso10646-base, perseant-stdc-iso10646
Changes since 1.67: +2 -48 lines
Diff to previous 1.67 (colored)

Replace COMBREL with just-in-time check in _rtld_relocate_nonplt_objects.

The COMBREL logic predates thread-safety of the dynamic linker and
breaks the use of shared locks for the common symbol lookup case. It is
unlikely to provide any benefit for lazy binding or PLT lookups, so
provide equivalent functionality in the non-PLT relocation handling loop
by checking if the symbol used by the current relocation is the same as
the one used during the last lookup. No inter-object cachine is done as
it is also unlikely to be benefical.

Testing with Firefox startup on AMD64 shows a small performance gain by
the new method.

Revision 1.65.6.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.65: +4 -43 lines
Diff to previous 1.65 (colored) next main 1.66 (colored)

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

Revision 1.67 / (download) - annotate - [select for diffs], Thu Dec 1 14:29:15 2016 UTC (4 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, netbsd-8-base, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: netbsd-8
Changes since 1.66: +4 -43 lines
Diff to previous 1.66 (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.66 / (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.65: +3 -3 lines
Diff to previous 1.65 (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.61.2.2 / (download) - annotate - [select for diffs], Wed Aug 20 00:02:22 2014 UTC (6 years, 4 months ago) by tls
Branch: tls-maxphys
Changes since 1.61.2.1: +2 -2 lines
Diff to previous 1.61.2.1 (colored) to branchpoint 1.61 (colored) next main 1.62 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.65 / (download) - annotate - [select for diffs], Sun Aug 10 23:35:26 2014 UTC (6 years, 5 months ago) by matt
Branch: MAIN
CVS Tags: tls-maxphys-base, pgoyette-localcount-base, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, localcount-20160914
Branch point for: pgoyette-localcount
Changes since 1.64: +3 -3 lines
Diff to previous 1.64 (colored)

Don't provide __gnu_Unwind_Find_exidx if __ARM_DWARF_EH__ is defined

Revision 1.58.2.3 / (download) - annotate - [select for diffs], Thu May 22 11:37:13 2014 UTC (6 years, 7 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.58.2.2: +9 -6 lines
Diff to previous 1.58.2.2 (colored) to branchpoint 1.58 (colored) next main 1.59 (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.64 / (download) - annotate - [select for diffs], Fri Mar 21 01:40:41 2014 UTC (6 years, 9 months ago) by matt
Branch: MAIN
CVS Tags: yamt-pagecache-base9, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15
Changes since 1.63: +3 -3 lines
Diff to previous 1.63 (colored)

Don't resolve symbols to PLT entries on the VAX.  It just causes a lot of
overhead.

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

resync from head

Revision 1.63 / (download) - annotate - [select for diffs], Fri May 3 10:27:05 2013 UTC (7 years, 8 months ago) by skrll
Branch: MAIN
CVS Tags: riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2
Changes since 1.62: +5 -5 lines
Diff to previous 1.62 (colored)

Remove trailing whitespace

Revision 1.62 / (download) - annotate - [select for diffs], Wed Apr 24 22:37:20 2013 UTC (7 years, 8 months ago) by matt
Branch: MAIN
Changes since 1.61: +5 -2 lines
Diff to previous 1.61 (colored)

Add support for PT_ARM_EXIDX and __gnu_Unwind_Find_exidx for libgcc's support
of the ARM EHABI.

Revision 1.59.4.1 / (download) - annotate - [select for diffs], Tue Jan 22 21:47:28 2013 UTC (7 years, 11 months ago) by matt
Branch: matt-nb6-plus
Changes since 1.59: +2 -4 lines
Diff to previous 1.59 (colored) next main 1.60 (colored)

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

Revision 1.58.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
CVS Tags: yamt-pagecache-tag8
Changes since 1.58.2.1: +2 -4 lines
Diff to previous 1.58.2.1 (colored) to branchpoint 1.58 (colored)

sync with head

Revision 1.61 / (download) - annotate - [select for diffs], Wed Aug 15 03:46:07 2012 UTC (8 years, 5 months ago) by matt
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, agc-symver-base, agc-symver
Branch point for: tls-maxphys
Changes since 1.60: +2 -4 lines
Diff to previous 1.60 (colored)

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

Revision 1.58.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.58: +12 -11 lines
Diff to previous 1.58 (colored)

sync with head

Revision 1.47.4.3 / (download) - annotate - [select for diffs], Sat Mar 17 18:28:34 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.47.4.2: +67 -16 lines
Diff to previous 1.47.4.2 (colored) to branchpoint 1.47 (colored) next main 1.48 (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.60 / (download) - annotate - [select for diffs], Thu Feb 16 23:00:39 2012 UTC (8 years, 11 months ago) by joerg
Branch: MAIN
CVS Tags: yamt-pagecache-base5, yamt-pagecache-base4
Changes since 1.59: +3 -2 lines
Diff to previous 1.59 (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.59 / (download) - annotate - [select for diffs], Fri Nov 25 14:39:02 2011 UTC (9 years, 1 month ago) by joerg
Branch: MAIN
CVS Tags: netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base
Branch point for: matt-nb6-plus
Changes since 1.58: +11 -11 lines
Diff to previous 1.58 (colored)

Replace if() NADA else if() NADA else continue logic with one explicit
block. Split out the MIPS handling to make it explicit and readable.

Revision 1.58 / (download) - annotate - [select for diffs], Sat Aug 13 22:24:57 2011 UTC (9 years, 5 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.57: +3 -3 lines
Diff to previous 1.57 (colored)

printing the pathname of the shared object is much more useful than the
object's address.

Revision 1.57 / (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.56: +128 -41 lines
Diff to previous 1.56 (colored)

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

Revision 1.56 / (download) - annotate - [select for diffs], Sat Mar 12 22:54:36 2011 UTC (9 years, 10 months ago) by joerg
Branch: MAIN
CVS Tags: cherry-xenmp-base, cherry-xenmp
Changes since 1.55: +5 -2 lines
Diff to previous 1.55 (colored)

Add TLS support for AMD64, i386 and SH3.

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

Revision 1.55 / (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.54: +7 -2 lines
Diff to previous 1.54 (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.54 / (download) - annotate - [select for diffs], Sat Oct 16 10:27:07 2010 UTC (10 years, 3 months ago) by skrll
Branch: MAIN
CVS Tags: matt-mips64-premerge-20101231, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Changes since 1.53: +3 -2 lines
Diff to previous 1.53 (colored)

Implement dl_iterate_phdr.

Somewhat taken from FreeBSD. Manual page from OpenBSD.

Revision 1.47.10.1 / (download) - annotate - [select for diffs], Wed Apr 21 05:26:10 2010 UTC (10 years, 8 months ago) by matt
Branch: matt-nb5-mips64
CVS Tags: matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-k15
Changes since 1.47: +21 -6 lines
Diff to previous 1.47 (colored) next main 1.48 (colored)

sync to netbsd-5

Revision 1.53 / (download) - annotate - [select for diffs], Mon Apr 5 14:01:26 2010 UTC (10 years, 9 months ago) by joerg
Branch: MAIN
Changes since 1.52: +5 -3 lines
Diff to previous 1.52 (colored)

Use fast_remainder32 for the ELF hash. For the hot cache case, this
speeds up Firefox startup by over 2% on AMD64.
Limit hash table buckets to 32bit.

Revision 1.52 / (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.51: +2 -4 lines
Diff to previous 1.51 (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.51 / (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.50: +45 -11 lines
Diff to previous 1.50 (colored)

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

Revision 1.47.4.2 / (download) - annotate - [select for diffs], Sat Jan 30 18:53:47 2010 UTC (10 years, 11 months ago) by snj
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.47.4.1: +20 -6 lines
Diff to previous 1.47.4.1 (colored) to branchpoint 1.47 (colored)

Pull up following revision(s) (requested by skrll in ticket #1266):
	libexec/ld.elf_so/map_object.c: revision 1.39
	libexec/ld.elf_so/rtld.h: revision 1.83
	libexec/ld.elf_so/symbol.c: revision 1.49
Reset the COMBRELOC cache Obj_Entry if it was freed.
Fixes PR 41482. Done slightly differently to the patch in the PR.

Revision 1.50 / (download) - annotate - [select for diffs], Wed Jan 13 20:17:21 2010 UTC (11 years ago) by christos
Branch: MAIN
Changes since 1.49: +25 -7 lines
Diff to previous 1.49 (colored)

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@

Revision 1.49 / (download) - annotate - [select for diffs], Sun Jan 10 07:29:47 2010 UTC (11 years ago) by skrll
Branch: MAIN
Changes since 1.48: +20 -6 lines
Diff to previous 1.48 (colored)

Reset the COMBRELOC cache Obj_Entry if it was freed.

Fixes PR 41482. Done slightly differently to the patch in the PR.

Revision 1.47.4.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.47: +3 -2 lines
Diff to previous 1.47 (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.48 / (download) - annotate - [select for diffs], Thu Sep 24 21:21:34 2009 UTC (11 years, 3 months ago) by pooka
Branch: MAIN
CVS Tags: matt-premerge-20091211
Changes since 1.47: +3 -2 lines
Diff to previous 1.47 (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.40.4.1 / (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.40: +52 -2 lines
Diff to previous 1.40 (colored) next main 1.41 (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.38.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.38.2.1: +50 -0 lines
Diff to previous 1.38.2.1 (colored) to branchpoint 1.38 (colored) next main 1.39 (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.47 / (download) - annotate - [select for diffs], Sat Oct 4 09:37:12 2008 UTC (12 years, 3 months ago) by skrll
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, matt-mips64-base2, jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend
Branch point for: netbsd-5, matt-nb5-mips64
Changes since 1.46: +52 -2 lines
Diff to previous 1.46 (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.44.6.1 / (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.44: +9 -4 lines
Diff to previous 1.44 (colored) next main 1.45 (colored)

Sync with wrstuden-revivesa-base-2.

Revision 1.46 / (download) - annotate - [select for diffs], Thu Jul 24 04:39:25 2008 UTC (12 years, 5 months ago) by matt
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-3, wrstuden-revivesa-base-2
Changes since 1.45: +2 -3 lines
Diff to previous 1.45 (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.45 / (download) - annotate - [select for diffs], Wed Jul 23 18:16:42 2008 UTC (12 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.44: +10 -4 lines
Diff to previous 1.44 (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.42.4.2 / (download) - annotate - [select for diffs], Sun Mar 23 00:41:24 2008 UTC (12 years, 9 months ago) by matt
Branch: matt-armv6
Changes since 1.42.4.1: +3 -3 lines
Diff to previous 1.42.4.1 (colored) to branchpoint 1.42 (colored) next main 1.43 (colored)

sync with HEAD

Revision 1.44 / (download) - annotate - [select for diffs], Mon Jan 14 08:53:42 2008 UTC (13 years ago) by yamt
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-pf42-base, yamt-pf42, wrstuden-revivesa-base-1, wrstuden-revivesa-base, matt-armv6-nbase, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-nbase, hpcarm-cleanup-base
Branch point for: wrstuden-revivesa
Changes since 1.43: +3 -3 lines
Diff to previous 1.43 (colored)

constify

Revision 1.42.4.1 / (download) - annotate - [select for diffs], Wed Jan 9 01:37:13 2008 UTC (13 years ago) by matt
Branch: matt-armv6
Changes since 1.42: +9 -8 lines
Diff to previous 1.42 (colored)

sync with HEAD

Revision 1.43 / (download) - annotate - [select for diffs], Wed Dec 26 21:10:03 2007 UTC (13 years ago) by christos
Branch: MAIN
CVS Tags: matt-armv6-base
Changes since 1.42: +9 -8 lines
Diff to previous 1.42 (colored)

print the symbol we are seaching for [when debugging]

Revision 1.42 / (download) - annotate - [select for diffs], Fri Feb 23 01:16:32 2007 UTC (13 years, 10 months ago) by matt
Branch: MAIN
CVS Tags: matt-mips64-base, matt-mips64, matt-armv6-prevmlocking, hpcarm-cleanup, cube-autoconf-base, cube-autoconf
Branch point for: matt-armv6
Changes since 1.41: +13 -12 lines
Diff to previous 1.41 (colored)

Don't use cached results for plt lookups (nor save them).

Revision 1.41 / (download) - annotate - [select for diffs], Thu Feb 22 18:57:48 2007 UTC (13 years, 10 months ago) by matt
Branch: MAIN
Changes since 1.40: +35 -4 lines
Diff to previous 1.40 (colored)

Make the COMBRELOC support generic.

Revision 1.38.2.1 / (download) - annotate - [select for diffs], Tue Dec 6 23:31:32 2005 UTC (15 years, 1 month 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, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0
Changes since 1.38: +15 -26 lines
Diff to previous 1.38 (colored)

Pull up following revision(s) (requested by oster in ticket #1012):
	libexec/ld.elf_so/symbol.c: revision 1.39
in _rtld_is_exported(), use a function pointer type instead of Elf_Addr
so that hppa knows to do the plabel thang.

Revision 1.40 / (download) - annotate - [select for diffs], Thu Oct 13 11:14:09 2005 UTC (15 years, 3 months ago) by skrll
Branch: MAIN
CVS Tags: wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, abandoned-netbsd-4-base, abandoned-netbsd-4
Branch point for: netbsd-4
Changes since 1.39: +40 -82 lines
Diff to previous 1.39 (colored)

Correct the lookup order of _rtld_symlook_default and make
_rtld_find_symdef use _rtld_symlook_default.

This reduces the code size and means that dlsym(RTLD_DEFAULT,...) has the
correct lookup order.

Reviewed by kleink. Thanks.

Revision 1.39 / (download) - annotate - [select for diffs], Tue May 10 13:15:56 2005 UTC (15 years, 8 months ago) by chs
Branch: MAIN
Changes since 1.38: +15 -26 lines
Diff to previous 1.38 (colored)

in _rtld_is_exported(), use a function pointer type instead of Elf_Addr
so that hppa knows to do the plabel thang.

Revision 1.38 / (download) - annotate - [select for diffs], Tue Jan 11 21:58:27 2005 UTC (16 years ago) by martin
Branch: MAIN
CVS Tags: netbsd-3-base, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1
Branch point for: netbsd-3
Changes since 1.37: +3 -3 lines
Diff to previous 1.37 (colored)

Quote symbol names in a debug message (to make it easier to spot an empty
symbol name, a common failure mode)

Revision 1.37 / (download) - annotate - [select for diffs], Fri Oct 22 05:39:57 2004 UTC (16 years, 2 months ago) by skrll
Branch: MAIN
Changes since 1.36: +6 -1 lines
Diff to previous 1.36 (colored)

Add __RCSIDs.

OK'd by mycroft.

Revision 1.35.2.1 / (download) - annotate - [select for diffs], Mon Jul 19 09:07:35 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.35: +14 -1 lines
Diff to previous 1.35 (colored) next main 1.36 (colored)

Pull up revision 1.36 (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.36 / (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.35: +14 -1 lines
Diff to previous 1.35 (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.11.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.11.2.1: +182 -54 lines
Diff to previous 1.11.2.1 (colored) to branchpoint 1.11 (colored) next main 1.12 (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.35 / (download) - annotate - [select for diffs], Sun Dec 7 09:36:06 2003 UTC (17 years, 1 month ago) by mrauch
Branch: MAIN
CVS Tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Changes since 1.34: +11 -11 lines
Diff to previous 1.34 (colored)

Change the symbol lookup order to search RTLD_GLOBAL objects
before referencing object's DAG. This makes it possible for
C++ exceptions to work across shared libraries.

Patch taken from FreeBSD: src/libexec/rtld-elf/rtld.c: 1.67 -> 1.68,
committed there by kan@FreeBSD.org.

Revision 1.34 / (download) - annotate - [select for diffs], Tue Oct 21 01:19:10 2003 UTC (17 years, 3 months ago) by fvdl
Branch: MAIN
Changes since 1.33: +3 -3 lines
Diff to previous 1.33 (colored)

Don't use NULL for integers.

Revision 1.11.2.1 / (download) - annotate - [select for diffs], Fri Sep 5 19:14:54 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.11: +1 -6 lines
Diff to previous 1.11 (colored)

Pull up revision 1.16 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.33 / (download) - annotate - [select for diffs], Tue Aug 12 09:18:50 2003 UTC (17 years, 5 months ago) by skrll
Branch: MAIN
Changes since 1.32: +39 -2 lines
Diff to previous 1.32 (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.32 / (download) - annotate - [select for diffs], Tue Aug 5 19:41:53 2003 UTC (17 years, 5 months ago) by skrll
Branch: MAIN
Changes since 1.31: +3 -2 lines
Diff to previous 1.31 (colored)

KNF

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

ANSIfy and de-__P().

Revision 1.30 / (download) - annotate - [select for diffs], Tue Jul 15 07:39:55 2003 UTC (17 years, 6 months ago) by skrll
Branch: MAIN
Changes since 1.29: +2 -2 lines
Diff to previous 1.29 (colored)

s/_rltd_obj_rtld/_rtld_objself/ in #ifdef notyet code.

Revision 1.29 / (download) - annotate - [select for diffs], Tue Jul 15 07:38:29 2003 UTC (17 years, 6 months ago) by skrll
Branch: MAIN
Changes since 1.28: +67 -67 lines
Diff to previous 1.28 (colored)

Whitespace

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

Add RTLD_FIRST, RTLD_NEXT, RTLD_DEFAULT, from FreeBSD

Revision 1.27 / (download) - annotate - [select for diffs], Thu Apr 24 16:55:30 2003 UTC (17 years, 8 months ago) by mycroft
Branch: MAIN
Changes since 1.26: +35 -39 lines
Diff to previous 1.26 (colored)

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

Revision 1.26 / (download) - annotate - [select for diffs], Wed Apr 23 17:40:25 2003 UTC (17 years, 8 months ago) by mycroft
Branch: MAIN
Changes since 1.25: +40 -36 lines
Diff to previous 1.25 (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.25 / (download) - annotate - [select for diffs], Sat Oct 5 11:59:04 2002 UTC (18 years, 3 months ago) by mycroft
Branch: MAIN
CVS Tags: fvdl_fs64_base
Changes since 1.24: +2 -1 lines
Diff to previous 1.24 (colored)

Minor cleanup.

Revision 1.24 / (download) - annotate - [select for diffs], Fri Oct 4 20:34:10 2002 UTC (18 years, 3 months ago) by mycroft
Branch: MAIN
Changes since 1.23: +9 -6 lines
Diff to previous 1.23 (colored)

Recode _rtld_elf_hash() so it compiles better (at least on i386 and arm).
Still could be better on i386, but only written in assembler...

Revision 1.23 / (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.22: +10 -3 lines
Diff to previous 1.22 (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.22 / (download) - annotate - [select for diffs], Tue Sep 24 20:27:07 2002 UTC (18 years, 3 months ago) by mycroft
Branch: MAIN
Changes since 1.21: +11 -1 lines
Diff to previous 1.21 (colored)

Add a comment about the function pointer nonsense.

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

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

Revision 1.20 / (download) - annotate - [select for diffs], Mon Sep 23 23:56:49 2002 UTC (18 years, 3 months ago) by mycroft
Branch: MAIN
Changes since 1.19: +14 -23 lines
Diff to previous 1.19 (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.19 / (download) - annotate - [select for diffs], Fri Sep 13 03:40:40 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.18: +4 -3 lines
Diff to previous 1.18 (colored)

If we match a symbol name, but it's undefined, do not continue searching the
hash chain.

Revision 1.18 / (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.17: +2 -2 lines
Diff to previous 1.17 (colored)

Nuke -DRTLD_RELOCATE_SELF and `dodebug' from orbit.

Revision 1.17 / (download) - annotate - [select for diffs], Fri Sep 6 03:12:05 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.16: +2 -2 lines
Diff to previous 1.16 (colored)

Re-poison a lot of consts, now that the mark shite is gone.

Revision 1.16 / (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.15: +1 -6 lines
Diff to previous 1.15 (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.15 / (download) - annotate - [select for diffs], Thu Sep 5 21:21:07 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.14: +3 -4 lines
Diff to previous 1.14 (colored)

A few things:
* Pass a symbol number to _rtld_find_symdef(), not a r_info.
* Don't try to do a symbol lookup when we find an unsupported relocation;
  instead get the symbol name from the referencing object's strtab.
* Add preliminary support for `-z combreloc'-style startup optimization on
  i386, `#ifdef COMBRELOC'.

Revision 1.14 / (download) - annotate - [select for diffs], Thu Sep 5 17:58:03 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.13: +5 -8 lines
Diff to previous 1.13 (colored)

Split MIPS relocation goo into mips_reloc.c.

Revision 1.13 / (download) - annotate - [select for diffs], Thu Sep 5 16:33:57 2002 UTC (18 years, 4 months ago) by junyoung
Branch: MAIN
Changes since 1.12: +4 -6 lines
Diff to previous 1.12 (colored)

Remove unused arguments of _rtld_find_symdef().

Revision 1.12 / (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.11: +3 -3 lines
Diff to previous 1.11 (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.7.4.3 / (download) - annotate - [select for diffs], Sun Dec 9 17:22:19 2001 UTC (19 years, 1 month ago) by he
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-PATCH003
Changes since 1.7.4.2: +6 -5 lines
Diff to previous 1.7.4.2 (colored) to branchpoint 1.7 (colored) next main 1.8 (colored)

Pull up revision 1.11 (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.11 / (download) - annotate - [select for diffs], Sun Oct 14 23:13:21 2001 UTC (19 years, 3 months ago) by rafal
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.10: +6 -5 lines
Diff to previous 1.10 (colored)

Fix how underfined weak symbols are treated -- before, ld.so would do nothing
with them, rather than defaulting them to zero.  This caused breakage with
the drawf EH stuff and init/fini code when they weren't used by the caller
(and hence the appropriate handlers were left undefined).  Also fix an un-
initialized variable in symbol.c that only MIPS MD code tripped over.

Revision 1.7.4.2 / (download) - annotate - [select for diffs], Mon Oct 16 22:07:04 2000 UTC (20 years, 3 months ago) by tv
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.7.4.1: +3 -3 lines
Diff to previous 1.7.4.1 (colored) to branchpoint 1.7 (colored)

Pullup 1.10 [dan]:
format warning fixes from he, after testing on 64-bit elf (alpha)

Revision 1.10 / (download) - annotate - [select for diffs], Wed Oct 11 20:46:08 2000 UTC (20 years, 3 months ago) by dan
Branch: MAIN
Changes since 1.9: +3 -3 lines
Diff to previous 1.9 (colored)

format warning fixes from he, after testing on 64-bit elf (alpha)

Revision 1.3.2.1 / (download) - annotate - [select for diffs], Wed Oct 11 19:52:39 2000 UTC (20 years, 3 months ago) by he
Branch: netbsd-1-4
CVS Tags: netbsd-1-4-PATCH003
Changes since 1.3: +3 -3 lines
Diff to previous 1.3 (colored) next main 1.4 (colored)

Apply patch (requested by he):
  Print possible 64bit values with %ld and cast to u_long.

Revision 1.7.4.1 / (download) - annotate - [select for diffs], Wed Jul 26 23:45:22 2000 UTC (20 years, 5 months ago) by mycroft
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-ALPHA2
Changes since 1.7: +4 -4 lines
Diff to previous 1.7 (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.9 / (download) - annotate - [select for diffs], Wed Jul 26 02:07:36 2000 UTC (20 years, 5 months ago) by mycroft
Branch: MAIN
Changes since 1.8: +3 -3 lines
Diff to previous 1.8 (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.8 / (download) - annotate - [select for diffs], Mon Jul 3 03:33:52 2000 UTC (20 years, 6 months ago) by matt
Branch: MAIN
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

shut gcc up about a bogus possibly used before initialized.

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

Pull up to last week's -current.

Revision 1.7 / (download) - annotate - [select for diffs], Wed Nov 10 18:48:19 1999 UTC (21 years, 2 months ago) by thorpej
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, netbsd-1-5-base, minoura-xpg4dl-base, minoura-xpg4dl
Branch point for: netbsd-1-5
Changes since 1.6: +5 -5 lines
Diff to previous 1.6 (colored)

Name consistencty nit: curmark -> _rtld_curmark

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

Some slight cosmetic cleanup.

Revision 1.5 / (download) - annotate - [select for diffs], Sun Nov 7 00:21:14 1999 UTC (21 years, 2 months ago) by mycroft
Branch: MAIN
Changes since 1.4: +93 -27 lines
Diff to previous 1.4 (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.4 / (download) - annotate - [select for diffs], Mon Oct 25 13:57:12 1999 UTC (21 years, 2 months ago) by kleink
Branch: MAIN
CVS Tags: comdex-fall-1999-base, comdex-fall-1999
Changes since 1.3: +3 -3 lines
Diff to previous 1.3 (colored)

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

Revision 1.3 / (download) - annotate - [select for diffs], Mon Mar 1 16:40:08 1999 UTC (21 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001
Branch point for: wrstuden-devbsize, netbsd-1-4
Changes since 1.2: +89 -86 lines
Diff to previous 1.2 (colored)

KNF

Revision 1.1.2.1 / (download) - annotate - [select for diffs], Fri May 8 17:39:13 1998 UTC (22 years, 8 months ago) by mycroft
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, netbsd-1-3-PATCH002
Changes since 1.1: +5 -1 lines
Diff to previous 1.1 (colored) next main 1.2 (colored)

Sync with trunk, per request of mycroft.

Revision 1.2 / (download) - annotate - [select for diffs], Wed Mar 25 04:13:02 1998 UTC (22 years, 9 months ago) by mhitch
Branch: MAIN
Changes since 1.1: +5 -1 lines
Diff to previous 1.1 (colored)

Add support for mips.

Revision 1.1 / (download) - annotate - [select for diffs], Mon Dec 16 20:38:06 1996 UTC (24 years, 1 month ago) by cgd
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

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>