summaryrefslogtreecommitdiff
path: root/libexec/ld.so
AgeCommit message (Collapse)Author
2018-11-15Put all the symbol lookup parameters (except the object being searched) andPhilip Guenther
the return pointers into a structure and pass that to _dl_find_symbol_obj(). Set sl->sl_obj_out in _dl_find_symbol_obj() so that the callers don't need to each record the object. ok mpi@
2018-11-12Delete support for non-secureplt binaries. The secure PLT format has beenPhilip Guenther
the default for years and ports doesn't appear to have anything patching to use the old format. ok deraadt@
2018-11-09Delete superfluous libc reach-around variables, left over from thePhilip Guenther
old syscall stubs. Prompted by miod@'s poke on m88k ok visa@
2018-11-09Delete superfluous libc reacharounds.Philip Guenther
Replace magic numbers with symbolic constants in ldasm.S Let the kernel do the cacheflush optimization. from miod@
2018-11-09Delete support for obsolete BSS PLT format, which was last known to bePhilip Guenther
used by the dearly departed editors/emacs21 port. Per naddy@, we'll keep an eye out for issues in the next ports bulk build
2018-11-02ld.so's malloc has no runtime option processing, so remove theOtto Moerbeek
setting flags and replace them by constants. ok deraadt@ guenther@
2018-10-25The compilers already put static arrays in .rodata when not written to;Philip Guenther
marking them const will keep a source change from silently moving them back to .data ok deraadt@ kettenis@
2018-10-23Delay processing of ld.so's own PT_GNU_RELRO section until after environmentPhilip Guenther
processing and malloc initialization, and then move variables set by those steps, including malloc's mopts structure, into the .data.rel.ro segment. This protects more data and eliminates the extra padding of the mopts. ok kettenis@
2018-10-22Use int, not char*, for booleansPhilip Guenther
ok millert@
2018-10-01Add retguard to arm64 ld.so.mortimer
ok kettenis@
2018-08-29make ld.so build reproducible by including a FILE symbol and by removingRobert Nagy
-x from ld; this is only used for syspatch creation so builds are still randomized just as before ok guenther@
2018-07-24Fix address calculation for _DYNAMIC. We want to address of _DYNAMIC itself,Mark Kettenis
not the address of its GOT entry. The current code mixed the high bits of the GOT entry address with the low bits of the true address. This only worked by accident for small binaries where _DYNAMIC and its GOT entry happen to reside on the same page. ok guenther@, mortimer@
2018-07-09unify the various per-arch syscall.h as much as possibleTheo de Raadt
ok kettenis guenther
2018-06-16Add add PIE support for m88k (requires gcc4 toolchain)Philip Guenther
Convert __cerror to hidden visibility. from miod@
2018-06-08Bail out if fchmod(2) fails.cheloha
Don't quietly install ld.so.hints with mode 0600 because this adds overhead to shlib lookup for non-root processes. From Nan Xiao. ok guenther@
2018-06-01Bump ELF_RANDOMIZE_LIMIT to 1MB.mortimer
ok deraadt@
2018-05-15On arm64 negate the whole 64-bit register otherwise system call wrappersMark Kettenis
that return ssize_t will not return a negative value upon error. Fixes dynamical loading of shared objects using dlopen(). ok guenther@
2018-04-27Make sure ld.so doesn't use floating point registers, as the lazy-bindingPhilip Guenther
stub doesn't preserve them and some may be used for passing arguments ok kettenis@ deraadt@ mlarkin@
2018-04-26Use <fcntl.h> instead of <sys/file.h> for open() and friends.Philip Guenther
Delete a bunch of unnecessary #includes and sort to match style(9) while doing the above cleanup. ok deraadt@ krw@
2018-03-09Add support for the DF_TEXTREL flag.Mark Kettenis
ok patrick@, millert@
2018-02-09Use a static chacha instance to fill randomdata sections. Avoids loopingmortimer
over a syscall for randomdata sections larger than 256B. ok djm@ deraadt@ kettenis@
2018-02-07sync with libc malloc: use consistent style for for loop in unmap(),Otto Moerbeek
no functional change
2018-02-04Expand Type strings by one space, to fit ld.so, in the same ugly way "exe "Theo de Raadt
was being handled.
2018-02-01don't forget to increment loop var; infinite loops spotted by sthen@Otto Moerbeek
2018-01-30No need to add ffs.c as we use .VPATH to reach over into libc/string.Mark Kettenis
ok otto@
2018-01-30provide ffs, gcc generates calls to it, even when __builtin_ffs() is used.Otto Moerbeek
ok deraadt@
2018-01-30kill a gcc warningOtto Moerbeek
2018-01-30port over the malloc changes from libc. prompted by deraadt@Otto Moerbeek
2018-01-18Unlike other archs, mips64 needs ld.so to know about symbol visibility andPhilip Guenther
skip symbol lookup on protected symbols. Add visibility #defines to <sys/exec_elf.h> to support that. ok kettenis@ visa@
2017-12-24Fix one possible buffer overflow and one underflow. Also some minorTodd C. Miller
cleanups. From Jan Kokemueller. OK deraadt@
2017-12-21Implement missing bits to support lazy binding. Note that the codeMark Kettenis
deliberately does not save the floating-point argument registers before calling _dl_bind(). Doing so would force an FPU context switch upon every function call through the PLT. But since we compile ld.so with -march=armv8-a+nofp+nosimd this is safe since nothing in the _dl_bind() codepath uses he FPU registers. ok guenther@, drahn@
2017-12-12ld.so's syscall _dl_* API/ABI doesn't reurn errno, but -errno.Theo de Raadt
Reviewing behaviour artifacts with pledge, I discover a close(-ENOSYS).. ok guenther
2017-12-12spacingTheo de Raadt
2017-12-08also cleanout ld.so.aTheo de Raadt
2017-12-08Everyone knows this as ld.so, nor by the ancient name rtld.Theo de Raadt
ok guenther
2017-12-01Redo the calculation of the alignment and placement of static TLS data toPhilip Guenther
correctly take into account the segment p_align. Previously, anything with a size belong the natural alignment or with alignment larger than the natural one would either not be intialized correctly, be misaligned, or result in the TIB being misaligned. Problems reported by Charles Collicutt (charles (at) collicutt.co.uk) ok kettenis@
2017-11-28Implement a DL_REFERENCE dlctl. To be used by the upcomingMark Kettenis
__cxa_thread_atexit() implementation. ok guenther@
2017-11-15Tweak bitmask calculation to match i386 and avoid clang warning.Mark Kettenis
ok tom@
2017-11-05Consolidate lib.so.*.a, ld.so.a and the kernel relink kit intoRobert Peichaer
one location under /usr/share/relink. Be more specific in src/etc/rc reorder_libs() what filesystems need r/w remount and ensure that their mount state is restored. Idea and positive feedback from deraadt@ OK aja@ tb@
2017-10-29Prefer <elf.h> to the non portable <sys/exec_elf.h>.Martin Pieuchot
ok jca@, deraadt@
2017-10-27Use <elf.h> instead of <elf_abi.h>Martin Pieuchot
ok jasper@, jca@, deraadt@
2017-10-26If LD_BIND_NOW is in force then all relocations are performed eagerly,Philip Guenther
when the object is loaded. Since kbind(2) will never be used in that case, disable it early, before invoking any library or application code. ok deraadt@ kettenis@
2017-10-24R_AARCH64_NONE should be zero, not 256. The latter was a deprecatedPhilip Guenther
assignment and isn't used by clang/lld. ok jsg@
2017-10-10__plt_{start,end} are no longer generated or necessary, having beenPhilip Guenther
superseded by the generic ?WX and RELRO support. Stop trying to look up and use them. ok kettenis@ deraadt@
2017-10-05Sync with libc malloc, doing delayed free double-free check alwaysOtto Moerbeek
2017-09-09Remove superfluous mprotect()ing of the PLT that's been obsoleted byPhilip Guenther
the generic handling of RWX segments. ok aoyama@
2017-09-03Fix m88k problem in recent ld.so changes.Kenji Aoyama
- move _dl_cerror function from SYS.h to ldasm.S to avoid duplicate definition when linking - [SYS.h] pull some macros from lib/libc/arch/m88k/DEFS.h - [ldasm.S] add "'never hit' but needed" br again in _dl_cacheflush (thanks to Miod Vallat) - [ldasm.S] change ld.hu into ld.h in order to get a correctly signed and sign-extended value (also thanks to Miod Vallat) ok deraadt@
2017-08-29rename *fdprint function to *dprintf, like libc versionTheo de Raadt
2017-08-28whitespaceTheo de Raadt
2017-08-28whitespaceTheo de Raadt