summaryrefslogtreecommitdiff
path: root/libexec/ld.so
AgeCommit message (Collapse)Author
2016-01-24Delete remnants of grpsym cache setting during symbol search: it's done atPhilip Guenther
load time only nwo. Rename _dl_searchnum and lastlookup to _dl_grpsym_gen and grpsym_gen as they are generation numbers. Merge _dl_newsymsearch() into _dl_cache_grpsym_list_setup(). ok millert@
2016-01-24Lacking precise dependency-from-relocation tracking, a nodelete objectPhilip Guenther
needs to lock down the entire load group, not just the specific object. problem report and ok sthen@ been in snaps for a week
2015-12-22assign pointers to NULL rather than 0mmcc
2015-12-22Remove a couple needless allocation casts. No binary change.mmcc
2015-12-17s/failes/failed/gmmcc
2015-12-12Remove NULL-checks before free(). ok tb@mmcc
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-15pledge "stdio rpath wpath cpath tmppath fattr"Theo de Raadt
ok guenther
2015-11-06Fix unloading of load groups when the last reference wasn't on thePhilip Guenther
load_object but rather some descendent. Detect that case in _dl_unload_shlib() and switch to unloading the entire group. Based on partial analyses by Henri Kemppainen (duclare (at) guu.fi) and Peter Hajdu (peter.ferenc.hajdu (at) gmail.com) ok millert@
2015-11-02Remove duplicate declarationPhilip 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-11-02Fix typo: s/DT_JUMPREL/DT_JMPREL/Philip Guenther
2015-10-29remove tests for LD_HINTS_VERSION_1; ok kettenisTheo de Raadt
2015-10-14Check mmap and read return values. While at it, remove unused duplicated file.Tobias Stoeckmann
ok millert@
2015-09-23Don't be too agressive write-protecting the GOT and PLT. If we have no clueMark Kettenis
where they end, there is a good chance they are sharing a page with .data, which obviously needs to remain writable. So only attempt to make them read-only if we know they have a non-zero size. Original diff from guenther@ based on an earlier diff from me. Fixes ld -Z on alpha. ok miod@, guenther@
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-19Remove PROT_EXEC bit from GOT_PERMS. ld.so doesn't need it anymore, andMark Kettenis
rcrt0.o will add it for BSS-PLT binaries if necessary. ok guenther@
2015-09-19Make bootstrapping code compatible with the Secure-PLT ABI.Mark Kettenis
ok guenther@
2015-09-13Rename __sysctl syscall to just sysctl, as the userland wrapper is no longerPhilip Guenther
necessary ok deraadt@ jsing@
2015-09-12Use kbind for lazy binding GOT/PLT updates on arm.Philip Guenther
While here add some gcc __predict hints. Much testing, discussion, pondering, and flailing from miod and deraadt ok miod@
2015-09-09Some explicit iflush instructions after the kbind() call are still neededMiod Vallat
for now; misunderstanding between guenther@ and me.
2015-09-06Check strdup return value for NULL.Tobias Stoeckmann
ok millert@
2015-09-01Use kbind for lazy binding GOT/PLT updates on m88k and sparc.Philip Guenther
Much discussion with and assistance from miod and deraadt ok miod@
2015-08-31Add framework for resolving (pun intended) libc namespace issues, usingPhilip Guenther
wrapper .h files and asm labels to let internal calls resolve directly and not be overridable or use the PLT. Then, apply that framework to most of the functions in stdio.h, string.h, err.h, and wchar.h. Delete the should-have-been-hidden-all-along _v?(err|warn)[cx]? symbols while here. tests clean on i386, amd64, sparc64, powerpc, and mips64 naming feedback from kettenis@ and millert@ ok kettenis@
2015-08-28Use kbind for lazy binding GOT/PLT updates on sh (i.e. landisk)Philip Guenther
Much discussion with and assistance from miod and deraadt ok deraadt@
2015-08-28Use ELF_LDFLAGS to pass the --version-script argument such that we actuallyMark Kettenis
hide symbols on all our architectures; hppa, hppa64 and sh override LDADD. LDADD isn't really the proper variable for passing linker flags anyway. ok guenther@, deraadt@
2015-08-27If we take the address of a function pointer, we might get a pointer toMark Kettenis
a plabel instead of the entry-point address. In that case, get the entry-point address from the plabel. Makes ld.so work on hppa when _dl_bind_start gets hidden by the version script. ok miod@
2015-08-27Use kbind for lazy binding GOT/PLT updates on hppa.Philip Guenther
Much discussion with and assistance from miod and deraadt ok deraadt@
2015-08-26Kbind 3: The Legend Continues!Philip Guenther
Use kbind for lazy binding GOT/PLT updates on alpha and mips64. While here add some gcc __predict hints. Much discussion with and assistance from miod and deraadt ok deraadt@
2015-08-25Use kbind for lazy binding GOT/PLT updates on i386 and powerpc; still othersPhilip Guenther
to follow. While here add some gcc __predict hints. Much discussion with and assistance from miod and deraadt ok deraadt@
2015-08-23Apply a symbol export list to ld.so with just the expected dl*() and thePhilip Guenther
two symbols needed by gdb. Remember: ld.so exports override those in shared libs. ok deraadt@
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@
2015-08-23Add support for the Secure-PLT ABI variant. This will give us better W^XMark Kettenis
support on powerpc as it uses a non-executable GOT and PLT. "start slamming stuff in" deraadt@
2015-08-23spacesTheo de Raadt
2015-08-23huge amount of spacesTheo de Raadt
2015-08-18_dl_malloc() proto exists, do not cast resultTheo de Raadt
2015-08-17Add missing 'extern's to avoid introducing commons into *crt0.oPhilip Guenther
ok miod@ kettenis@
2015-07-26Reenable the ld.so pre-install test; the "am I cross-compiling" test wasPhilip Guenther
too loose. Update the test to try to exercise the printf binding twice. ok miod@
2015-07-26Copy relocations can't be jump-slot relocations, so delete the test for that.Philip Guenther
ok miod@
2015-07-03Correctly handle relative-type relocations; very old ld.so bug which gotMiod Vallat
fixed everywhere but on sparc for some unknown reason (and did not cause any havoc in real life).
2015-06-10breath->breadthStuart Henderson
2015-06-10Typos: equalivant, fucntion, libary.Miod Vallat
2015-06-03Do not assume that asprintf() clears the pointer on failure, whichTodd C. Miller
is non-portable. Also add missing asprintf() return value checks. OK deraadt@ guenther@ doug@
2015-06-01In the lazy binding routine, make sure we actually allocate the stack we need,Miod Vallat
instead of corrupting the caller's stack by mistake. This fixes the mysterious segfaults in __powerpc_read_tcb() reported on earlier G3 systems - more recent processors have been luckier... ok deraadt@
2015-05-29Make ld.so on alpha cope with binaries built with secureplt (where secure hereMiod Vallat
means read-only, which our ld.so already enforced, but a smaller plt section).
2015-05-26Better cross-compilation checkMiod Vallat
2015-05-22be pedantic with sizeof useJonathan Gray
no change in behaviour as sizeof(char **) is the same as sizeof(char *) ok otto@ guenther@
2015-05-06Fix a memory leak in _dl_load_dep_libs()Jonathan Gray
ok otto@ guenther@
2015-04-28tidy up the prebind text; prompted by zhukJason McIntyre