summaryrefslogtreecommitdiff
path: root/libexec/ld.so/sparc64
AgeCommit message (Collapse)Author
2017-01-24On fatal errors, kill ourselves with thrkill(0,9,NULL) instead ofPhilip Guenther
simply exiting, via helper functions _dl_die(), _dl_diedie(), and _dl_oom(). prompted by a complaint from jsing@ ok jsing@ deraadt@
2017-01-21_dl_exit() is __dead, so it should return void.Philip Guenther
Move _dl_mmap() and _dl_mquery() inlines from archdep.h to syscall.h and remove pointless casts and unnecessary parens. ok kettenis@
2017-01-20Delete ancient macros and unnecessary #includesPhilip Guenther
ok deraadt@
2017-01-09Remove dependency on __got_{start,end} symbols and look at PT_GNU_RELROMark Kettenis
instead. Result in a few more pages that aren't writable on some platforms (such as hppa). Based on an initial diff from guenther@. Thanks to deraadt@ for testing. ok guenther@
2016-08-28ld.so doesn't need gettimeofday or lstat stubs any morePhilip Guenther
ok deraadt@
2016-07-04Remove prebind support: binding to symbol table indices is too fragilePhilip Guenther
for our development process. ok kettenis@ deraadt@
2016-06-21When handling DT_TEXTREL only set the mapping to READ+WRITE, ignoreTheo de Raadt
possible EXEC permission for the section, because the proper permission is set late, and there are no thread concerns here. Avoids W^X issues in oddball cases. ok guenther kettenis
2016-05-21Temporarily make the PLT writable when we're initializing the magic slotsMark Kettenis
or doing non-lazy relocation processing. ok guenther@
2016-05-18fix types for mmap wrappers. A few whitespace cleanups snuck in.Theo de Raadt
ok guenther
2016-05-07Use a Thread Information Block in both single and multi-threaded programs.Philip Guenther
This stores errno, the cancelation flags, and related bits for each thread and is allocated by ld.so or libc.a. This is an ABI break from 5.9-stable! Make libpthread dlopen'able by moving the cancelation wrappers into libc and doing locking and fork/errno handling via callbacks that libpthread registers when it first initializes. 'errno' *must* be declared via <errno.h> now! Clean up libpthread's symbol exports like libc. On powerpc, offset the TIB/TCB/TLS data from the register per the ELF spec. Testing by various, particularly sthen@ and patrick@ ok kettenis@
2016-03-21Rename the system call sendsyslog2 to sendsyslog. Keep the old oneAlexander Bluhm
as osendsyslog for a while. The three argument variant is the only one that will stay. input kettenis@; OK deraadt@
2016-03-21Switch ld.so's stack smash handler from sendsyslog to sendsyslog2Philip Guenther
and pass the LOG_CONS flag like libc's handler. ok deraadt@ bluhm@ (who had a similar diff)
2015-12-06Simplify the relocation code for the ld.so bootstrap and static pie: trackPhilip Guenther
just the dynamic tags are needed instead of reusing the generic elf_object_t structure. testing and feedback from miod@ ok kettenis@
2015-11-15ldd(1) sets environment variable LD_TRACE_LOADED_OBJECTS to tell ld.soTheo de Raadt
that it should show information about the program it loads, rather than run it. In that specific case, ld.so can pledge to "stdio rpath" to ensure that code path in ld.so has no bugs. Yes, a pledge in ld.so.... who'd have thought! ok guenther
2015-11-02Factor out the logic for mprotecting the memory between two symbols intoPhilip Guenther
a new MI routine _dl_protect_segment(), and use that for protecting the GOT and--on some archs--the PLT. Amazing testing turnaround by miod@, who apparently violated relativity to get back results on some archs as fast as he did
2015-09-19kbind has eliminated the need for and use of the bind lock. Delete it, thePhilip Guenther
the callback, and the sigprocmask stub. Keep around the DL_SETBINDLCK case until libpthread stops using it. discussed with miod@ at l2k15 ok kettenis@
2015-09-13Rename __sysctl syscall to just sysctl, as the userland wrapper is no longerPhilip Guenther
necessary ok deraadt@ jsing@
2015-08-23Use kbind for lazy binding GOT/PLT updates on amd64 and sparc64; othersPhilip Guenther
to follow. While here add some gcc __predict hints. Much discussion with and assistance from miod and deraadt ok deraadt@
2014-11-03Eliminate RTLD_PROTECT_PLT: ld.so is built with -Bsymbolic so thePhilip Guenther
PLT is empty/unused. On at least macppc and sparc64, ld.so's attempt to mprotect its PLT could instead hit its own allocated data and cause a segfault shortly there after. While here, take a shot at preventing the same issue with the GOT by checking for __got_start != __got_end. reproduction *with ktracing* by afresh1@ provided the key data ok miod@ deraadt@
2014-09-01Sync readlink(2) with IEEE Std 1003.1-2008.Doug Hogan
discussion, help and ok guenther@
2014-08-30Make the handling of PLT entries above the 32k mark thread-safe.Philip Guenther
Also, make a comment not lie: use the V9 ISA's relative branch immediate instruction for short (with in 2^19 words) PLT branches. ok miod@
2014-07-14Now that we have sendsyslog(2), we can directly use it in theTheo de Raadt
(previously completely retarded) stack_smash_handler of ld.so ok beck miod tedu
2014-07-09_dl_fcntl() is no longer used; kill the stubsPhilip Guenther
ok otto@ miod@
2014-07-06move from sysclt(KERN_ARND) to getentropy(2); ok miod@, kettenis@Otto Moerbeek
2014-07-05Mark _dl_exit __dead.Miod Vallat
2014-04-16It's been a quarter century: we can assume volatile is present with that name.Philip Guenther
2013-12-23Use slightly diffrerent code to get the global offset table address. ThisMark Kettenis
version will match the (upcoming) 32-bit version (for sparc) and allegedly is slightly faster.
2013-12-23Make ld.so pass its cleanup handler in %g1 as required by the SPARC System VMark Kettenis
ABI, and stop calling atexit(4) directly from ld.so on sparc64
2013-08-13Switch time_t, ino_t, clock_t, and struct kevent's ident and dataPhilip Guenther
members to 64bit types. Assign new syscall numbers for (almost all) the syscalls that involve the affected types, including anything with time_t, timeval, itimerval, timespec, rusage, dirent, stat, or kevent arguments. Add a d_off member to struct dirent and replace getdirentries() with getdents(), thus immensely simplifying and accelerating telldir/seekdir. Build perl with -DBIG_TIME. Bump the major on every single base library: the compat bits included here are only good enough to make the transition; the T32 compat option will be burned as soon as we've reached the new world are are happy with the snapshots for all architectures. DANGER: ABI incompatibility. Updating to this kernel requires extra work or you won't be able to login: install a snapshot instead. Much assistance in fixing userland issues from deraadt@ and tedu@ and build assistance from todd@ and otto@
2013-06-13Appease LLVM warning..Brad Smith
error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference] Suggestion from matthew@ Ok matthew@ miod@
2013-06-09Constify the mib argument of sysctl().Miod Vallat
ok matthew@ millert@
2013-06-01Make all the syscall prototypes consistent with their real forms for types,Philip Guenther
whitespace, and no argument names. ok matthew@ deraadt@
2013-06-01Introduce ltrace(1). This tool works with ld.so to inject utrace record forMiod Vallat
each plt call, allowing to trace a binary linked against shared library at the public function call level. To do so, ltrace(1) sets up some environment variables to enable plt tracing in ld.so, and invokes ktrace(2) for utrace events. ld.so will force lazy binding and will send an utrace record in the plt resolver, without updating the plt. Minimal filtering capabilities are provided, inspired by Solaris' truss -u, to limit tracing to libraries and/or symbol names. Non-traced libraries and symbols will have the regular resolver processing, with the expected plt update. "Get it in" deraadt
2013-05-08Implement symbol caching and RELACOUNT/RELCOUNT optimizations.Philip Guenther
Much assistance and testing by miod ok miod@
2013-04-05- Add ORIGIN, OSNAME, OSREL and PLATFORM substitution support for rpaths.Kurt Miller
Improvements and okay matthew@, millert@, guenther@
2013-01-31The code to use relative jumps in the GOT was completely broken, calculatingPhilip Guenther
the offset in the wrong direction, failing to take into account where in the relocation the jump would be, and not even using the right instructions in one case. Fortunately(?), the test of whether the offset was small enough had signed-vs-unsigned bugs too, so it was never used. ok miod@
2012-12-05Remove excessive sys/cdefs.h inclusionTheo de Raadt
ok guenther millert kettenis
2012-10-24Garbage-collect the _dl_stat() routine, now unusedPhilip Guenthe
ok matthew@ deraadt@
2012-10-22Stop passing around PS_STRINGS in %g1. The ELF ABI reserves this registerMark Kettenis
for passing around a pointer to a cleanup function and we'd like to use it for that purpose in the near future. ok miod@
2011-04-06Avoid using NULL in non-pointer contexts: use 0 for integer values and '\0'Miod Vallat
for chars.
2010-10-28Change basep parameter of getdirentries() to be off_t *, not long *Todd C. Miller
so it works correctly with large offsets (and matches other systems). This requires adding a new getdirentries syscall, with the old one renamed to ogetdirentries. All in-tree consumers of getdirentries() have been updated. Bump libc and libpthread major numbers. OK and with deraadt@
2010-10-27Fix comment; no binary change. OK deraadt@Todd C. Miller
2010-05-09Reserve space for 6 extended word argument slots required by the ABI.Mark Kettenis
Apparently gcc4 uses them in cases where gcc3 didn't. Fixes segmentation faults with gcc4 because the space for the slots was colliding with the space for dl_data that we allocated on the stack. ok miod@
2010-05-02Combine the signal mask handling into _dl_thread_bind_lock(), as it's MI.Philip Guenthe
ok drahn@
2010-04-24Fix handling of more than 32768 PLT entries. Mostly from NetBSD.Mark Kettenis
eyeballed by deraadt@ and drahn@
2010-01-02Fix handling of hppa RELOC_IPLT relocations during 'bootstrap relocation'.Mark Kettenis
ok miod@, deraadt@, jsing@
2008-10-02Fix mmap() error checking to be correct 64-bit addresses. ConsistentlyKurt Miller
use _dl_mmap_error() to check for mmap() errors. Adjust datatypes of some local vars for 64-bit safety. okay millert@ drahn@
2008-07-16Fix several of the 'large offset' PLT entries. With help from kurt.Dale Rahn
ok kurt@
2008-04-09Improve support for shared libs linked at non-zero addreses:Kurt Miller
- rename private values in struct elf_object to better describe their meaning: s/load_offs/obj_base/ "object's address '0' base" s/load_addr/load_base/ "The base address of the loadable segments" - gdb needs the obj_base value so swap positions with load_base in struct elf_object - fix a few occurrences of where load_base was used instead of obj_base. With help and okay drahn@
2008-02-24Use rounded down address when changing memory protections on the GOT, suchMark Kettenis
that we don't accidentally touch the page after the GOT. ok drahn@