summaryrefslogtreecommitdiff
path: root/libexec/ld.so
AgeCommit message (Collapse)Author
2013-01-05Switch m88k ports to ELF.Miod Vallat
2013-01-05if defined(NOPIC), do not attempt to .include arch/Makefile.inc for it mayMiod Vallat
not exist yet.
2012-12-31Spell `calculation' correctly.Miod Vallat
2012-12-22Zero %r0 before transferring control to the main program, to indicate thatMark Kettenis
the main program should not register a cleanup handler with atexit(3). This will allow us to add the cleanup handler registration code to crt0.c and have ld.so pass its cleanup handler to the main program in the future. tested by tobiasu@ ok kurt@
2012-12-05Remove excessive sys/cdefs.h inclusionTheo de Raadt
ok guenther millert kettenis
2012-11-01Zero v0 before transferring control to the main program to indicate thatMark Kettenis
the main program should not reguster a cleanup handler with atexit(3). This will allow us to add the cleanup handler registration code to crt0.c and have ld.so pass its cleanup handler to the main program in the future. While there, also zero ra to mark the last stack frame as demanded by the ELF ABI. ok kurt@, miod@
2012-11-01Clear r7 before passing control to the main object.Mark Kettenis
2012-10-27Clear arg1 before passing control to the main object.Mark Kettenis
2012-10-24Garbage-collect the _dl_stat() routine, now unusedPhilip Guenthe
ok matthew@ deraadt@
2012-10-22Zero %rdx before transferring control to the main program, to indicate thatMark Kettenis
the main program should not register a cleanup handler with atexit(3). This will allow us to add the cleanup handler registration code to crt0.c and have ld.so pass its cleanup handler to the main program in the future. ok kurt@
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@
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@
2012-09-17replace the erroneous DIAGNOSTICS section with a (hopefully) accurateJason McIntyre
EXIT STATUS one; ok guenther
2012-09-12Define empty CDIAGFLAGS for programs that use Werror.Christiano F. Haesbaert
Makes "make build" build with WARNINGS=Yes on amd64. ok espie
2012-09-11prevent detection of bogus librariesMarc Espie
problem initially noticed by deraadt@, exchanged various patches with kettenis@ decided to fix the bug now, even though ldconfig could probably use a larger rewrite. okay matthew@
2012-09-02Specify an include path for SYS.h via CPPFLAGS not AFLAGSJonathan Gray
so mkdep can find it. This was breaking builds after recent changes to mkdep to error out if the compiler does. ok deraadt@
2012-08-31Compile ld.so with debug info. This will not only help people hacking onMark Kettenis
ld.so itself, but also make it easier to debug code that uses dlopen(3). ok deraadt@, matthew@
2012-08-31Since _dl_debug_map is only initialized if we see a DT_DEBUG tag, make sureMark Kettenis
it isn't NULL before we dereference it. Fixes perl PIE on hppa. ok matthew@, deraadt@
2012-08-28Add __guard_local as a hidden symbol to ld.so, kernel, and everyMatthew Dempsky
executable and DSO (via crtbegin.c/crtbeginS.c). Not used yet, but needed before GCC can start emitting -fstack-protector code that uses them instead of __guard.
2012-08-22Change ld.so and libc to use .openbsd.randomdata on ELF platforms forMatthew Dempsky
initializing their __guard values. For the time being, we're leaving libc's constructor method as a backup to make sure __guard actually gets initialized and to emit syslog warnings when it's not. Not really an ABI change, so no shlib bump... "hold on to your butts" ok deraadt, kettenis
2012-08-20Add support for .openbsd.randomdata sections and PT_OPENBSD_RANDOMIZEMatthew Dempsky
segments to the kernel, ld (2.15), and ld.so. Tested on alpha, amd64, i386, macppc, and sparc64 (thanks naddy, mpi, and okan!). Idea discussed for some time; committing now for further testing. ok deraadt
2012-08-17Fix mips64 and powerpc's ld.so syscall implementations by addingMatthew Dempsky
"memory" to the list of clobbered registers for all syscalls that accept a pointer. This prevents GCC from optimizing away memory loads and stores that otherwise appear unused in a function. Issue noted and identified by miod; fix by me. ok miod, mpi
2012-08-07Factor out a _dl_randombuf() method from _dl_random().Matthew Dempsky
2012-07-21Add a new mmap(2) flag __MAP_NOREMAP for use with MAP_FIXED toMatthew Dempsky
indicate that the kernel should fail with MAP_FAILED if the specified address is not currently available instead of unmapping it. Change ld.so on i386 to make use of __MAP_NOREMAP to improve reliability. __MAP_NOREMAP diff by guenther based on an earlier diff by Ariane; ld.so bits by guenther and me bulk build stress testing of earlier diffs by sthen ok deraadt; committing now for further testing
2012-07-06Fix LD_DEBUG=1 regression introduced by previous commit.Matthew Dempsky
ok kurt
2012-06-20With MP rthread setups, we cannot remove the X permission from the GOTTheo de Raadt
entry momentarily, because another thread might attempt lazy resolve. ok matthew guenther
2012-06-14Add support for DF_1_NOOPEN. Based on an origional diff from matthew@.Mark Kettenis
ok matthew@
2012-06-12Fix loaded object sod matching: when we load libfoo.so.X.Y intoMatthew Dempsky
memory, we should be able to match other requests for libfoo.so.X.Z against that same object. ok kurt, kettenis
2012-05-08Refuse to load ELF objects that contain a PT_TLS program header.Joel Sing
Otherwise the binary assumes that the requested TLS storage has been allocated and will happily use it, resulting in unwanted memory corruption. ok guenther@
2012-03-21Switch ld.so's _dl_opendir functions to use a locally definedMatthew Dempsky
_dl_dirdesc struct (containing just the fields ld.so's implementation actually needs) instead of reusing libc's _dirdesc struct. Also, switch ldconfig to use futimens() instead of futimes(). ok deraadt@
2012-01-09Don't mmap 0 byte areas, treat them as a noop instead.Ariane van der Steldt
ok miod@
2012-01-08Since PIE executables on mips64 don't have DT_MIPS_RLD_MAP, fall back onMark Kettenis
using DT_DEBUG if DT_MIPS_RLD_MAP isn't there. This requires us to make .dynamic temporarily writable. Fixes debugging of PIE execuables with gdb(1). ok miod@
2011-12-03Remove an OpenBSD-specific tweak regarding .Xr spacingIngo Schwarze
and make it compatible with bsd.lv mandoc and with groff-1.21. This tweak was originally added for compatibility with groff-1.15, which is no longer needed. ok jmc@ kristaps@
2011-11-28Add support for getting some flags from DT_FLAGS_1: new flagsPhilip Guenthe
DF_1_NODELETE and DF_1_INITFIRST, as well as DF_1_NOW and DF_1_GLOBAL. Committing for kurt@ who worked out the final version; ok guenther@ drahn@
2011-11-19Build ld.so on alpha with -mbuild-constants, so large integerChristian Weisgerber
constants are constructed with several instructions rather than loaded from the data segment, avoiding relocations. This fixes ld.so with gcc4. From miod@, ok jsg@
2011-07-23Properly align the stack early on in the ld.so startup code such that code runMark Kettenis
from .init that uses SSE doesn't randomly trigger SIGBUS. ok drahn@, miod@
2011-07-14__opendir2, DTF_NODUP, and __DTF_READALL can die. struct direntTheo de Raadt
dd_flags is renamed to the placeholder position dd_unused so that we can spot "broken software" which assumes we have Jan Simon Pendry's union mounts (we don't have them, and won't have them ever again). __opendir2 question spotted by matthew verified to not break ports by sthen
2011-07-13Delete items on grpreflist when walking them to decrement the count,Dale Rahn
otherwise double decrement can occur. ok kurt@ timeout on other reviewers.
2011-07-04Add ld.so ia64 support.Paul Irofti
2011-06-27Backout the dynamic linker speed improvement diff for now, it stillStuart Henderson
has some issues. Discussed with various, ok drahn@
2011-05-26No need to call _dl_newsymsearch() twice; ok drahn@Otto Moerbeek
2011-05-22Dynamic linker speed improvement diff. tested by several sinc k2k11.Dale Rahn
get it in tree now deraadt@, ok by several ports folks. Thanks for the testing.
2011-05-10Fix previous. On i386, library.c isn't compiledOtto Moerbeek
2011-05-09Outsmart gcc4 on mips* by moving the declaration of _dl_debug_stateOtto Moerbeek
outside the file the call is in. Since the function is empty, gcc optmizes the call away, breaking the gdb hook needed to resolve symbols in lazy bound shared libs. Analysis by kettenis@; ok miod@ kettenis@
2011-04-29-x is currently unimplemented, so comment it out from the man page, and removeJason McIntyre
it from usage(); if any developer wants to confirm that it will never be an option, let me know and i'll zap the text entirely; this is one half of a diff from Amit Kulkarni - i won;t be touching the other half;
2011-04-08Do not use NULL in integer comparison.Theo de Raadt
2011-04-06Avoid using NULL in non-pointer contexts: use 0 for integer values and '\0'Miod Vallat
for chars.
2011-03-12excessive / at the end of a .PATH; ok guenther drahnTheo de Raadt
2010-12-13rename() is the atomic operation, unlink() is just there to createMarc Espie
races between ldconfig and ld.so (simple commit, hours of bug hunt...) okay kettenis@, deraad@, miod@
2010-12-12Allocate a full C compiler-style stack frame that includes space for 6Mark Kettenis
extended word argument slots required by the ABI. 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@, drahn@