summaryrefslogtreecommitdiff
path: root/ldso/ldso/dl-elf.c
AgeCommit message (Collapse)Author
2005-11-20fix up ifdef checks so dl_iterate_phdr is defined in all the proper objectsMike Frysinger
2005-11-06Do not set the RELOCS_DONE flag until it is actually done. This order ↵"Steven J. Hill"
matters for NPTL libpthreads to work. Well, that was a nice waste of 3 hours.
2005-10-29Hopefully fix the bug Oleg reported in ↵Joakim Tjernlund
http://uclibc.org/lists/uclibc/2005-October/012809.html This will only fix powerpc. Should be easy to fix the other arches.
2005-09-17Fix bug 430 and reduce ldso size with 1KB :). Not sure if I need to use ↵Joakim Tjernlund
fstat64, but I am sure someone will tell me.
2005-08-29some fixes by anemo in Bug 9 to play nicely with 32 or 64 bit hostsMike Frysinger
2005-07-11use the debug dprint macros to clean up readabilityMike Frysinger
2005-07-11use the debug dprint macros to clean up readabilityMike Frysinger
2005-07-11declare reloc_addr as ElfW(Addr) instead of Word since it is an Addr, not a ↵Mike Frysinger
Word (and it will truncate addresses on 64bit hosts)
2005-07-09make sure we use long instead of int so we dont truncate 64bit valuesMike Frysinger
2005-07-07make RUNPATH/RPATH support configurableMike Frysinger
2005-06-30change all Elf32_* usage to ElfW(*) usage since we shouldnt care about the ↵Mike Frysinger
bitsize
2005-06-25move _dl_if_debug_dprint() to shared ldso headerMike Frysinger
2005-06-25rework the debug _dl_dprintf usage to avoid #ifdef macros and make more readableMike Frysinger
2005-06-01Initial support for both RUNPATH support.Joakim Tjernlund
RPATH sematics changed to match RUNPATH. Only difference is that RPATH is searched before LD_LIBRARY_PATH and RUNPATH after. This is not complete but better than the current mess(I think).
2005-05-31Fix bug 60Joakim Tjernlund
2005-04-23Cleanup library loading.Joakim Tjernlund
2005-03-29Moved the addition of load address from the fast pathJoakim Tjernlund
where possible. This will also make ldso smaller. However the patch touches all archs and I have only tested PPC and x86.
2005-03-14Generalize optimized relative reloc procesing.Joakim Tjernlund
Add elf_machine_dynamic() and elf_machine_load_address() for all archs. elf_machine_dynamic() replaces the #ifdef mess to get at the GOT. elf_machine_load_address() is needed to execute ldso directly, this is not complete yet. I probably broke one or two archs(only tested PPC) so please try and report problems. For a report to be useful you need to enable __SUPPORT_LD_DEBUG_EARLY__ and __SUPPORT_LD_DEBUG__
2005-01-05fix eriks e-mail addressMike Frysinger
2004-11-02- Remove dynamic_size from struct elf_resolve.Joakim Tjernlund
- Replace all open coded dynamic handling with a function. Reduces size. - Fold special MIPS dynamic code into the dynamic_info item. - Add RELRO support. - Support linking with "-z now". - prepare for DT_RELACOUNT/DT_RELCOUNT optimization. - Add -z now to ld.so linking, this is what ld.so does anyway so let the linker know that.
2004-10-11Undo previous change. Leave SUID programs alone until I know what to doJoakim Tjernlund
with them.
2004-10-11Don't use ld.so.cache for SUID programs.Joakim Tjernlund
2004-10-07Remove usage of _dl_parse_copy_information() from generic code.Joakim Tjernlund
Remove definition of _dl_parse_copy_information() for powerpc. Remaining archs can do the same. Make debugging output of "relocation processing: xxx" a bit more sane.
2004-10-06Don't complain if ld.so.cache is missing.Joakim Tjernlund
2004-10-06Puts common defines into dl-defs.h (in ldso/include) from dl-elf.h andJoakim Tjernlund
dl-cache.h and make use of it. Also disables the lib-path-redundancy check for the case the cache is not used. Makes use of _PRELOAD_FILE_SUPPORT. From Peter Mazinger.
2004-10-06Remove unneeded -D<somedefine>, and use instead #ifdef __somedefine__Joakim Tjernlund
From Peter Mazinger.
2004-10-03This patch from Mike Frysinger, extended from an earlier patch from Peter S.Eric Andersen
Mazinger implements the changes suggested by me on the uclibc list. On Tuesday 28 September 2004 02:24 pm, Erik Andersen wrote: > What I think should be done is > > *) Someone that cares about USE_CACHE should fix that option > up to be sure it works, and give it a proper config entry > in extra/Configs/Config.in, and rename it to something > more appropriate such as LDSO_CACHE_SUPPORT. > > *) When LDSO_CACHE_SUPPORT=n, UCLIBC_RUNTIME_PREFIX /usr/X11R6/lib > should be included in the default library search path in > dl-elf.c, ldd, and ldconfig. > > *) When LDSO_CACHE_SUPPORT=y, UCLIBC_RUNTIME_PREFIX /usr/X11R6/lib > should be excluded from the default library search path in > dl-elf.c, ldd, and ldconfig, and those wishing to include > X11 stuff should add that into /etc/ld.so.conf and re-run > ldconfig. > > *) At present, LDSO_CONF and LDSO_CACHE use the same names > and same structure as glibc. This precludes > LDSO_CACHE_SUPPORT being uses in any sane fashion on a > dial glibc and uClibc system. Just as it was necessary > for use to use a different name for 'libuClibc' rather > than 'libc', and 'ld-uClibc.so.0' rather than > 'ld-linux.so.2' it seems that these configuration files > really ought to be given different names. >
2004-09-28Remove /usr/X11R6/lib from search path.Joakim Tjernlund
Search in UCLIBC_RUNTIME_PREFIX"lib" before UCLIBC_RUNTIME_PREFIX"usr/lib". X11 users should enable USE_CACHE in Rules.mak, add /usr/X11R6/lib to /etc/ld.so.conf and run ldconfig.
2004-09-17Added back dl_iterate_phdr in ldso(with some small changes).Joakim Tjernlund
Someone needs to test if it works to build and run gcj.
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-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-10Mike Frysinger writes:Joakim Tjernlund
i was sticking some libraries in non-standard (i.e. not-hardcoded) paths and then updating ld.so.conf accordingly ... oddly though, i couldnt get binaries that linked against those libraries to run ... `ldconfig -v` showed the required libraries being detected/cached, so something seemed wrong ... turns out the libraries were being tagged as LIB_ELF_LIBC0 in the cache and the loader currently only accepts LIB_ELF_LIBC{5,6} ... since readsoname.c in ldconfig defines needed_tab with the mapping 'libc.so.0' -> LIB_ELF_LIBC0 it seems like the loader should accept this type too find attached a small patch which adds LIB_ELF_LIBC0 along side LIB_ELF_LIBC{5,6} as an accepted lib type in the loader when dealing with the ld.so.cache file
2004-08-06Joakim Tjernlund writes:Eric Andersen
PPC32, SPARC32/64 and S390 includes the PLT in its RELA size. This caused ldso to always do unlazy relocation of the JMPRELs. This patch fixes it.
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-16Revert this stuff for nowEric Andersen
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-06-12Jakub Bogusz from pld-linux dot org writes:Eric Andersen
Hello, I managed to get ldso (and thus shared linking to uClibc) to work on sparc (actually sparc64 kernel with 32-bit userspace), at least on simple "hello world" program (more complex ones not tested). Some notes on attached patch (against 0.9.26, would require some work to apply on current CVS - but I tested 0.9.26, not CVS): - ELF magic cannot be examined by _dl_strncmp so early, probably because of string constant, like on ppc/mips/sh (note that early SEND_STDERR still crashes when trying to do _dl_strlen - I suppose that string constants require relocation; but adding load_addr didn't help, just ELF header was displayed instead of crash) - mmap() is syscall6 like on ppc/mips/sh, not old i386 mmap() - for generic sparc (i.e. not sparcv8/sparcv9) gcc produces .udiv/.urem calls for unsigned integer / and % operators - so these operations must be avoided. I copied do_rem definition from arm header. But / and % are used also in _dl_simple_ltoa() and _dl_simple_ltoahex(); in ltoahex gcc optimizes it to shifts (but I think it's safer to use shifts explicitly, not rely on optimization...). I changed % in ltoa to do_rem, but as there was no do_div definition, I changed all "%d" specifiers to "%x" to avoid crashes (this changes wouldn't be needed if _dl_simple_ltoa() were fixed to not use division on sparc). - "#define SOLARIS_COMPATIBLE" in ld_sysdep.h broke ldso on Linux because of redefining _dl_linux_resolve only in some places (it was still referenced in INIT_GOT before redefinition). So _dl_linux_resolve redefinition should be moved before INIT_GOT definition or removed. - sparc64 kernel requires mmap() addresses to be aligned to 8192, not 4096, otherwise mmap() call failed - reloc_entry must be shifted by 10, not 12 (I found similar operation in glibc sources) Aside of sparc-specific fixes: - I moved some _dl_dprintf()s inside if(_dl_debug_*) conditions (to avoid debugging messages when LD_DEBUG is not defined) - it seems that there was possible off-by-one in ltoa and ltoahex? they are called with char[22] as 1st argument, and then '\0' is stored in local[22] (_before_ p decrementation)... or am I missing something? If not, fix is included in patch.
2004-05-11make certain that getpagesize() returns correct the value for mipsEric Andersen
by extracting the value from the ELF header.
2004-03-18Look in /usr/X11R6/lib as wellEric Andersen
2004-02-17When doing _dl_mmap to obtain a bit of anonymous memory, use a much moreEric Andersen
sensible -1 fd, rather than pretending to work off of fd 0, which makes absolutely no sense.
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-10oops, manditory forgotten patchEric 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-07Step one, begin shuffling things around a bitEric Andersen
2004-02-07Use unsigned char * pointersEric Andersen
2004-02-06Remove trailing whitespaceEric Andersen
2004-02-04Use a static const char array for static stringsEric Andersen