summaryrefslogtreecommitdiffstats
path: root/libexec/rtld-elf/arm
Commit message (Collapse)AuthorAgeFilesLines
* MFC r308689:kib2016-11-232-0/+8
| | | | | | | | | | 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.
* MFC r257811 (by markj):kib2016-03-121-2/+2
| | | | | | | | | | | | | | | 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.
* MFC r270798:kib2014-09-121-0/+4
| | | | | | | | | | 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)
* Merging of projects/armv6, part 2gonzo2012-08-151-1/+14
| | | | Handle TLS for ARMv6 and ARMv7
* Ensure we align the stack to 8 bytes in rtld.andrew2012-08-041-2/+4
| | | | | | | 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.
* Add GNU hash support for rtld.kib2012-04-301-1/+1
| | | | | | | Based on dragonflybsd support for GNU hash by John Marino <draco marino st> Reviewed by: kan Tested by: bapt MFC after: 2 weeks
* Fix several problems with our ELF filters implementation.kib2012-03-201-11/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add support for preinit, init and fini arrays. Some ABIs, inkib2012-03-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Add thread-local storage support for ARM to rtld-elfgonzo2012-02-142-6/+81
| | | | | Reviewed by: cognet Obtained from: NetBSD
* Add support for STT_GNU_IFUNC and R_MACHINE_IRELATIVE GNU extensions tokib2011-12-121-0/+16
| | | | | | | | | | | | | | | | | 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
* When loading dso without PT_GNU_STACK phdr, only callkib2011-01-251-0/+3
| | | | | | | __pthread_map_stacks_exec() on architectures that allow executable stacks. Reported and tested by: marcel (ia64)
* Implement support for ELF filters in rtld. Both normal and auxillarykib2010-12-251-20/+31
| | | | | | | | | | | | | | | | | 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)
* Only use the cache after the early stage of loading. This isrdivacky2010-05-181-8/+5
| | | | | | | | | | 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)
* The NetBSD Foundation has granted permission to remove clauses 3 and 4.imp2010-02-161-7/+0
| | | | Obtained from: NetBSD
* Now that the kernel defines CACHE_LINE_SIZE in machine/param.h, userwatson2009-04-191-2/+0
| | | | | | | | that definition in the custom locking code for the run-time linker rather than local definitions. Pointed out by: tinderbox MFC after: 2 weeks
* Implement ELF symbol versioning using GNU semantics. This code aimskan2005-12-181-1/+3
| | | | | | | | | 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.
* No need to provide atomic_cmpset_32() anymore.cognet2005-04-071-12/+0
|
* Only provide the dummy, non-atomic atomic_cmpset_32() ifcognet2005-02-261-0/+2
| | | | ARM_HAS_ATOMIC_CMPSET_32 isn't defined.
* Implement a dummy atomic_cmpset_32(). It should be safe to use it in rtld ascognet2004-11-231-0/+11
| | | | the signals are masked anyway.
* Remove these unused files before any other archs include the same bogusjhb2004-11-121-171/+0
| | | | file.
* Don't try to relocate the dynamic loader in reloc_non_plt(). It has alreadycognet2004-09-281-1/+4
| | | | been done before.
* Use add instead of saving the sp in a register.cognet2004-09-281-2/+1
|
* Add stubs for TLS.cognet2004-09-233-15/+30
| | | | Arbitraly choose the 2nd variant until I figure out which one I should use.
* Woohoo !cognet2004-06-171-2/+0
| | | | the latest binutils import mades this gross hack useless, so just remove it.
* Work around a problem somewhere with binutils (?) on arm, hopefully withoutcognet2004-05-151-0/+2
| | | | breaking any other arch this time.
* Import arm bits for rtld-elf.cognet2004-05-145-0/+682
Obtained from: NetBSD
OpenPOWER on IntegriCloud