summaryrefslogtreecommitdiff
path: root/ldso/ldso/ldso.c
AgeCommit message (Collapse)Author
2004-10-05Peter Kjellerstedt writes:Joakim Tjernlund
After the addition of a configuration option for enabling the support of /etc/ld.so.cache, I thought it might be a good idea to add one for the support of the /etc/ld.so.preload file too. So here it is. While doing this, I also noticed that the dynamic linker would hang indefinitely if either LD_PRELOAD or /etc/ld.so.preload contained a library which was already loaded, so I made a patch for that too. And of course, I could not resist from doing a little clean up of comments and indentation, so here is a patch for that too.
2004-09-08Second attempt to fix the INIT/FINI order. This time I think I got it right :)Joakim Tjernlund
This needs testing with apps that have complex dependencies.
2004-09-03First attempt to fix the INIT/FINI ordering. Fingers crossed :)Joakim Tjernlund
2004-08-31Dont mess with __curbrk in ldsoEric Andersen
2004-08-27#include "dl-startup.c into ldso.c, making ldso one compilation unit.Joakim Tjernlund
Now all functions and vaiables can be made static to reduce relocs. Basicly, all variables should be merged into one struct variable and then export that struct. Exported functions should be exported as functions pointers in the above struct. This will reduce the number of relocs inside ldso to a handful. Add -Bsymbolic to linker for ldso. This will resolve all functions (all JMP_SLOT goes away) and the remaining relocs are transformed into RELATIVE relocs.
2004-08-27As Mike Frysinger notes, this code is still needed. IJoakim Tjernlund
misread this code and removed it, sorry. I printed the values of _dl_brkp and _dl_envp in ldso and got this when executing: ls: __curbrk: 0x300c16e0 __environ: 0x1008372c ldd: __curbrk: 0x300776e0 __environ: 0x3007759c why is__environ in the app when executing ls but not ldd?
2004-08-26Fixup a couple of warningsEric Andersen
2004-08-26Avoid multiple passes to perform mips GOT relocations, and doEric Andersen
the whole lot in a single pass. -Erik
2004-08-26Let ldso find libc's malloc function and set _dl_malloc_function.Joakim Tjernlund
This removes some crap in libdl.c(and future libs which needs to access ldso functions). What do you think?
2004-08-26Relocations of the application's global GOT entries were not being run, andEric Andersen
only the global GOT entry relocations for the loaded shared libs were being handled. This made applications segfault when using un-fixedup symbols. After many hours debugging to track down the problem, this patch makes the mips port happy again. -Erik
2004-08-25Patch from Stefan Allius:Joakim Tjernlund
Remove unused function parameter in ldso. Remove echo option '-e' since it is not supported on Solaris.
2004-08-25Hopefully fix Laszlo and Jacobs dlopen problem.Joakim Tjernlund
2004-08-19'pagesize' was local to dl-startup.c. In ldso.c we needEric Andersen
to use '_dl_pagesize' -Erik
2004-08-19Remove poor man's malloc. Not needed anymore.Joakim Tjernlund
2004-08-19Move "debug_addr" ptr from dl-startup.c to ldso.cJoakim Tjernlund
2004-08-19Move the app specific stuff from dl-startup.c to ldso.c.Joakim Tjernlund
2004-08-17Let ldso decide if it should relocate itselft a second time. ThisJoakim Tjernlund
is needed if ldso should use libcs malloc whenever possible. Fix RTLD_LAZY propagation to RTLD_NOW relocation when requested by libdl.
2004-08-13Fix usage_count in ldso/libdl.Joakim Tjernlund
Don't' use atexit in libdl. Make destrutor in libdl actually run and to dlclose all dlopened libs. Remove dlclosed libs from the _dl_symbol_tables list.
2004-08-10Revmoved _dl_brkp and _dl_envp. They are not needed anymore.Joakim Tjernlund
2004-08-09This should fix the dlsym problem Peter van Hoyweghen reported.Joakim Tjernlund
However RTLD_LOCAL still doesn't work. Everything is RTLD_GLOBAL.
2004-07-30s/___brk_addr/__curbrk/gEric Andersen
Some utilities, such as valgrind, have a legitimate reason to know the address of the current brk. Since we know such utils will peek under our skirt, we might as well give them what they expect and not use a gratuitously different symbol name. -Erik
2004-07-30Teach libdl to use normal libc symbols whenever possible, i.e. mallocEric Andersen
rather than _dl_malloc, fprintf rather than _dl_printf, etc. -Erik
2004-07-14Sigh. I got things working this morning, then checked stuff in from the wrongEric Andersen
tree. Bad boy, No doughnut. -Erik
2004-07-14Based on a patch from Alexandre Oliva, make sure _dl_malloc returns a nicelyEric Andersen
aligned pointer that may be aligned up to page_size. Also add _dl_free,
2004-05-12Add a local '_dl_errno' to be used by syscalls in ldso, allowingEric Andersen
useful syscall failure diagnostics.
2004-05-11As noticed by the sharp eyed Joakim Tjernlund, I stupidlyEric Andersen
hard coded 4096 instead of PAGE_SIZE. Because I'm an idiot.
2004-05-11make certain that getpagesize() returns correct the value for mipsEric Andersen
by extracting the value from the ELF header.
2004-02-20___brk_addr and __environ are not functions. Finding the brokenEric Andersen
lookup on 'atexit' got me excited and I started fixing the same problem elsewhere. Except these were correct as-was, and were not a problem....
2004-02-20When doing symbol lookups on functionsEric Andersen
2004-02-14Joakim Tjernlund writes:Eric Andersen
Hi it is me again. This is the latest ldso patch. the NEW weak symbol handling works now with a little special handling in _dl_find_hash(). You get to chose if you want the new or old handling :) There was 2 missing _dl_check_if_named_library_is_loaded() calls in _dlopen(). I then disabled the _dl_check_if_named_library_is_loaded() in dl-elf.c since it is rendundant. Question, why does some _dl_linux_resolver(), like i386, have 2 calls to _dl_find_hash()? I think that is wrong, isn't it? I really hope you can check this out soon ...
2004-02-10Eliminate the PIE support option, and simply support that all the timeEric Andersen
2004-02-10Rework file naming, aiming for at least a vague level of consistancyEric Andersen
2004-02-10Fixup the definition of _dl_open, and move some bits back where they were,Eric Andersen
till I properly finish the next step in my evil plan.
2004-02-08Move _dl_printf and _dl_malloc to ldso, which is a more sensibleEric Andersen
location for this stuff
2004-02-08Cleanup whitespace and formattingEric Andersen
2004-02-08Add some permissions when creating the logfileEric Andersen
2004-02-07Remove unneeded forward declarationEric Andersen
2004-02-07Split off the stuff that cannot use function into its own file,Eric Andersen
to make it easier to treat it specially while not bothering the rest of the code with the same constraints.
2004-02-07Step one, begin shuffling things around a bitEric Andersen
2004-02-07Yet more consistancy fixupsEric Andersen
2004-02-07Use unsigned char * pointersEric Andersen
2004-02-01Jakub Bogusz writes:Eric Andersen
Hello, the attached patch fixes ldso compilation on sparc-linux (at least with sparc32 userland). It was made against uClibc 0.9.21, but it's still OK with 0.9.26. There were three problems: - missing __NR_getpid definition - conflicting prototypes in elfinterp.c - syntax error (missing semicolon) in ldso.c With this patch shared libraries and ldso can be built on sparc. It contains also ldso.c syntax fix for m68k - there was the same mistake two lines earlier; but I didn't test build on m68k.
2004-01-29Scrub up use of ELF_USES_RELOCA and eliminte some unsightly ifdefsEric Andersen
2004-01-29Eliminate separate passes for _dl_copy_fixups() and _dl_fixup(), andEric Andersen
do both operations in a single pass.
2004-01-02Peter S. Mazinger writes:Eric Andersen
Hello Erik! I have made some cosmetical changes to the files, removed the added SCRT=-fPIC option from building the crt0.S file (but it is a requirement to build them with -fPIC), and changed some comments. I have left the ldso.c patch with PIE_SUPPORT ifdefs, but consider applying it w/o them (see some earlier comment from PaX Team on this issue, as it is considered a bug). To have it work correctly, you'll also need removing COMPLETELY_PIC. One thing is missing: PIE_SUPPORT should be usable only for i386 (for now). Also added the support for propolice protection (that works for me and catches memcpy/strcpy attacks (but needs a special gcc version). Thanks, Peter
2003-12-17Use PAGE_SIZE rather than hard coding 4096Eric Andersen
2003-12-17Patch from Paul Mundt <lethal@linux-sh.org>:Eric Andersen
For sh64 we need implicit access to the symtab, primarily to get at the ->st_other value. This presently isn't possible, as PERFORM_BOOTSTRAP_RELOC() is invoked as such: PERFORM_BOOTSTRAP_RELOC(rpnt, reloc_addr, symbol_addr, load_addr); while we can easily get the symtab_index value from rpnt->r_info, this still doesn't buy us easy access to the actual table. As such, I've modified PERFORM_BOOTSTRAP_RELOC() to take an additional SYMTAB argument. Most architectures aren't going to care about this, but unfortunately we don't have any other options for sh64. The following patch fixes up the API for what we need for sh64, and updates the other architectures appropriately.
2003-12-05move _dl_fixup so staticly linked apps using dlopen have aEric Andersen
chance of actually working
2003-10-04Fix a stupid bug causing 'ldd' output to not contain the fullEric Andersen
path to the target library
2003-09-19Re-add cris to "define list" when fixing auxvt.Tobias Anderberg