The NetBSD Project

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

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.112.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.112.2.1: +9 -7 lines
Diff to previous 1.112.2.1 (colored) to branchpoint 1.112 (colored) next main 1.113 (colored)

Merge changes from current as of 20200406

Revision 1.116 / (download) - annotate - [select for diffs], Sat Feb 29 04:24:33 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.115: +4 -5 lines
Diff to previous 1.115 (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.115 / (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.114: +7 -4 lines
Diff to previous 1.114 (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.112.2.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:05:29 2019 UTC (19 months ago) by christos
Branch: phil-wifi
Changes since 1.112: +9 -28 lines
Diff to previous 1.112 (colored)

Sync with HEAD

Revision 1.111.2.3 / (download) - annotate - [select for diffs], Fri Jan 18 08:50:11 2019 UTC (23 months, 4 weeks ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.111.2.2: +9 -13 lines
Diff to previous 1.111.2.2 (colored) to branchpoint 1.111 (colored) next main 1.112 (colored)

Synch with HEAD

Revision 1.114 / (download) - annotate - [select for diffs], Sun Dec 30 01:48:37 2018 UTC (2 years ago) by christos
Branch: MAIN
CVS Tags: phil-wifi-20191119, phil-wifi-20190609, pgoyette-compat-20190127, pgoyette-compat-20190118, netbsd-9-base, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9
Changes since 1.113: +9 -13 lines
Diff to previous 1.113 (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.111.2.2 / (download) - annotate - [select for diffs], Sat Oct 20 06:58:22 2018 UTC (2 years, 2 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.111.2.1: +2 -17 lines
Diff to previous 1.111.2.1 (colored) to branchpoint 1.111 (colored)

Sync with head

Revision 1.113 / (download) - annotate - [select for diffs], Wed Oct 17 23:36:58 2018 UTC (2 years, 2 months ago) by joerg
Branch: MAIN
CVS Tags: pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020
Changes since 1.112: +2 -17 lines
Diff to previous 1.112 (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.111.2.1 / (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.111: +92 -2 lines
Diff to previous 1.111 (colored)

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

Revision 1.112 / (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.111: +92 -2 lines
Diff to previous 1.111 (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.111 / (download) - annotate - [select for diffs], Thu Aug 10 19:03:25 2017 UTC (3 years, 5 months ago) by joerg
Branch: MAIN
CVS Tags: pgoyette-compat-base, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: pgoyette-compat
Changes since 1.110: +12 -3 lines
Diff to previous 1.110 (colored)

Add IRELATIVE support for ARM, X86 and PowerPC.

Revision 1.106.2.1 / (download) - annotate - [select for diffs], Fri Jul 21 03:53:08 2017 UTC (3 years, 5 months ago) by snj
Branch: netbsd-6
Changes since 1.106: +18 -2 lines
Diff to previous 1.106 (colored) next main 1.107 (colored)

Pull up following revision(s) (requested by uwe in ticket #1450):
	libexec/ld.elf_so/reloc.c: revision 1.110
PR port-macppc/47464 - Old binutils generated bogus zero-sized COPY
relocations for _SDA_BASE_ and _SDA2_BASE_ that happened to work by
accident.  They no longer happen to work when old binaries are run on
newer systems.  Explicitly ignore these bogus relocations.

Revision 1.106.18.2 / (download) - annotate - [select for diffs], Sun Jul 9 04:35:00 2017 UTC (3 years, 6 months ago) by snj
Branch: netbsd-7
CVS Tags: netbsd-7-2-RELEASE
Changes since 1.106.18.1: +18 -2 lines
Diff to previous 1.106.18.1 (colored) to branchpoint 1.106 (colored) next main 1.107 (colored)

Pull up following revision(s) (requested by uwe in ticket #1411):
	libexec/ld.elf_so/reloc.c: revision 1.110
PR port-macppc/47464 - Old binutils generated bogus zero-sized COPY
relocations for _SDA_BASE_ and _SDA2_BASE_ that happened to work by
accident.  They no longer happen to work when old binaries are run on
newer systems.  Explicitly ignore these bogus relocations.

Revision 1.109.6.1 / (download) - annotate - [select for diffs], Tue May 2 03:19:16 2017 UTC (3 years, 8 months ago) by pgoyette
Branch: prg-localcount2
Changes since 1.109: +18 -2 lines
Diff to previous 1.109 (colored) next main 1.110 (colored)

Sync with HEAD - tag prg-localcount2-base1

Revision 1.110 / (download) - annotate - [select for diffs], Thu Apr 27 08:37:15 2017 UTC (3 years, 8 months ago) by uwe
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek
Changes since 1.109: +18 -2 lines
Diff to previous 1.109 (colored)

PR port-macppc/47464 - Old binutils generated bogus zero-sized COPY
relocations for _SDA_BASE_ and _SDA2_BASE_ that happened to work by
accident.  They no longer happen to work when old binaries are run on
newer systems.  Explicitly ignore these bogus relocations.

Revision 1.109 / (download) - annotate - [select for diffs], Tue Jun 14 13:06:41 2016 UTC (4 years, 7 months ago) by christos
Branch: MAIN
CVS Tags: prg-localcount2-base, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, localcount-20160914, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: prg-localcount2
Changes since 1.108: +13 -2 lines
Diff to previous 1.108 (colored)

Add support for GNU RELRO headers from Matthias Weckbecker.

Revision 1.108 / (download) - annotate - [select for diffs], Tue Apr 12 19:10:48 2016 UTC (4 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.107: +4 -3 lines
Diff to previous 1.107 (colored)

- Print a warning for text relocations
- Don't remap the text segment executable while relocating

Revision 1.106.18.1 / (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-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.106: +15 -2 lines
Diff to previous 1.106 (colored)

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

Revision 1.107 / (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.106: +15 -2 lines
Diff to previous 1.106 (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.104.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
CVS Tags: yamt-pagecache-tag8
Changes since 1.104: +7 -7 lines
Diff to previous 1.104 (colored) next main 1.105 (colored)

sync with head

Revision 1.96.4.3 / (download) - annotate - [select for diffs], Sat Mar 17 18:28:33 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.96.4.2: +3 -8 lines
Diff to previous 1.96.4.2 (colored) to branchpoint 1.96 (colored) next main 1.97 (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.106 / (download) - annotate - [select for diffs], Fri Jan 6 10:38:56 2012 UTC (9 years ago) by skrll
Branch: MAIN
CVS Tags: yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, tls-maxphys-base, tls-maxphys, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, netbsd-7-base, 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-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, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, agc-symver-base, agc-symver
Branch point for: netbsd-7, netbsd-6
Changes since 1.105: +2 -5 lines
Diff to previous 1.105 (colored)

Implement lazy binding on hppa. rump_server needs it!?!?!

Mostly from OpenBSD.

Revision 1.105 / (download) - annotate - [select for diffs], Fri Dec 2 09:06:49 2011 UTC (9 years, 1 month ago) by skrll
Branch: MAIN
Changes since 1.104: +7 -4 lines
Diff to previous 1.104 (colored)

Restore backwards compatibility by removing unnecessary addition of
dlvsym to Obj_Entry.

Add some comments.

Revision 1.104 / (download) - annotate - [select for diffs], Sat Jun 25 05:45:12 2011 UTC (9 years, 6 months ago) by nonaka
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base
Branch point for: yamt-pagecache
Changes since 1.103: +8 -4 lines
Diff to previous 1.103 (colored)

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

Revision 1.103 / (download) - annotate - [select for diffs], Fri Dec 24 12:41:43 2010 UTC (10 years ago) by skrll
Branch: MAIN
CVS Tags: matt-mips64-premerge-20101231, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Changes since 1.102: +3 -3 lines
Diff to previous 1.102 (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.96.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.96: +2 -2 lines
Diff to previous 1.96 (colored) next main 1.97 (colored)

sync to netbsd-5

Revision 1.102 / (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.101: +7 -2 lines
Diff to previous 1.101 (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.96.4.2 / (download) - annotate - [select for diffs], Sat Jan 23 17:34:16 2010 UTC (10 years, 11 months ago) by bouyer
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.96.4.1: +2 -3 lines
Diff to previous 1.96.4.1 (colored) to branchpoint 1.96 (colored)

Pull up following revision(s) (requested by skrll in ticket #1249):
	libexec/ld.elf_so/rtld.h: revisions 1.87, 1.88
	libexec/ld.elf_so/reloc.c: revision 1.101
Restore backwards compatibility for binaries referencing the main
Obj_Entry.

Revision 1.101 / (download) - annotate - [select for diffs], Sat Jan 16 10:37:51 2010 UTC (11 years ago) by skrll
Branch: MAIN
Changes since 1.100: +2 -3 lines
Diff to previous 1.100 (colored)

Remove cargo cult dlinfo entry point.

Revision 1.100 / (download) - annotate - [select for diffs], Fri Jan 15 07:07:11 2010 UTC (11 years ago) by skrll
Branch: MAIN
Changes since 1.99: +10 -2 lines
Diff to previous 1.99 (colored)

Put the dlopen,and friends entry points back.

They're needed by pre-2.0 binaries. Backward compatibiliity for these
was broken by another commit recently which I'll fix shortly.

Revision 1.99 / (download) - annotate - [select for diffs], Thu Jan 14 21:52:07 2010 UTC (11 years ago) by skrll
Branch: MAIN
Changes since 1.98: +2 -10 lines
Diff to previous 1.98 (colored)

Remove the entry points for dlopen() and friends. They haven't been used
since Aug 2003.

Revision 1.98 / (download) - annotate - [select for diffs], Wed Jan 13 20:17:21 2010 UTC (11 years ago) by christos
Branch: MAIN
Changes since 1.97: +3 -5 lines
Diff to previous 1.97 (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.96.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.96: +3 -2 lines
Diff to previous 1.96 (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.97 / (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.96: +3 -2 lines
Diff to previous 1.96 (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.95.20.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.95: +3 -2 lines
Diff to previous 1.95 (colored) next main 1.96 (colored)

Sync with wrstuden-revivesa-base-2.

Revision 1.96 / (download) - annotate - [select for diffs], Tue Jul 29 16:27:01 2008 UTC (12 years, 5 months ago) by matt
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, 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.95: +3 -2 lines
Diff to previous 1.95 (colored)

Make sure to call dlerror() to clear any error messages after the relocations
are done and there are no errors.  This will prevent spurious undefined weak
symbol errors being returned by dlerror().

Fixes PR bin/39240.

Revision 1.95 / (download) - annotate - [select for diffs], Sat Mar 4 08:58:46 2006 UTC (14 years, 10 months ago) by skrll
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, 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, netbsd-4, matt-mips64-base, matt-mips64, matt-armv6-prevmlocking, matt-armv6-nbase, matt-armv6-base, matt-armv6, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-nbase, hpcarm-cleanup-base, hpcarm-cleanup, cube-autoconf-base, cube-autoconf, abandoned-netbsd-4-base, abandoned-netbsd-4
Branch point for: wrstuden-revivesa
Changes since 1.94: +2 -7 lines
Diff to previous 1.94 (colored)

Add LD_BIND_NOW support for mips.

This is the last arch to be done so remove the large ugly #if defined()
stuff in reloc.c.

Revision 1.94 / (download) - annotate - [select for diffs], Thu Jul 28 12:35:21 2005 UTC (15 years, 5 months ago) by skrll
Branch: MAIN
Changes since 1.93: +3 -3 lines
Diff to previous 1.93 (colored)

Add support for immediate PLT binding on SH5. Compile tested only as
shared libs don't actually work on SH5 (yet).

OK'd by Steve Woodford.

Revision 1.93 / (download) - annotate - [select for diffs], Thu Jul 28 10:54:30 2005 UTC (15 years, 5 months ago) by skrll
Branch: MAIN
Changes since 1.92: +3 -3 lines
Diff to previous 1.92 (colored)

Support immediate PLT binding on powerpc. Thanks to Simon Burge for
testing.

I can see the finish line...

Revision 1.92 / (download) - annotate - [select for diffs], Tue Jul 26 15:43:34 2005 UTC (15 years, 5 months ago) by skrll
Branch: MAIN
Changes since 1.91: +4 -3 lines
Diff to previous 1.91 (colored)

Support immediate PLT binding on m68k. Tested on NetBSD/sun3 using the new
version of tme.

Not far now...

Revision 1.91 / (download) - annotate - [select for diffs], Sun Jul 24 08:02:23 2005 UTC (15 years, 5 months ago) by skrll
Branch: MAIN
Changes since 1.90: +3 -3 lines
Diff to previous 1.90 (colored)

Support immediate PLT binding on vax. Tested on simh.

Nearly there...

Revision 1.90 / (download) - annotate - [select for diffs], Sun Jul 17 05:57:21 2005 UTC (15 years, 6 months ago) by skrll
Branch: MAIN
Changes since 1.89: +3 -3 lines
Diff to previous 1.89 (colored)

Support immediate binding on x86_64.

Closes PR 30570. Thanks to TAMURA Kent for testing.

Revision 1.89 / (download) - annotate - [select for diffs], Tue May 31 19:30:38 2005 UTC (15 years, 7 months ago) by skrll
Branch: MAIN
Changes since 1.88: +4 -3 lines
Diff to previous 1.88 (colored)

Support LD_BIND_NOW on sh3..

Revision 1.88 / (download) - annotate - [select for diffs], Wed May 25 13:39:46 2005 UTC (15 years, 7 months ago) by skrll
Branch: MAIN
Changes since 1.87: +3 -3 lines
Diff to previous 1.87 (colored)

Support LD_BIND_NOW for alpha.

Revision 1.87 / (download) - annotate - [select for diffs], Sun Jan 9 14:58:15 2005 UTC (16 years ago) by martin
Branch: MAIN
CVS Tags: netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3
Changes since 1.86: +3 -3 lines
Diff to previous 1.86 (colored)

Add LD_BIND_NOW support for sparc and remove some relocation types that
are not supposed to happen in 32bit code.
From Nick Hudson.

Revision 1.86 / (download) - annotate - [select for diffs], Wed Jan 5 09:16:03 2005 UTC (16 years ago) by martin
Branch: MAIN
Changes since 1.85: +4 -3 lines
Diff to previous 1.85 (colored)

Add LD_BIND_NOW support for sparc64.

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

Add __RCSIDs.

OK'd by mycroft.

Revision 1.51.2.2 / (download) - annotate - [select for diffs], Fri Jul 23 14:20:40 2004 UTC (16 years, 5 months ago) by tron
Branch: netbsd-1-6
Changes since 1.51.2.1: +3 -3 lines
Diff to previous 1.51.2.1 (colored) to branchpoint 1.51 (colored) next main 1.52 (colored)

Pull up revision 1.84 (requested by skrll in ticket #1726):
Don't print relocated content (in DEBUG mode) as it can cause
misaligned access. It needs to be done differently if needed at all.
Fix PR port-sparc64/20907.

Revision 1.81.2.1 / (download) - annotate - [select for diffs], Sat Jul 17 16:48:19 2004 UTC (16 years, 6 months ago) by he
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.81: +3 -3 lines
Diff to previous 1.81 (colored) next main 1.82 (colored)

Pull up revision 1.84 (requested by petrov in ticket #673):
  Don't print relocated content (in DEBUG mode), as it can
  cause misaligned accesses.  Fixes PR#20907.

Revision 1.84 / (download) - annotate - [select for diffs], Sat Jul 17 05:03:33 2004 UTC (16 years, 6 months ago) by petrov
Branch: MAIN
Changes since 1.83: +3 -3 lines
Diff to previous 1.83 (colored)

Don't print relocated content (in DEBUG mode) as it can cause
misaligned access. It needs to be done differently if needed at all.
Fix PR port-sparc64/20907.

Revision 1.51.2.1 / (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.51: +30 -772 lines
Diff to previous 1.51 (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.83 / (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.82: +5 -2 lines
Diff to previous 1.82 (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.82 / (download) - annotate - [select for diffs], Wed May 12 20:12:37 2004 UTC (16 years, 8 months ago) by skrll
Branch: MAIN
Changes since 1.81: +4 -2 lines
Diff to previous 1.81 (colored)

Add a debug message.

Revision 1.81 / (download) - annotate - [select for diffs], Tue Aug 12 09:18:46 2003 UTC (17 years, 5 months ago) by skrll
Branch: MAIN
CVS Tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Changes since 1.80: +6 -6 lines
Diff to previous 1.80 (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.80 / (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.79: +5 -10 lines
Diff to previous 1.79 (colored)

ANSIfy and de-__P().

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

Support immediate binding on arm.

Revision 1.78 / (download) - annotate - [select for diffs], Sat Dec 14 09:13:00 2002 UTC (18 years, 1 month ago) by junyoung
Branch: MAIN
CVS Tags: fvdl_fs64_base
Changes since 1.77: +1 -10 lines
Diff to previous 1.77 (colored)

Remove comment which is not true any more. alpha and i386 support
R_xxx_COPY relocations.

Revision 1.77 / (download) - annotate - [select for diffs], Mon Nov 25 19:49:25 2002 UTC (18 years, 1 month ago) by mycroft
Branch: MAIN
Changes since 1.76: +7 -3 lines
Diff to previous 1.76 (colored)

Back out the last two changes.  They were misguided, and the code worked
correctly before.

Revision 1.76 / (download) - annotate - [select for diffs], Fri Nov 22 04:39:37 2002 UTC (18 years, 1 month ago) by junyoung
Branch: MAIN
Changes since 1.75: +6 -7 lines
Diff to previous 1.75 (colored)

Now _rtld_relocate_objects() returns with error as soon as any of
subsequent calls in it fails.

Spotted by wiz and enami.

Revision 1.75 / (download) - annotate - [select for diffs], Thu Nov 21 19:09:56 2002 UTC (18 years, 1 month ago) by junyoung
Branch: MAIN
Changes since 1.74: +6 -9 lines
Diff to previous 1.74 (colored)

Simplify code a bit.

Revision 1.74 / (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.73: +3 -4 lines
Diff to previous 1.73 (colored)

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

Revision 1.73 / (download) - annotate - [select for diffs], Wed Sep 25 07:27:49 2002 UTC (18 years, 3 months ago) by mycroft
Branch: MAIN
Changes since 1.72: +1 -53 lines
Diff to previous 1.72 (colored)

Push the _rtld_bind() interface into MD code -- it's just a trivial wrapper
anyway.

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

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

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

Reverse the previous patch, but make the dbg()s more informative.

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

G/c dbg()'s.

Revision 1.69 / (download) - annotate - [select for diffs], Mon Sep 23 23:56:47 2002 UTC (18 years, 3 months ago) by mycroft
Branch: MAIN
Changes since 1.68: +5 -3 lines
Diff to previous 1.68 (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.68 / (download) - annotate - [select for diffs], Tue Sep 17 07:29:46 2002 UTC (18 years, 4 months ago) by junyoung
Branch: MAIN
Changes since 1.67: +3 -3 lines
Diff to previous 1.67 (colored)

Make immediate binding work again by actually implementing
_rtld_relocate_plt_objects(). Note that this is for i386 only;
any efforts to make it work on other platforms are left to
those who are using them...

Revision 1.67 / (download) - annotate - [select for diffs], Fri Sep 13 03:09:38 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.66: +3 -1 lines
Diff to previous 1.66 (colored)

_rtld_bind() is not used on MIPS.  Should probably move it to MD code.

Revision 1.66 / (download) - annotate - [select for diffs], Thu Sep 12 22:56:28 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.65: +13 -19 lines
Diff to previous 1.65 (colored)

Nuke -DRTLD_RELOCATE_SELF and `dodebug' from orbit.

Revision 1.65 / (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.64: +4 -3 lines
Diff to previous 1.64 (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.64 / (download) - annotate - [select for diffs], Fri Sep 6 13:20:30 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.63: +2 -2 lines
Diff to previous 1.63 (colored)

Introduce a new flag, `isdynamic', which is used to remember whether the
executable was of type ET_DYN.  Use this instead of `mainprog' to determine
whether we need to do base-relative fixups of the PLT.  (This allows loading
non-relocatable objects, should we desire to do that at some point...)

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

More const poisoning.  Now the entire _rtld_bind() path useds a const Obj_Entry.

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

Split _rtld_relocate_plt_object() into two MD functions:
* _rtld_relocate_plt_lazy() fixes up all the relocs pointing to the PLT.  (On
  most platforms it just does a simple base-relative fixup; on SPARC it does
  nothing.)
* _rtld_relocate_plt_object() does immediate binding for a PLT entry.
The basic gist is that this saves a bit of time on SPARC (where the iteration
through the pltrela table was gratuitous), and a little less time on all other
platforms.  A whole lot of #ifdef'ed crap is moved out of reloc.c, too.

NOT tested on: hppa sh x86_64

Revision 1.61 / (download) - annotate - [select for diffs], Thu Sep 5 21:21:06 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.60: +3 -2 lines
Diff to previous 1.60 (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.60 / (download) - annotate - [select for diffs], Thu Sep 5 20:08:14 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.59: +3 -32 lines
Diff to previous 1.59 (colored)

Rename _rtld_relocate_nonplt_object() to _rtld_relocate_nonplt_objects(),
and push the outer loop into it.  This actually shaves a couple % off startup
time at least on PCs.

Revision 1.59 / (download) - annotate - [select for diffs], Thu Sep 5 18:25:45 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.58: +1 -434 lines
Diff to previous 1.58 (colored)

Split _rtld_relocate_nonplt_object() into separate MD files.

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

Split MIPS relocation goo into mips_reloc.c.

Revision 1.57 / (download) - annotate - [select for diffs], Thu Sep 5 17:06:11 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.56: +4 -7 lines
Diff to previous 1.56 (colored)

Simplify a couple of tests to !__mips__.

Revision 1.56 / (download) - annotate - [select for diffs], Thu Sep 5 17:01:13 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.55: +2 -19 lines
Diff to previous 1.55 (colored)

Combine the code that skips COPY relocs on most platforms (other than MIPS).
Remove the code that skips JMP_SLOT relocs (thus making ld.elf_so bomb if it
hits one in the non-PLT relocation table).

Revision 1.55 / (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.54: +24 -43 lines
Diff to previous 1.54 (colored)

Remove unused arguments of _rtld_find_symdef().

Revision 1.54 / (download) - annotate - [select for diffs], Thu Sep 5 15:47:52 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.53: +1 -28 lines
Diff to previous 1.53 (colored)

Remove support for PowerPC static relocations, which are not present in shared
objects, and in any case are implemented WRONG.  (They're symbol-relative, not
base-relative.)

Revision 1.53 / (download) - annotate - [select for diffs], Thu Sep 5 15:38:22 2002 UTC (18 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.52: +3 -89 lines
Diff to previous 1.52 (colored)

Make _rtld_setup_pltgot() a consistent interface on all platforms.

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

Add support for dynamic linking on HP PA-RISC.

Revision 1.51 / (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-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001
Branch point for: netbsd-1-6
Changes since 1.50: +68 -10 lines
Diff to previous 1.50 (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.50 / (download) - annotate - [select for diffs], Sun Jan 6 03:54:42 2002 UTC (19 years ago) by eeh
Branch: MAIN
Changes since 1.49: +27 -2 lines
Diff to previous 1.49 (colored)

Do not attempt to relocate any pltrela entries that are not JMP_SLOT on sparc64.

Revision 1.49 / (download) - annotate - [select for diffs], Thu Dec 20 06:54:25 2001 UTC (19 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.48: +3 -2 lines
Diff to previous 1.48 (colored)

Small whitespace fix.

Revision 1.48 / (download) - annotate - [select for diffs], Thu Dec 20 02:32:49 2001 UTC (19 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.47: +2 -2 lines
Diff to previous 1.47 (colored)

Upon further investigation, do NOT include an addend in RELATIVE
relations (the addend should always be zero, but this is safer).

Revision 1.47 / (download) - annotate - [select for diffs], Thu Dec 20 02:23:24 2001 UTC (19 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.46: +5 -3 lines
Diff to previous 1.46 (colored)

Include the addend in GLOB_DAT relocations (!!).

Revision 1.46 / (download) - annotate - [select for diffs], Sun Dec 16 08:23:25 2001 UTC (19 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.45: +24 -16 lines
Diff to previous 1.45 (colored)

* Move The Alpha R(RELATIVE) handling into an Alpha-specific code block,
  thus isolating the "iffy hueristic" from the rest of the relocation code.
* In the "iffy hueristic", use _GOT_END_, not _DYNAMIC.
* Include the addend in Alpha R(RELATIVE) relocations.

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

Add code to peek into the PLT and determine which PLT entry format
is being used.

Revision 1.44 / (download) - annotate - [select for diffs], Thu Dec 13 22:34:51 2001 UTC (19 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.43: +2 -8 lines
Diff to previous 1.43 (colored)

Supply two lazy binding routines for Alpha: one that works with the
old PLT format, and one that works with the new.

XXX We currently always use _rtld_bind_start_old() in
_rtld_setup_alpha_pltgot().  We need to add code to peek
into one of the PLT entries to see which format it's in
and pick the correct binding routine.

Revision 1.43 / (download) - annotate - [select for diffs], Thu Dec 13 21:41:58 2001 UTC (19 years, 1 month ago) by rafal
Branch: MAIN
Changes since 1.42: +27 -3 lines
Diff to previous 1.42 (colored)

Check in workaround for BFD ABI change on MIPS: the new MIPS BFD generates
relocs for local symbols as section-relative REL32 relocs with values based
at 0, whereas previously BFD generated those relocs with values based at the
start address of the section.

This code adjusts all STT_SECTION REL32 relocs which have values less than
the start of the section by adding in the base address of the section.  This
may limit section sizes to 2GB, but that shouldn't be a problem for now.

XXX: Needs to be followed-up with binutils list to get closure on which
interpretation is correct (the new ABI or the old one), I just haven't
yet had the time to chase that.

Revision 1.26.4.4 / (download) - annotate - [select for diffs], Sun Dec 9 17:21:15 2001 UTC (19 years, 1 month ago) by he
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-PATCH003
Changes since 1.26.4.3: +35 -10 lines
Diff to previous 1.26.4.3 (colored) to branchpoint 1.26 (colored) next main 1.27 (colored)

Pull up revisions 1.34,1.41-1.42 (via patch, 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.42 / (download) - annotate - [select for diffs], Mon Sep 10 06:09:41 2001 UTC (19 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.41: +6 -6 lines
Diff to previous 1.41 (colored)

Reorganize PowerPC cold a little.  The return value from _rtld_bind_pltgot()
was ambiguous in the case of a weak symbol that was not defined.  This caused
RTLD_NOW to fail badly with shared libraries linked against the new crtbegin.o.

Revision 1.41 / (download) - annotate - [select for diffs], Tue Aug 14 20:17:25 2001 UTC (19 years, 5 months ago) by eeh
Branch: MAIN
Changes since 1.40: +24 -1 lines
Diff to previous 1.40 (colored)

Workaround for binutils 2.11 behavior.

Revision 1.40 / (download) - annotate - [select for diffs], Mon Jul 16 05:40:53 2001 UTC (19 years, 6 months ago) by matt
Branch: MAIN
Changes since 1.39: +10 -10 lines
Diff to previous 1.39 (colored)

Fix ABS32 ARM reloc case.  ELF shared libs on ARM now work!

Revision 1.39 / (download) - annotate - [select for diffs], Sun Jul 15 17:31:02 2001 UTC (19 years, 6 months ago) by matt
Branch: MAIN
Changes since 1.38: +7 -3 lines
Diff to previous 1.38 (colored)

Bugfix for _rtld_start.  Enable common plt processing code for arm

Revision 1.38 / (download) - annotate - [select for diffs], Sun Jul 15 03:09:22 2001 UTC (19 years, 6 months ago) by matt
Branch: MAIN
Changes since 1.37: +3 -2 lines
Diff to previous 1.37 (colored)

Enable arm if OBJECT_FMT is ELF.  Initialize first few GOT entries for ARM.

Revision 1.37 / (download) - annotate - [select for diffs], Sun Jul 15 01:44:10 2001 UTC (19 years, 6 months ago) by matt
Branch: MAIN
Changes since 1.36: +74 -4 lines
Diff to previous 1.36 (colored)

Add support for ARM ELF dynamic relocs.

Revision 1.36 / (download) - annotate - [select for diffs], Tue Jun 19 01:11:03 2001 UTC (19 years, 7 months ago) by fvdl
Branch: MAIN
Changes since 1.35: +3 -3 lines
Diff to previous 1.35 (colored)

Preliminary x86-64 support. Not fully functional yet (toolchain bugs).

Revision 1.26.4.3 / (download) - annotate - [select for diffs], Tue May 1 12:06:16 2001 UTC (19 years, 8 months ago) by he
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-PATCH002, netbsd-1-5-PATCH001
Changes since 1.26.4.2: +14 -14 lines
Diff to previous 1.26.4.2 (colored) to branchpoint 1.26 (colored)

Pull up revision 1.35 (requested by kleink):
  Rename ElfNN_RelA to ElfNN_Rela, which is what SVR4 ABIs and the
  rest of the world uses.  Fixes PR#12274.

Revision 1.35 / (download) - annotate - [select for diffs], Wed Apr 25 12:24:50 2001 UTC (19 years, 8 months ago) by kleink
Branch: MAIN
Changes since 1.34: +14 -14 lines
Diff to previous 1.34 (colored)

Sync with <sys/exec_elf.h> rev. 1.45: ElfNN_RelA -> ElfNN_Rela.

Revision 1.34 / (download) - annotate - [select for diffs], Sun Feb 4 22:11:12 2001 UTC (19 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.33: +7 -5 lines
Diff to previous 1.33 (colored)

avoid nested extern

Revision 1.26.4.2 / (download) - annotate - [select for diffs], Mon Oct 16 22:06:49 2000 UTC (20 years, 3 months ago) by tv
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-RELEASE, netbsd-1-5-BETA2, netbsd-1-5-BETA
Changes since 1.26.4.1: +3 -3 lines
Diff to previous 1.26.4.1 (colored) to branchpoint 1.26 (colored)

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

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

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

Revision 1.19.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.19: +3 -3 lines
Diff to previous 1.19 (colored) next main 1.20 (colored)

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

Revision 1.32 / (download) - annotate - [select for diffs], Mon Aug 7 01:47:04 2000 UTC (20 years, 5 months ago) by matt
Branch: MAIN
Changes since 1.31: +2 -3 lines
Diff to previous 1.31 (colored)

Simplify some stuff.

Revision 1.26.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.26: +42 -1 lines
Diff to previous 1.26 (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.31 / (download) - annotate - [select for diffs], Wed Jul 26 02:07:34 2000 UTC (20 years, 5 months ago) by mycroft
Branch: MAIN
Changes since 1.30: +4 -4 lines
Diff to previous 1.30 (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.30 / (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.29: +2 -2 lines
Diff to previous 1.29 (colored)

Fix some issues with SPARC V9 ELF binaries.

Revision 1.29 / (download) - annotate - [select for diffs], Mon Jul 17 02:55:52 2000 UTC (20 years, 6 months ago) by matt
Branch: MAIN
Changes since 1.28: +9 -2 lines
Diff to previous 1.28 (colored)

More VAX ELF changes.

Revision 1.28 / (download) - annotate - [select for diffs], Fri Jul 14 22:00:33 2000 UTC (20 years, 6 months ago) by matt
Branch: MAIN
Changes since 1.27: +9 -22 lines
Diff to previous 1.27 (colored)

Update to reflect VAX ELF reality.

Revision 1.27 / (download) - annotate - [select for diffs], Thu Jul 13 23:14:17 2000 UTC (20 years, 6 months ago) by eeh
Branch: MAIN
Changes since 1.26: +42 -1 lines
Diff to previous 1.26 (colored)

Added support for the SPARC v9 ABI.

Revision 1.26 / (download) - annotate - [select for diffs], Mon May 1 11:41:08 2000 UTC (20 years, 8 months ago) by kleink
Branch: MAIN
CVS Tags: netbsd-1-5-base, minoura-xpg4dl-base, minoura-xpg4dl
Branch point for: netbsd-1-5
Changes since 1.25: +28 -1 lines
Diff to previous 1.25 (colored)

PowerPC: support ADDR16_LO, ADDR16_HI and ADDR16_HA relocations.

Revision 1.25 / (download) - annotate - [select for diffs], Mon Feb 7 21:40:41 2000 UTC (20 years, 11 months ago) by scottb
Branch: MAIN
Changes since 1.24: +2 -1 lines
Diff to previous 1.24 (colored)

add hooks to support the dladdr function.

Revision 1.21.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.21: +56 -9 lines
Diff to previous 1.21 (colored) next main 1.22 (colored)

Pull up to last week's -current.

Revision 1.24 / (download) - annotate - [select for diffs], Wed Dec 8 08:47:10 1999 UTC (21 years, 1 month ago) by itohy
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221
Changes since 1.23: +50 -3 lines
Diff to previous 1.23 (colored)

Use "addend" for R_68K_GOT32, R_68K_PC32, and R_68K_32 relocations.
I'm not sure whether R_68K_GOT32 relocations appear in shared
objects, though....

Example:
	lea	%pc@(got+0x1234@GOTPC),%a0	| R_68K_GOT32
	bsrl	foo+0x5678			| R_68K_PC32
	lea	bar+0x9abc,%a1			| R_68K_32

Revision 1.23 / (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.22: +4 -4 lines
Diff to previous 1.22 (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.22 / (download) - annotate - [select for diffs], Thu Oct 28 23:58:21 1999 UTC (21 years, 2 months ago) by simonb
Branch: MAIN
CVS Tags: comdex-fall-1999-base, comdex-fall-1999
Changes since 1.21: +4 -4 lines
Diff to previous 1.21 (colored)

More SVR4-style ELF cleanups.

Revision 1.21 / (download) - annotate - [select for diffs], Sat Aug 21 19:26:19 1999 UTC (21 years, 5 months ago) by matt
Branch: MAIN
Branch point for: wrstuden-devbsize
Changes since 1.20: +30 -12 lines
Diff to previous 1.20 (colored)

Initial VAX ELF32 support (mostly untested).  It's checked primarily for
testing and archival for now.  I don't expect anyone to work with it
since the binutils and gas changes are still pending.  But you got to
crawl before you walk.

Revision 1.20 / (download) - annotate - [select for diffs], Thu Apr 29 15:06:41 1999 UTC (21 years, 8 months ago) by kleink
Branch: MAIN
Changes since 1.19: +10 -9 lines
Diff to previous 1.19 (colored)

Add m68k code.

Revision 1.19 / (download) - annotate - [select for diffs], Sat Mar 13 20:00:14 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: netbsd-1-4
Changes since 1.18: +3 -2 lines
Diff to previous 1.18 (colored)

Fix i386 problem, when we are relocating ourselves... We cannot depend
on the address of GOT or _DYNAMIC.

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

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

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

Not all ports use 'tmp'.

Revision 1.16 / (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.15: +70 -67 lines
Diff to previous 1.15 (colored)

KNF

Revision 1.15 / (download) - annotate - [select for diffs], Sat Feb 27 21:38:04 1999 UTC (21 years, 10 months ago) by scottr
Branch: MAIN
Changes since 1.14: +4 -2 lines
Diff to previous 1.14 (colored)

Fix typo introduced in rev 1.11

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

Introduce pre-preocessor symbol RTLD_INHIBIT_COPY_RELOCS.
Currently, only mips does not include COPY_RELOCs code.

Revision 1.13 / (download) - annotate - [select for diffs], Fri Feb 26 22:07:47 1999 UTC (21 years, 10 months ago) by pk
Branch: MAIN
Changes since 1.12: +10 -4 lines
Diff to previous 1.12 (colored)

Completely construct the first PLT entry and correctly compute the
PC relative offset in the call insn.

Revision 1.12 / (download) - annotate - [select for diffs], Thu Feb 25 21:49:04 1999 UTC (21 years, 10 months ago) by tv
Branch: MAIN
Changes since 1.11: +4 -5 lines
Diff to previous 1.11 (colored)

Partial fix for Alpha breakage.  s/tmp_value/tmp/ in two places, and don't
try to check _rtld_objself when doing R_TYPE(RELATIVE) relocs, as the
Alpha ld.elf_so contains them!

I'm not sure the logic for the RELATIVE fix is quite right; it happens to
Work on alpha, but do we actually need to make sure we aren't relocating
ld.elf_so there?

XXX: I am working on making use of RTLD_RELOCATE_SELF on alpha, which may
make this hack of a fix moot.

Revision 1.11 / (download) - annotate - [select for diffs], Wed Feb 24 18:31:00 1999 UTC (21 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.10: +435 -692 lines
Diff to previous 1.10 (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.10 / (download) - annotate - [select for diffs], Wed Feb 24 12:20:30 1999 UTC (21 years, 10 months ago) by pk
Branch: MAIN
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

Fix glitch in previous.

Revision 1.9 / (download) - annotate - [select for diffs], Mon Feb 22 17:06:11 1999 UTC (21 years, 10 months ago) by pk
Branch: MAIN
Changes since 1.8: +256 -6 lines
Diff to previous 1.8 (colored)

Add an approximation of the necessary sparc bits in here.
I've not followed the trend in this file by trying to wrench the MD
code into individual functions. Rather I,ve replaced several functions
wholesale.  Anyway, this whole file needs to be re-done.

Revision 1.8 / (download) - annotate - [select for diffs], Sat Feb 13 16:35:14 1999 UTC (21 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.7: +1 -8 lines
Diff to previous 1.7 (colored)

tv is right; we don't need to specialcase the i386.

Revision 1.7 / (download) - annotate - [select for diffs], Fri Feb 12 17:52:07 1999 UTC (21 years, 11 months ago) by tv
Branch: MAIN
Changes since 1.6: +3 -1 lines
Diff to previous 1.6 (colored)

On everything but the i386, don't write new values into the GOT that are
not pointing to the PLT in _rtld_relocate_plt_object().  I'm not quite
sure why the i386 added the extra relocations, but it removed the `return
0' needed for other arches.

THIS DOES NOT YET FIX BUILDING LD.ELF_SO ON ALPHA.  There are some other
binutils 2.9.1 related issues, but this does return build ability to
2.8.1 based as and ld.  Will do more investigation later.

Revision 1.6 / (download) - annotate - [select for diffs], Sun Feb 7 17:24:05 1999 UTC (21 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.5: +78 -16 lines
Diff to previous 1.5 (colored)

Fixed for i386/elf.

Revision 1.5 / (download) - annotate - [select for diffs], Mon Jan 11 23:12:16 1999 UTC (22 years ago) by thorpej
Branch: MAIN
Changes since 1.4: +7 -6 lines
Diff to previous 1.4 (colored)

Fixup some printf format argFixup some printf format argFixup some printf format argFixup some printf format argFixup some printf format argFixup some printf format argFixup some printf format argFixup some printf format argFixup some printf format args.

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

Add i386 bits

Revision 1.3 / (download) - annotate - [select for diffs], Tue Nov 24 11:34:30 1998 UTC (22 years, 1 month ago) by tsubai
Branch: MAIN
Changes since 1.2: +45 -4 lines
Diff to previous 1.2 (colored)

Add powerpc support.

Revision 1.1.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-PATCH003-CANDIDATE2, netbsd-1-3-PATCH003-CANDIDATE1, netbsd-1-3-PATCH003-CANDIDATE0, netbsd-1-3-PATCH003, netbsd-1-3-PATCH002
Changes since 1.1: +51 -4 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:01 1998 UTC (22 years, 9 months ago) by mhitch
Branch: MAIN
Changes since 1.1: +51 -4 lines
Diff to previous 1.1 (colored)

Add support for mips.

Revision 1.1 / (download) - annotate - [select for diffs], Mon Dec 16 20:38:02 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>