summaryrefslogtreecommitdiff
path: root/libexec
AgeCommit message (Collapse)Author
2016-09-01retire sparcTed Unangst
2016-08-31Don't attempt to support IPv4-mapped IPv6 addresses.Jeremie Courreges-Anglas
We don't consider support for those addreses as desirable, so let's not give a bad example by keeping application code to handle them. This is dead code on OpenBSD anyway since we do not support IPv4-mapped stuff. But let's keep the check to log and warn the admin if the code gets ported elsewhere. Porters of this code should ensure that IPv6 sockets can't see IPv4-mapped addresses by using the IPV6_V6ONLY sockopt. Discussed with & ok tedu@ For a rationale, see https://tools.ietf.org/html/draft-itojun-v6ops-v4mapped-harmful-02
2016-08-31alpha and sh have TCB_SET() macros so don't need _dl_set_tcb()Philip Guenther
ok deraadt@
2016-08-30remove ifdef for all the features we have.Ted Unangst
retain disabled ip4in6 code until its future is decided. ok deraadt jca
2016-08-30Move DT_NUM from <sys/exec_elf.h> to resolv.h in ld.so where it belongs.Mark Kettenis
ok guenther@
2016-08-28ld.so doesn't need gettimeofday or lstat stubs any morePhilip Guenther
ok deraadt@
2016-08-28fix a commentPhilip Guenther
2016-08-28Don't call lstat() before readlink() just to see if it's a symlink,Philip Guenther
as readlink() will tell you that more cheaply. ok millert@
2016-08-27Delete debugging from when lazy binding was being implementedPhilip Guenther
ok deraadt@
2016-08-27Pull in <stddef.h> for NULLPhilip Guenther
(not stdio, because ld.so has a reduced library behind it)
2016-08-27Pull in <sys/time.h> for struct timespecPhilip Guenther
ok deraadt@
2016-08-26Pull in <sys/time.h> for gettimeofday()Philip Guenther
ok deraadt@
2016-08-26trim down some NBBY references. 8 bits ought to be enough for anyone.Ted Unangst
2016-08-23Implement support for DT_INIT_ARRAY, DT_FINI_ARRAY and DT_PREINIT_ARRAY.Mark Kettenis
Don't skip DT_INIT and DT_FINI for the main executable. This matches what Linux and Solaris do. ok guenther@
2016-08-22This code served us well for many years,Ingo Schwarze
but we are unlikely to reactivate it; espie@ agrees. The new code is in /usr/src/usr.bin/mandoc/mandocdb.c.
2016-08-16fread hasn't taken a char * in about 900 yearsTed Unangst
2016-08-16remove unneeded castsTed Unangst
2016-08-15Drop -z nocombreloc. It was a rev 1.1 commit like on arm, so not clearPhilip Guenther
why it was needed then; perhaps fixed by the bump in binutils? Removing it enables the full relro layout for ld.so.
2016-08-14When upcasting to off_t for multiplication, the cast needs to be *before*Philip Guenther
the multiplication to avoid truncation/overflow ok krw@
2016-08-14Convert %q to %ll with long long casts for printf()Philip Guenther
Delete pointless casts to off_t, void*, and uid_t ok krw@
2016-08-14Drop -z nocombreloc. That's a rev 1.1 commit so not clear why it was neededPhilip Guenther
then; perhaps fixed by the bump in binutils? Anyway, builds seem good without it and that enables the full relro layout for ld.so. ok kettenis@
2016-08-14Mark the relro/got section as read-only before setting up the environmentPhilip Guenther
to minimize the amount of code run without it RO.
2016-08-13Passing in &_DYNAMIC appears to have stuck, so eliminate the extraPhilip Guenther
variable
2016-08-12the slimmed down random functions inside ld.so are strict clones of theTheo de Raadt
libc arc4random API, so call them _dl_{arc4random,arcrandombuf} ok tedu guenther
2016-08-09Teach arm to pass &_DYNAMIC to _dl_boot_bind(); can optimize later in treePhilip Guenther
2016-08-08Look for a PT_GNU_RELRO section per object and, if present, mprotect thatPhilip Guenther
range instead of the [__got_start, __got_end) range. On many archs this will cover _DYNAMIC too, so move up the DT_DEBUG handling to before relocations and the mprotect are done. ok kettenis@
2016-08-07As with csu, alpha passes &_DYNAMIC to _reloc_alpha_got(), so justPhilip Guenther
save that and pass it to _dl_boot_bind() too
2016-08-07Teach i386 to pass &_DYNAMIC to _dl_boot_bind()Philip Guenther
2016-08-07Teach mips64 to pass &_DYNAMIC to _dl_boot_bind()Philip Guenther
mips64be testing by deraadt@
2016-08-07hahahah: amd64 has been passing &_DYNAMIC to _dl_boot_bind() forPhilip Guenther
*149 months*
2016-08-07Flip the #ifdef logic: amd64, arm, i386, and mips64 are the only archsPhilip Guenther
using the #else case
2016-08-05use a larger chunk for getentropy() and save some for next time.Ted Unangst
coalesces some syscalls instead of one per random number. ok deraadt
2016-08-01zap unused varJeremie Courreges-Anglas
2016-07-18Polish:Philip Guenther
- copy #define workaround from mips64 to avoid dangling __CERROR symbol - remove trap DL_SYSCALL2_NOERR() macro with comment explanation - make DL_SYSCALL2() self-contained - add END() and ENTRY() macros to make the symbol table shine ok miod@
2016-07-18Updated advice^Wcode from miod@ for passing &_DYNAMIC to _dl_boot_bindPhilip Guenther
ok aoyama@
2016-07-15Switch m88k to pass &_DYNAMIC to _dl_boot_bind()Philip Guenther
probably works: this ASM pattern is already used for _dl_dtors
2016-07-13Adjust existing tls_config_set_cipher() callers for TLS cipher groupJoel Sing
changes - map the previous configuration to the equivalent in the new groups. This will be revisited post release. Discussed with beck@
2016-07-04Remove prebind support: binding to symbol table indices is too fragilePhilip Guenther
for our development process. ok kettenis@ deraadt@
2016-07-04Nuke prebind support; it's unworkable and we're never going to finish it.Mark Kettenis
ok guenther@, deraadt@
2016-07-04The GOT has been initally mapped RW for *years*; ld.so doesn't need toPhilip Guenther
mprotect it to RW when filling in the references from the PLT in snaps for a week, ok deraadt@
2016-07-04Use fstatat() instead of crafting a filename to use with stat()Philip Guenther
ok millert@
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-06-21Handle textrels like other architectures do.Theo de Raadt
ok kettenis guenther
2016-06-18Make mips64 like all the others: only make mappings writable during relocationPhilip Guenther
if DT_TEXTREL was set on the object. If that's needed, only set the mapping to READ+WRITE to avoid W^X violation. ok kettenis@
2016-06-13Only need to sync the icache on the GOT for the old BSS PLT formatPhilip Guenther
ok kettenis@
2016-06-08Some ELF ABIs still require a PLT that is both writable and executable. ToMark Kettenis
avoid W^X violations, initially map such segments as writable and non-executable, and change the mapping to non-writable and executable after initial relocation processing. As a side-benefit this means we no longer depend on the __plt_start and __plt_end to make the PLT read-only after relocation processing. This will break binaries linked with ld -Z, most notably emacs, on some of our architectures. ok deraadt@, guenther@
2016-06-05Avoid W^X violation when setting DT_DEBUG on mips64.Mark Kettenis
ok deraadt@
2016-05-26for textrels (sthen ran into one...):Theo de Raadt
Ignore the listed protection (which may contain X) when making page writeable temporary.
2016-05-22Ignore the listed protection (which may contain X) when making pageTheo de Raadt
writeable temporary. As pointed out by kettenis, discussed with guenther
2016-05-21mul/div/rem replacement should happen without PROT_EXECTheo de Raadt
ok guenther