summaryrefslogtreecommitdiff
path: root/libexec/ld.so/dlfcn.c
AgeCommit message (Collapse)Author
2008-06-13Completing the executable elf_object_t data exposed a bug inKurt Miller
dl_iterate_phdr(3) which was returning the load base not the object base. Problem noted in the misc/exceptions regress by David Krause. okay drahn@
2008-05-05Constantly fill in the program header pointer and count in elf_object_tKurt Miller
for all objects which simplifies phdr usage in a few places. "go for it" drahn@
2008-04-09Improve support for shared libs linked at non-zero addreses:Kurt Miller
- rename private values in struct elf_object to better describe their meaning: s/load_offs/obj_base/ "object's address '0' base" s/load_addr/load_base/ "The base address of the loadable segments" - gdb needs the obj_base value so swap positions with load_base in struct elf_object - fix a few occurrences of where load_base was used instead of obj_base. With help and okay drahn@
2007-11-27Fix dlsym w/special handles when called from an executable that has beenKurt Miller
linked without -E. dlsym issues reported by Pedro Martelletto <pedro at ambientworks.net>. okay tedu@
2007-05-29based on a diff from Matt Provost: allow printing of ldd informationJason Wright
on libraries themselves. Works by setting up the debugging flags then calling dlopen() to do the heavy lifting. ok drahn
2007-05-05Provide hook so that rthreads can provide a spinlock to protect from racesDale Rahn
in lazy binding. ok art@, kurt@
2007-04-03add support for LD_TRACE_LOADED_OBJECTS_{FMT1/FMT2/PROGNAME}. FunctionalityJason Wright
matches and expands on the old a.out ld.so formatting. ok drahn
2006-05-08de-spaceTheo de Raadt
2006-05-03Keep the state of the debugger constistant, let it know a the dynamicDale Rahn
linker is adding or removing a library before it does the act. Discussed with kurt@ some time ago.
2005-11-09the handle returned by dlopen(0,...) should behave the same asKurt Miller
RTLD_DEFAULT, so return RTLD_DEFAULT for handle. ok drahn@
2005-10-18This is too useful for debugging to not have in the tree, howeverDale Rahn
the interface may change at any time, so dont depend on it. (ie regress)
2005-10-16Consolidate dl_boot and dlopen dep lib loading into new functionKurt Miller
_dl_load_dep_libs. Now both dl_boot and dlopen will randomize dep lib loading, where previously only dl_boot did.
2005-10-12Split grpsym_list creation away from child_list creation and changeKurt Miller
grpsym_list order to match Sun's docs. Also corrects bugs where grpsym_list was either not created or partially created.
2005-10-10set _dl_loading_object to NULL upon entering and exiting _dl_boot andKurt Miller
dlopen and cleanup of related redundant code. looks fine drahn@
2005-10-09introduce object ref count macros (suggested by dale). no functionalKurt Miller
change.
2005-10-07rename dload_list to grpsym_list which better represents its usage.Kurt Miller
2005-10-06remove dep_next "shadow object" dead code.Kurt Miller
2005-10-06separate load group references from dep lib child/dload lists. move loadKurt Miller
group refs to own per object ref counter (grprefcount) and list (grpref_list). corrects more complex load group ref cases and side effects from initial implementation. design ideas and ok drahn@
2005-10-05move opencount increment and dups check to _dl_link_dlopen. fixes cleanupKurt Miller
of partially dlopened (but failed) cleanup.
2005-10-03check opencount after handle has been verified to avoid a possible useKurt Miller
after free.
2005-10-03protect against errant programs that attempt to dlclose a handle that isKurt Miller
already closed (but still around due to refs).
2005-10-03refcount corrections: count common dep libs once and centralize dep libKurt Miller
refcount increments to _dl_link_sub. adjust _dl_notify_unload_shlib to match new refcount method. ok drahn@
2005-10-01handle references to load groups caused by dlopen()ing of depenantDale Rahn
members of the load group. work by kurt@ and myself
2005-09-28keep a state flag if a library has been unloaded, and then free the listDale Rahn
seperately ok kurt@
2005-09-28keep track of opencounts for dlopened objects, so that theyDale Rahn
get unloaded the right number of times on exit.
2005-09-28use the calling object's handle for dlsym(RTLD_DEFAULT,...). makes symbolsKurt Miller
in the calling object's load group visable.
2005-09-22Track if symbols are searched but missing while resolving GOT, ifDale Rahn
any are missing exit instead of later causing an abort, ok kurt@
2005-09-21Fix bug if object search is not the object where dlsym() finds an object.Dale Rahn
2005-09-19don't promote DT_NEEDED libs to RTLD_GLOBAL by default when dlopeningKurt Miller
libs. okay drahn@
2005-09-17Cleanly handle the case where a dynamic object is opened, but one of it'sDale Rahn
dependant libraries is missing. return NULL for a handle instead of causing the program to exit.
2005-09-16Rework symbol lookup to more closely match sun's documentation, nowDale Rahn
treats dlopens as load groups. ok kurt@
2005-09-13Only return a _dl_md_plabel() if the object is a function, do not indirectDale Rahn
a data reference. sigh.
2005-05-23fixes for dlclose, ok kettenis@Dale Rahn
2005-05-10Recommit the destructor order fix, now that the amd64 bug was fixed.Dale Rahn
'no problem' pval@
2005-04-06backout -- breaks at least amd64; spotted by marcTheo de Raadt
2005-04-05Do a better job of running destructors in the right order.Dale Rahn
2005-03-08Do not shadow a parameter with a local variable. also add a debug statementDale Rahn
to print dependandant libraries loaded by dlopen ok kurt@
2005-03-07Fix bug not calling callback for the main executable object.Mark Kettenis
ok drahn@, espie@
2004-12-01fix dlsym(RTLD_NEXT,...) when called from the last shared objectKurt Miller
loaded. ok drahn@
2004-10-14Add dl_iterate_phdr() support.Mark Kettenis
ok drahn@, millert@
2004-08-13Cast to Elf_Addr to remove warnings of ELF types(int)/pointer, ok david@Dale Rahn
2004-08-11add dladdr() support and add some 'standard' dlsym() support.Dale Rahn
ok millert miod pval, grumble deraadt
2004-06-07fixup the dlsym() return to produce a callable address (plabel) and move one ↵Michael Shalayeff
comment closer to the code it talks about earlier; drahn@ ok
2004-06-07debugging notify that dlopen() has finished as it was said when it had ↵Michael Shalayeff
started; drahn@ ok
2004-05-25return object* the symbol is in for _dl_find_symbol*; drahn@ okMichael Shalayeff
2004-05-25spacingTheo de Raadt
2004-05-22Dont print symcache statistics if no symbol lookups have occurred, ok mickey@Dale Rahn
2003-10-01Add break statements in switch missing from revision 1.32.Todd C. Miller
2003-09-25dlerror(3) should clear _dl_errno; based on a patch from Bjorn Sandell.Todd C. Miller
Closes PR 3441; drahn@ OK
2003-09-04Symbol cache for GOT lookup. When a symbol is found it is saved in a cacheDale Rahn
for future lookups in the same GOT relocation table. Uses static buffer for small symbol tables, mmap for larger ones. ok deraadt@