summaryrefslogtreecommitdiff
path: root/ldso/ldso/i386/elfinterp.c
AgeCommit message (Collapse)Author
2017-06-21remove the not useful disclaimerWaldemar Brodkorb
2017-01-14ldso: do not resolve relocations for debug, dig them up when debuggingWaldemar Brodkorb
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
2012-03-25ldso: use ELF_xxx()/ElfW() helpersMike Frysinger
They expand into the same code, but using the ELF_xxx()/ElfW() macros makes it much easier to spot similarities between code bases. Acked-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Acked-by: Carmelo Amoroso <carmelo.amoroso@st.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-10-14ldso: silence harmless warning for !LDSO_PRELINK_SUPPORTBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-04-06Merge remote-tracking branch 'origin/master' into prelinkCarmelo Amoroso
* origin/master: (137 commits) utils/ldd: Check for returned pointer from strrchr not the value it holds cris: add provide arch-specific vfork implementation lutimes.c, stubs.c: fix compiling lutimes, if __NR_utimensat is not defined bump version to 0.9.32-rc3-git release 0.9.32-rc3 memalign: include sys/param.h for MAX arm/bits/atomic.h: Include common/bit/atomic.h for thumb1 wctype.h: fix libc_hidden_proto for iswupper and add it for iswspace add libc_hidden_proto for wcs[n]casecmp_l really fix missing __libc_drand48_data Revert "missing prototype of __libc_drand48_data fixed" missing prototype of __libc_drand48_data fixed time.c, time.h: remove unused hidden strftime/strptime nanosleep.c: remove duplicated libc_hidden_proto ctype.c, ctype.h: remove commented parts that were banned for removal after 0.9.31 _wctype.c, wctype.h: remove unused isw* and wctype_l hidden functions time.c, wchar.h: remove unused hidden wcsftime str[n]casecmp.c: fix hidden usage remove unused hidden functions frv/memset.S: add missing libc_hidden_def ... Conflicts: ldso/ldso/ldso.c Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-03-03initialize tls_tpnt to NULL on all archsPeter S. Mazinger
Initialize tls_tpnt to NULL on all archs instead of 0. Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
2011-01-21Merge remote branch 'origin/master' into prelinkCarmelo Amoroso
* origin/master: bump version to 0.9.32-rc2-git release 0.9.32-rc2 nptl: Fix __USER_LABEL_PREFIX__ concatenatio nptl: fix start_thread() for _STACK_GROWS_UP ldso: get rid of _dl_lookup_hash Add protected symbols support for all architectures Revert "ldso/arm: Correct protected symbol resolution" Revert "ldso_sh: add support for protected symbols to SH" Revert "ldso/i386: support protected symbols" cris: Fix build issues syslog: fix 'everyone logs with user facility' __psfs_parse_spec: always use long int for %p buildsys: headers target should not depend on sysnum.h buildsys: fix make release target nptl: get rid of the last preprocessor warning when __ASSUME_TGKILL is not defined remove uClibc_ctype.h if !LOCALE Revert "Makefile.in: Add header to 'all' target" nptl: get rid of preprocessor warning when __ASSUME_TGKILL is not defined Conflicts: ldso/include/dl-hash.h ldso/ldso/arm/elfinterp.c ldso/ldso/avr32/elfinterp.c ldso/ldso/bfin/elfinterp.c ldso/ldso/cris/elfinterp.c ldso/ldso/dl-hash.c ldso/ldso/i386/elfinterp.c ldso/ldso/m68k/elfinterp.c ldso/ldso/mips/elfinterp.c ldso/ldso/powerpc/elfinterp.c ldso/ldso/sh/elfinterp.c ldso/ldso/sh64/elfinterp.c ldso/ldso/sparc/elfinterp.c ldso/ldso/x86_64/elfinterp.c ldso/ldso/xtensa/elfinterp.c ldso/libdl/libdl.c Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-01-20Add protected symbols support for all architecturesSalvatore Cro
Protected symbols are global symbols for which interposition is not allowed. We manage them in generic _dl_lookup_hash function. To handle protected symbols we need to get a reference to the module that defines the symbol itself. So we pass a new parameter 'struct symbol_ref' to the __dl_lookup_hash that is defined as below: struct symbol_ref { const ElfW(Sym) *sym; struct elf_resolve *tpnt; }; The tpnt field is used as an ouput parameter and refers to the module which defines the protected symbol. Further it can be used as output parameter for TLS relocations and FDPIC case. The sym field is instead used as an input parameter to detect the visibility of the symbol we are looking-up. In this way we get rid of different signatures for _dl_lookup_hash, allowing to remove the _dl_find_hash wrapper. This new structure is also suitable for prelink integration. Signed-off-by: Salvatore Cro <salvatore.cro@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-01-20Revert "ldso/i386: support protected symbols"Carmelo Amoroso
This reverts commit ba38f0cec27b91cc7c605417ad047c4dc77d732f. The generic implementation will cover all the architectures handling the protected symbols in _dl_lookup_hash [ldso/ldso/dl-hash.c] Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2010-10-11ldso: Extend prelink support for all other achitecturesFilippo Arcidiacono
Update Arch specific part of the dynamic linker to the latest cahnges required by prelink: - Use _dl_loaded_modules->scope as global symbol scope - Pass the sym argument (or NULL) to the _dl_find_hash - Update _dl_parse, _dl_do_reloc, _dl_do_lazy_reloc and _dl_parse_relocation_information to reflect the change of the scope argument's type - Add the call to _dl_debug_lookup used for trace prelinking. Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2010-04-16ldso/i386: support protected symbolsJoakim Tjernlund
Make sure protected symbols are not overridden by other modules. Signed-off-by: Joakim Tjernlund <joakim.tjernlund@transmode.se> Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2010-04-12silence warning about undefined preprocessor tokenBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-11-15ldso: Add missing newlines to some debug messagesBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-09-26ldso/: tls support for dynamic linkerAustin Foxley
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2009-01-28Remove check for the relocation type check in the resolver,Carmelo Amoroso
from all archs. Signed-off-by: Jiri Olsa <olsajiri@gmail.com>
2005-11-21Partly undo earlier patch on vapier's requestPeter S. Mazinger
2005-11-21Guard debug_sym/debug_reloc, make sure elfinterp.c sees __SUPPORT_LD_DEBUG__Peter S. Mazinger
2005-11-02Don't need this debug check anymore.Joakim Tjernlund
2005-11-02psm missed a spot :)Joakim Tjernlund
2005-11-02ldso powerpc changes ported to i386Peter S. Mazinger
2005-07-07rip out all the duplicated debug code and move into a shared fileMike Frysinger
2005-06-03tweak whitespace to minimize diffs between i386/m68kMike Frysinger
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.
2004-11-10Add RTLD_LOCAL support for dlopened libs. Reported byJoakim Tjernlund
Andrew de Quincey, who has been most helpful getting this sorted out, thanks. Thanks also to Peter Mazinger who did alot of testing. Removed all traces of dl_parse_copy_information() since it is no longer used.
2004-09-23White space and printouts cleanup. From Peter Kjellerstedt.Joakim Tjernlund
2004-09-17Formatting cleanups from Peter Kellerstedt.Joakim Tjernlund
2004-09-17Don't allow undefined global symbols to pass(all archs needs fixing,Joakim Tjernlund
but powerpc). If you are using buildroot and soft floating point, you may have to rebuild the libm.so library, copy it to staging_dir/lib and rebuild your application. Move handling of R_386_COPY back into _dl_do_reloc(all archs should do this). Adjust the first argument to _dl_memcpy as it looks wrong to have symtab[symtab_index].st_value as destination for the mem copy.
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-06-27Joakim Tjernlund writes:Eric Andersen
Hi yet again :) in dl-startup.c when performing boot strap relocation the following test exists to make sure that only "_dl_" symbols are relocated: /* We only do a partial dynamic linking right now. The user is not supposed to define any symbols that start with a '_dl', so we can do this with confidence. */ if (!symname || !_dl_symbol(symname)) { continue; } However on PPC(and the other archs as well I suspect) all symbols are "_dl_" symbols so the test is never true. The test can be removed and the whole loop simplified(smaller). This also makes it possible to simplify elfinterp.c This remove the scanning of ldso.so relocs, making relocation faster. I have tested this on PPC and it works well. Do you think this optimization will work for the other arches as well? I can't see why not. Jocke * Tested on x86, arm, mipsel, and powerpc by Erik and works nicely -Erik
2004-02-14Give gcc branch prediction some hits on obviously unlikely branchesEric 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-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-01-29Modify interfaces for _dl_parse_relocation_information()Eric Andersen
_dl_parse_lazy_relocation_information() and _dl_parse_copy_information() so they are all consistant, allowing for future consolidation. Trim some trailing whitespace as well.
2003-11-06Revert change 1.26, which breaks everything. :-(Eric Andersen
2003-11-05tiny cleanupEric Andersen
2003-08-19More routine cleanupEric Andersen
2003-08-19Cool. Found most of the problem. Turns out we were inadvertanly loading someEric Andersen
libraries multiple times, wasting memory and causing different libraries to use different symbol sets, some of which were not properly resolved. Continue scrubbing ld.so and converting it to use proper types.
2003-06-27oopsEric Andersen
2003-06-27whitespace and debug updatesEric Andersen
2002-11-05Massive scrubbing of the shared lib loader error handling.Eric Andersen
Move all configuration options into the new config system. -Erik
2002-10-01This commit contains a patch from Stefan Allius <allius@atecom.com> to changeEric Andersen
how uClibc handles _init and _fini, allowing shared lib constructors and destructors to initialize things in the correct sequence. Stefan ported the SH architecture. I then ported x86, arm, and mips. x86 and arm are working fine, but I don't think I quite got things correct for mips.
2002-09-12Add missing _dl_dprintf arguments, as noticed by Tero Lyytik�inen ↵Eric Andersen
<tero@paravant.fi>
2002-08-08Patch from Stefan Allius and Edie C. Dost to add SuperHEric Andersen
shared library support. This also adds some cleaner error handling, which I (Erik) then ported over to x86 and arm. In addition Stefan added the following fixes: - in hash.c was the lvalue handling of global library functions wrong. To fix this I had to change the prototype of _dl_find_hash. (==> TIS and ELF spec. Vers. 1.2) - in ldso.c was the order of the .init sections calls wrong. Before we call the initialization code of a library we have to check that all dependend libraries are already initialized. This can easily made by calling it in the revers loading order. For this I added a previous pointer chain. - in ldso.c the ELF magics wasn't checked fo PPC, MIPS and SH architecture
2002-08-08Make some strings constEric Andersen
-Erik
2002-05-02Patch from Steven J. Hill <sjhill@realitydiluted.com>:Eric Andersen
I am very pleased to announce that the MIPS dynamic linker/loader for uClibc is now working. It works on big and little endian platforms. A few minor changes were needed to avoid breaking ldd, and since this makes some non-trivial changes, I have tested on x86, arm, and powerpc to be sure thoese arches didn't get broken. Excellent work Steven!
2002-03-19Add new debug target (disabled by default) so that when debugEric Andersen
is on we now default to resolving symbols permanently.. -Erik
2002-03-08Seperate out the symbol resolution debugging, so it doesn't clutterEric Andersen
things up when we don't care about symbol resolution problems. Make the lib loader always look first in the directory where the shared lib loader was found. -Erik
2002-02-17Fix defines so debugging works as expectedEric Andersen
2002-01-23Fixup build a bit. Be sneaky and include everything intoEric Andersen
a single .c file, making stuff be even smaller.