summaryrefslogtreecommitdiff
path: root/libexec/ld.so
AgeCommit message (Collapse)Author
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
2015-02-08Fix cross-build. OK jsing@ miod@ guenther@ deraadt@Masao Uebayashi
2015-02-06Raise ELF_RANDOMIZE_LIMIT to 64K, so that programs and libraries canTheo de Raadt
legitimately use random section variables without execve failures... Because this section is not demand faulted, yield() every page during the fill otherwise the costs are charged poorly. ok tedu matthew
2015-01-22delete annoying white space that annoyTheo de Raadt
2015-01-20If _dl_progname exceeds half the syslog buffer, truncate it with "...",Theo de Raadt
so that the remaining information is more visible ok kettenis miod
2015-01-20Add support for tracing libraries in static PIE binaries. rcrt does notTheo de Raadt
contain "LD_TRACE_LOADED_OBJECTS" support, so this gets done by calling RTLD_TRACE directly. ok guenther
2015-01-19gcc does not understand that the loop conditionally sets bsod beforeTheo de Raadt
using it, so it warns... Copy the warning silencing code from the same function in ../ld.so
2015-01-18do not require <a.out.h>Theo de Raadt
2015-01-16<sys/param.h> to <limits.h> conversion. Verified binariesTheo de Raadt
ok millert, thanks to doug for process advice
2014-12-30self-relocating crt0 bits for sh, and enable static pie by default. With someMiod Vallat
archdep.h help from kettenis@
2014-12-30Clean up and optimize _dl_start a bit by using immediate addressing forMiod Vallat
the constants whenever they fit, and avoiding saving and restoring registers we don't need to preserve.
2014-12-30Fix handling of R_MIPS_REL32_64 relocations that reference a symbol.Mark Kettenis
Fixes remaining problems with static PIE on mips64.
2014-12-27Static PIE for mips64. Still something not quite right as a full make buildMark Kettenis
fails. ok kurt@
2014-12-27Make ld.so process only R_ALPHA_RELATIVE relocations during early GOTMark Kettenis
relocation in _reloc_alpha_got(), and teach RELOC_RELA() to skip R_ALPHA_NONE relocations (which are just nops used to fill out the relocation table). Handling R_ALPHA_NONE relocations will be necessary for static PIE support and it is not inconceivable that ld.so will end up with such relocations at some point. ok kurt@
2014-12-24Expand Elf_Rel relocations to include DT_JMPREL. Inspect DT_PLTREL valueKurt Miller
to determine if DT_JMPREL relocations are REL or RELA and conditionally perform DT_JMPREL in either REL or RELA as needed (idea from kettenis@). Remove unneeded i386 RELA implementation. i386 static pie working now. okay kettenis@