summaryrefslogtreecommitdiff
path: root/ldso/ldso/mips/elfinterp.c
AgeCommit message (Collapse)Author
2014-12-28relocation fixesWaldemar Brodkorb
From OpenWrt: https://dev.openwrt.org/browser/trunk/toolchain/uClibc/patches-0.9.33.2/613-mips64_more_relocation_fixes.patch
2014-04-23ldso/mips: Remove redundant LD_DEBUG printsGregory Fong
These should have been protected by if (_dl_debug_reloc && _dl_debug_detail) , but since the previous change "ldso/mips: actually print results of each relocation" makes this redundant, just eliminate these prints instead. I think this is the only item that is still printing regardless of the value of LD_DEBUG when uClibc is built with SUPPORT_LD_DEBUG=y. Signed-off-by: Gregory Fong <gregory.0xf0@gmail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-04-23ldso/mips: actually print results of each relocationGregory Fong
The patched line was outside of the body of the loop over relocations and so would only print the results of the last relocation, fix that. Signed-off-by: Gregory Fong <gregory.0xf0@gmail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-12-20Fix for SIGBUS error on MIPS64 with N64 ABIWaldemar Brodkorb
When accessing errno, a per thread variable, from _stdio_init a SIGBUS error happens. This change fixes the wrong relocation and debug output. Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
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>
2012-01-23ldso/mips: fix symbol lookup for JUMP_SLOT and COPY relocationsCarmelo Amoroso
Fill properly the sym_ref fields when invoking _dl_find_hash to lookup symbols Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
2011-10-14ldso: silence harmless warning for !LDSO_PRELINK_SUPPORTBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-05-04Merge remote-tracking branch 'origin/master' into prelinkCarmelo Amoroso
* origin/master: (32 commits) libubacktrace: fix backtrace support on arm-eabi, which needs libgcc_eh linked too getaddrinfo.c: fix incorrect check for ERANGE from gethostbyaddr_r getaddrinfo.c: improve code readability. No functional changes string: remove unused variable x86_64: silence warning if !TLS buildsys: prettify ssp.c handling madvise is LINUX_SPECIFIC test_nptl: fix expected result for tst-cputimer[123] test_nptl: fix expected result for tst-clock2 test buildsys: make $(LOCAL_INSTALL_PATH) phony ether_aton: reject invalid input tests: disable ether tests if !HAS_SOCKET inet: add ether_aton testcase sysconf: clock_getres depends on HAS_REALTIME __rt_sigwaitinfo: depends on HAS_REALTIME buildsys: minor fixes in Makefile.arch for C6X buildsys: minor fixes in Makefile.arch for microblaze libubacktrace: enabled for all archs indeed. sparc: don't access fp registers when configured for no fpu libubacktrace: generic implementation based dwarf ... Conflicts: ldso/ldso/dl-elf.c ldso/ldso/mips/elfinterp.c ldso/ldso/x86_64/elfinterp.c Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-04-18MIPS LDSO: pass sym_ref parameter to _dl_find_hash() to support PROTECTED ↵Maksim Rayskiy
symbols _dl_find_hash() relies on sym_ref parameter to check if the looked-up symbol is protected. The code fixes a case when _dl_perform_mips_global_got_relocations() was calling _dl_find_hash() without providing sym_ref parameter. The bug was causing hangs if a library exporting non-protected symbol was earlier in link order than library with the same symbol declared as protected. Signed-off-by: Maksim Rayskiy <mrayskiy@broadcom.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
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>
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-06-02ldso/mips: Fix relocation parsing so that they work on both mips32/mips64Khem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Rob Landley <rob@landley.net>
2010-04-12silence warning about undefined preprocessor tokenBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-01-25mips/ldso: Check for TLS relocation in elf_machine_type_class.Khem Raj
* Store the symbol adress received from _dl_find_hash and do not recompute it. Signed-off-by: Khem Raj <raj.khem@gmail.com>
2010-01-14mips/nptl: Pass correct parameters to dl_find_hash when resolving TLS ↵Khem Raj
relocations. Make use of macros from sys/asm.h in crt1.S These two changes are needed for mips nptl to boot once again. Signed-off-by: Khem Raj <raj.khem@gmail.com>
2009-10-15ldso: clean up breakage in tls mergeMike Frysinger
The TLS merge 534661b91c9849 introduced multiple style problems as well as random breakage: - missing _dl_free - incomplete parametrization of _dl_lookup_hash - restore FDPIC handling in _dl_lookup_hash Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-10-04mips: fix typo in elfinterp.cAustin Foxley
Signed-off-by: Austin Foxley <austinf@cetoncorp.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>
2008-12-22- non-pic support for MIPS (Catherine Moore, clm at codesourcery com)Bernhard Reutner-Fischer
2006-11-04mips64 patch from Atsushi Nemoto:Eric Andersen
64bit MIPS ELF format tweaks. (from glibc) Elf32/ElfW convertions. asm code adjustments.
2006-06-19eat extraneous ; and insert some whitespace where it belongsMike Frysinger
2006-01-29remove unneeded double reloc_type definitionMike Frysinger
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-07-07rip out all the duplicated debug code and move into a shared fileMike Frysinger
2005-05-01On mips, gdb explicitly looks for the symbol "__dl_runtime_resolve" so changeEric Andersen
the name of our mips resolver function to match gdb's expectations.
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-17Add BIND NOW support to MIPS.Joakim Tjernlund
Mips did not honour the LD_BIND_NOW env. variable or the DT_BIND_NOW flag in the dynamic section.
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-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-08-26Only print debug stuff when askedEric Andersen
2004-08-26Avoid multiple passes to perform mips GOT relocations, and doEric Andersen
the whole lot in a single pass. -Erik
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-25Joakim Tjernlund writes:Eric Andersen
Hi Manuel & Erik I think I know why MIPS is broken. _dl_perform_mips_global_got_relocations() is broken. It will due to my latest changes reloctate ldso. This function needs to die and its job should be done inside _dl_parse_relocation_information(). It is mostly a copy and paste job, Also PERFORM_BOOTSTRAP_GOT and PERFORM_BOOTSTRAP_RELOCATION should be fixed, they use symbols which aren't passed as arguments. Jocke
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-06-19Joakim Tjernlund writes:Eric Andersen
Glibc does not use COPY class for SHN_COMMOM in MIPS. Make uClibc ldso the same.
2004-05-11Bradley D. LaRonde, brad at laronde dot org writes:Eric Andersen
If I change that ELF_RTYPE_CLASS_COPY to ELF_RTYPE_CLASS_PLT to tell _dl_find_hash to ignore stubs when resolving undefined functions without stubs, the dlopen tests all pass. dlopen gets a pointer to the libc.so malloc instead of a pointer to the libpthread malloc stub. Yay! :-)
2004-02-20Patch by Joakim Tjernlund <joakim.tjernlund@lumentis.se>, which gotManuel Novoa III
mips mostly working. From there, I tracked the bash failure to a bad _dl_atexit address and Erik took it from there.
2004-02-14Atsushi Nemoto writes:Eric Andersen
Also, if you are to enable SUPPORT_LD_DEBUG on MIPS, I think this patch is needed too.
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-05Fixup a badly merged updateEric Andersen
-Erik
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-08-22Make the mips ld.so debug noise somewhat useful, and less gratuitouslyEric Andersen
different than all other arches. -Erik
2002-11-05Massive scrubbing of the shared lib loader error handling.Eric Andersen
Move all configuration options into the new config system. -Erik
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