summaryrefslogtreecommitdiff
path: root/libexec/ld.so
AgeCommit message (Collapse)Author
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@
2010-12-07Make the preload error distinct from the normal error.Dale Rahn
ok espie@
2010-11-16Fix error message when ld.so ends up loading a different than expectedDale Rahn
library, but other library needs the one loaded. mostly ok kurt@
2010-10-30fix a 10 year old bug in the memory allocator, which affected only sparc.Theo de Raadt
sparc has 4 byte long, but needs 8 byte alignment. recently the DIR struct was changed to contain some off_t, which needs 8 byte alignment. turns out the allocator calculated the bias for alignment, and then subtracted out it's private linkage storage afterwards. on hppa this worked because a 8-byte object can be loaded at a 4-byte boundary; on all other architectures the situation was either 4/4 or 8/8. thanks for a bit of help from drahn
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-10-27repair ;;Theo de Raadt
2010-10-25Search loaded libs first and add support for SONAME matching. ok drahn@Kurt Miller
2010-09-11Fix lazy binding issue by making sure the second argument to _dl_find_symbol()Mark Kettenis
always points to a pointer that is initialized to NULL. Consistently use NULL instead of mixing NULL and 0 to make the pattern more obvious. Fixes nm(1) crashes that happen when you pass it multiple object files on the command line. ok miod@
2010-08-11Make _dl_searchnum signed as originally intended.Dale Rahn
Pointed out by patrick keshish.
2010-07-02Add Makefile.inc for hppa64 to aid in building cross tools.Joel Sing
ok drahn@ kettenis@
2010-07-01When generating grpsym lists, avoid duplicates without searching theDale Rahn
already generated list. Speeds up startup on deeply nested dlopen binaries. ok guenther@, tested by ckuethe@ and ajacoutot@
2010-06-05Argh, revert previous change, for older binutils do not grok the fic() change.Miod Vallat
2010-06-05Explicitely pass a %sr register to fic instructions, instead of realying onMiod Vallat
the assembler to pass %sr0 by default. No binary change. ok kettenis@
2010-05-27Synchronize caches after modifying the data words in the PLT stub to preventMark Kettenis
instructions in the same cache line from being corrupted. ok deraadt@, miod@
2010-05-11Correct the _dl_sigprocmask() stub to take and store signal masksPhilip Guenthe
as 32bit values instead of 64bit values, synchronizing it with the libc stub. gcc4 apparently packs the stack in _dl_bind() more tightly, so this was resulting in the saved rbx register being overwriten. ok drahn@, marco@, NicM@
2010-05-09use _dl_memset() instead of bzero() here. Unbreaks sparc build.Matthieu Herrb
ok kettenis@
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-03Fix breakage from last commit. Bad guenther@, no cookie!Miod Vallat
2010-05-03Make powerpc consistent with the other platforms: SYM_SEARCH_OBJPhilip Guenthe
overrides SYM_DLSYM, so remove the latter ok drahn@, testing krw@
2010-05-02Fix breakage from last commit. Bad guenther@, no cookie!Mark Kettenis
2010-05-02Combine the signal mask handling into _dl_thread_bind_lock(), as it's MI.Philip Guenthe
ok drahn@
2010-05-01bzero a struct to appease gcc4.Jonathan Gray
ok drahn@
2010-04-24Fix handling of more than 32768 PLT entries. Mostly from NetBSD.Mark Kettenis
eyeballed by deraadt@ and drahn@
2010-03-30several missing closedir() callszinovik
regress test run fine with this changes ok deraadt@, drahn@