summaryrefslogtreecommitdiffstats
path: root/libexec/rtld-elf/powerpc64
Commit message (Collapse)AuthorAgeFilesLines
* 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)
* Revert r253748,253749avg2013-07-281-0/+1
| | | | | | This WIP should not have been committed yet. Pointyhat to: avg
* remove needless inclusion of machine/cpu.h in userlandavg2013-07-281-1/+0
| | | | MFC after: 21 days
* Avoid use of register variables, which some compilers (e.g. clang)nwhitehorn2013-02-081-9/+5
| | | | | | don't like. It makes the code a little clearer as well. MFC after: 1 week
* 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
* Use xmalloc() instead of malloc() in the places where malloc() callskib2012-03-221-1/+1
| | | | | | | | | | | | | | | are assumed to not fail. Make the xcalloc() calling conventions follow the calloc(3) calling conventions and replace unchecked calls to calloc() with calls to xcalloc(). Remove redundand declarations from xmalloc.c, which are already present in rtld.h. Reviewed by: kan Discussed with: bde MFC after: 2 weeks
* Fix several problems with our ELF filters implementation.kib2012-03-201-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Additional icache paranoia: non-PLT relocations can modify the text segment.nwhitehorn2011-12-171-2/+5
| | | | | | | It is then important to make sure the icache is synchronized again to prevent (rare) random seg faults and illegal instructions. MFC after: 3 days
* 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
* Remove dead code that snuck in from the 32-bit PowerPC version of thisnwhitehorn2011-03-071-4/+0
| | | | file. The error being checked for does not exist on 64-bit systems.
* Turn off default generation of userland dot symbols on powerpc64 now thatnwhitehorn2011-02-181-3/+3
| | | | | we have a binutils that supports it. Kernel dot symbols remain on to assist DDB.
* 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)
* Mark rtld on PowerPC as not requiring executable stack.kib2011-01-141-0/+1
| | | | Reviewed and tested by: nwhitehorn
* Add support for R_PPC64_UADDR64 relocations.nwhitehorn2011-01-031-1/+2
|
* Fix an error in the ABI in rtld_bind_start(). When passing arguments to anwhitehorn2010-12-281-44/+44
| | | | | | | | | C function, the caller's stack frame must have room to store all of the arguments to that function. While here, fix stack frame alignment issues. Without this change, the compiler will save r3 and r4 into the caller's stack frame before calling setjmp() in _rtld_bind(). These would then overwrite arguments to the newly-bound function, causing eventual failures.
* Implement support for ELF filters in rtld. Both normal and auxillarykib2010-12-251-17/+20
| | | | | | | | | | | | | | | | | 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)
* Check for undefined weak symbols during PLT binding on powerpc64, and donwhitehorn2010-09-121-2/+7
| | | | | | | not attempt to copy NULL function descriptors. This fixes LD_BIND_NOW on powerpc64 after r211706. Reviewed by: kib
* RTLD support for powerpc64. A few small modifications to the Makefilenwhitehorn2010-07-104-0/+734
and symbol map are required to support various consequences of the dot symbol scheme: - Symbols beginning with a dot are reserved, so start private symbols with an underscore. - In order to set RTLD breakpoints, gdb must be able to locate the text entry point, not the data section function descriptor, so add .r_debug_state to the symbol map on powerpc64. Obtained from: projects/ppc64
OpenPOWER on IntegriCloud