331206 |
19-Mar-2018 |
marius |
MFC: r328834
o Let rtld(1) set up psABI user trap handlers prior to executing the objects' init functions instead of doing the setup via a constructor in libc as the init functions may already depend on these handlers to be in place. This gets us rid of: - the undefined order in which libc constructors as __guard_setup() and jemalloc_constructor() are executed WRT __sparc_utrap_setup(), - the requirement to link libc last so __sparc_utrap_setup() gets called prior to constructors in other libraries (see r122883). For static binaries, crt1.o still sets up the user trap handlers. o Move misplaced prototypes for MD functions in to the MD prototype section of rtld.h. o Sprinkle nitems(). |
309061 |
23-Nov-2016 |
kib |
MFC r308689: Pass CPUID[1] %edx (cpu_feature), %ecx (cpu_feature2) and CPUID[7].%ebx (cpu_stdext_feature), %ecx (cpu_stdext_feature2) to the ifunc resolvers on x86.
MFC r308925: Adjust r308689 to make rtld compilable with either in-tree or (hopefully) stock gcc 4.2.1 on i386 and other arches. |
296727 |
12-Mar-2016 |
kib |
MFC r257811 (by markj): Include rtld itself when iterating over loaded ELF objects in dl_iterate_phdr(3).
MFC r294373: Do not call callbacks for dl_iterate_phdr(3) with the rtld bind and phdr locks locked.
MFC r294470 (by kan): Fix initlist_add_object invocation parameters.
MFC r294936 (by kan): Do not unlock rtld_phdr_lock over callback invocations. |
271469 |
12-Sep-2014 |
kib |
MFC r270798: Process STT_GNU_IFUNC when doing non-plt relocations.
MFC r270802: Only do the second pass over non-plt relocations when the first pass found IFUNCs.
Approved by: re (gjb) |
256281 |
10-Oct-2013 |
gjb |
Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation
|
239269 |
15-Aug-2012 |
gonzo |
Merging of projects/armv6, part 2
Handle TLS for ARMv6 and ARMv7
|
239031 |
04-Aug-2012 |
andrew |
Ensure we align the stack to 8 bytes in rtld.
This is not strictly required with the current ABI but will be when we switch to the ARM EABI. The aapcs requires the stack to be 4 byte aligned at all times and 8 byte aligned when calling a public subroutine where the current ABI only requires sp to be a multiple of 4.
|
234841 |
30-Apr-2012 |
kib |
Add GNU hash support for rtld.
Based on dragonflybsd support for GNU hash by John Marino <draco marino st> Reviewed by: kan Tested by: bapt MFC after: 2 weeks
|
233231 |
20-Mar-2012 |
kib |
Fix several problems with our ELF filters implementation.
Do not relocate twice an object which happens to be needed by loaded binary (or dso) and some filtee opened due to symbol resolution when relocating need objects. Record the state of the relocation processing in Obj_Entry and short-circuit relocate_objects() if current object already processed.
Do not call constructors for filtees loaded during the early relocation processing before image is initialized enough to run user-provided code. Filtees are loaded using dlopen_object(), which normally performs relocation and initialization. If filtee is lazy-loaded during the relocation of dso needed by the main object, dlopen_object() runs too earlier, when most runtime services are not yet ready.
Postpone the constructors call to the time when main binary and depended libraries constructors are run, passing the new flag RTLD_LO_EARLY to dlopen_object(). Symbol lookups callers inform symlook_* functions about early stage of initialization with SYMLOOK_EARLY. Pass flags through all functions participating in object relocation.
Use the opportunity and fix flags argument to find_symdef() in arch-specific reloc.c to use proper name SYMLOOK_IN_PLT instead of true, which happen to have the same numeric value.
Reported and tested by: theraven Reviewed by: kan MFC after: 2 weeks
|
232831 |
11-Mar-2012 |
kib |
Add support for preinit, init and fini arrays. Some ABIs, in particular on ARM, do require working init arrays.
Traditional FreeBSD crt1 calls _init and _fini of the binary, instead of allowing runtime linker to arrange the calls. This was probably done to have the same crt code serve both statically and dynamically linked binaries. Since ABI mandates that first is called preinit array functions, then init, and then init array functions, the init have to be called from rtld now.
To provide binary compatibility to old FreeBSD crt1, which calls _init itself, rtld only calls intializers and finalizers for main binary if binary has a note indicating that new crt was used for linking. Add parsing of ELF notes to rtld, and cache p_osrel value since we parsed it anyway.
The patch is inspired by init_array support for DragonflyBSD, written by John Marino.
Reviewed by: kan Tested by: andrew (arm, previous version), flo (sparc64, previous version) MFC after: 3 weeks
|
231618 |
14-Feb-2012 |
gonzo |
Add thread-local storage support for ARM to rtld-elf
Reviewed by: cognet Obtained from: NetBSD
|
228435 |
12-Dec-2011 |
kib |
Add support for STT_GNU_IFUNC and R_MACHINE_IRELATIVE GNU extensions to rtld on 386 and amd64. This adds runtime bits neccessary for the use of the dispatch functions from the dynamically-linked executables and shared libraries.
To allow use of external references from the dispatch function, resolution of the R_MACHINE_IRESOLVE relocations in PLT is postponed until GOT entries for PLT are prepared, and normal resolution of the GOT entries is finished. Similar to how it is done by GNU, IRELATIVE relocations are resolved in advance, instead of normal lazy handling for PLT.
Move the init_pltgot() call before the relocations for the object are processed.
MFC after: 3 weeks
|
217851 |
25-Jan-2011 |
kib |
When loading dso without PT_GNU_STACK phdr, only call __pthread_map_stacks_exec() on architectures that allow executable stacks.
Reported and tested by: marcel (ia64)
|
216695 |
25-Dec-2010 |
kib |
Implement support for ELF filters in rtld. Both normal and auxillary filters are implemented.
Filtees are loaded on demand, unless LD_LOADFLTR environment variable is set or -z loadfltr was specified during the linking. This forces rtld to upgrade read-locked rtld_bind_lock to write lock when it encounters an object with filter during symbol lookup.
Consolidate common arguments of the symbol lookup functions in the SymLook structure. Track the state of the rtld locks in the RtldLockState structure. Pass local RtldLockState through the rtld symbol lookup calls to allow lock upgrades.
Reviewed by: kan Tested by: Mykola Dzham <i levsha me>, nwhitehorn (powerpc)
|
208256 |
18-May-2010 |
rdivacky |
Only use the cache after the early stage of loading. This is because calling mmap() etc. may use GOT which is not set up yet. Use calloc() instead of mmap() in cases where this was the case before (sparc64, powerpc, arm).
Submitted by: Dimitry Andric (dimitry andric com) Reviewed by: kan Approved by: ed (mentor)
|
203973 |
16-Feb-2010 |
imp |
The NetBSD Foundation has granted permission to remove clauses 3 and 4.
Obtained from: NetBSD
|
191291 |
19-Apr-2009 |
rwatson |
Now that the kernel defines CACHE_LINE_SIZE in machine/param.h, use that definition in the custom locking code for the run-time linker rather than local definitions.
Pointed out by: tinderbox MFC after: 2 weeks
|
153515 |
18-Dec-2005 |
kan |
Implement ELF symbol versioning using GNU semantics. This code aims to be compatible with symbol versioning support as implemented by GNU libc and documented by http://people.redhat.com/~drepper/symbol-versioning and LSB 3.0.
Implement dlvsym() function to allow lookups for a specific version of a given symbol.
|
144764 |
07-Apr-2005 |
cognet |
No need to provide atomic_cmpset_32() anymore.
|
142593 |
26-Feb-2005 |
cognet |
Only provide the dummy, non-atomic atomic_cmpset_32() if ARM_HAS_ATOMIC_CMPSET_32 isn't defined.
|
138023 |
23-Nov-2004 |
cognet |
Implement a dummy atomic_cmpset_32(). It should be safe to use it in rtld as the signals are masked anyway.
|
137619 |
12-Nov-2004 |
jhb |
Remove these unused files before any other archs include the same bogus file.
|
135883 |
28-Sep-2004 |
cognet |
Don't try to relocate the dynamic loader in reloc_non_plt(). It has already been done before.
|
135882 |
28-Sep-2004 |
cognet |
Use add instead of saving the sp in a register.
|
135680 |
23-Sep-2004 |
cognet |
Add stubs for TLS. Arbitraly choose the 2nd variant until I figure out which one I should use.
|
130646 |
17-Jun-2004 |
cognet |
Woohoo ! the latest binutils import mades this gross hack useless, so just remove it.
|
129258 |
15-May-2004 |
cognet |
Work around a problem somewhere with binutils (?) on arm, hopefully without breaking any other arch this time.
|
129204 |
14-May-2004 |
cognet |
Import arm bits for rtld-elf.
Obtained from: NetBSD
|