summaryrefslogtreecommitdiff
path: root/ldso/ldso/mips/dl-sysdep.h
AgeCommit message (Collapse)Author
2017-06-21remove editor hints for viWaldemar Brodkorb
2016-02-21mips64: with n64 ABI mapping failedWaldemar Brodkorb
Booting on Lemote Yeelong with a page size != 4kb ld.so is crashing and failed to load libc.so. Do not hardcode the offset for n64 ABI.
2015-12-23Replace bltzal with lapc for MIPS R6 builds.Steve Ellcey
The R6 version of MIPS does not support the bltzal instruction. This patch changes dl-startup.h and dl-sysdep.h to use lapc on R6 instead. lapc is a new R6 insruction so older systems need to continue to use bltzal in order to load register $31. Signed-off-by: Steve Ellcey <sellcey@imgtec.com>
2011-07-27ldso/mips: Clean up warningsKevin Cernekee
Trivial fixes for these warnings: CC ldso/libdl/libdl.oS In file included from ldso/ldso/ldso.c:46:0: ldso/ldso/mips/elfinterp.c:88:1: warning: no previous prototype for '__dl_runtime_pltresolve' ldso/ldso/ldso.c: In function '_dl_get_ready_to_run': ldso/ldso/ldso.c:475:5: warning: assignment makes pointer from integer without a cast In file included from ldso/ldso/ldso.c:1097:0: ldso/ldso/dl-elf.c: In function '_dl_load_elf_shared_library': ldso/ldso/dl-elf.c:811:3: warning: assignment makes pointer from integer without a cast Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-07-27ldso/mips: dlsym() incorrectly matches undefined symbolsKevin Cernekee
check_match() relies on checking for (sym->st_value == 0) to see if the symbol is undefined. This works reasonably well on most architectures, such as ARM or i386: $ readelf -s /lib32/libcap.so.2 | grep -E "\<malloc\>" 17: 00000000 0 FUNC GLOBAL DEFAULT UND malloc@GLIBC_2.0 (2) However, on MIPS, libbfd puts nonzero data in the st_value field to facilitate resetting the symbol's GOT entry if the library that defines the symbol gets unloaded: $ mipsel-linux-readelf -s libfoo.so | grep -E "\<malloc\>" 74: 00003140 0 FUNC GLOBAL DEFAULT UND malloc This can cause check_match to report a false positive when examining the external symbol reference. Consequently dlsym() will return a bad pointer to the caller. Use the special MIPS logic from glibc-ports-2.13 to avoid this situation. Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-01-29mips: avoid segmentation fault when RLD_MAP is 0Richard Braun
Signed-off-by: Richard Braun <rbraun@sceen.net> Acked-by: Joakim Tjernlund <joakim.tjernlund@transmode.se> Signed-off-by: Khem Raj <raj.khem@gmail.com>
2010-07-19ldso/mips: pltgot should array not address of array to dynamic info.Khem Raj
* This change was introduced in commit 9381d622e2411a35a5fd73a5a573eb269e2dd9c9 which rendered uclibc not booting on mips targets. Restoring it makes it work again. Signed-off-by: Khem Raj <raj.khem@gmail.com>
2010-07-06nptl: fix buildsysBernhard Reutner-Fischer
Now automatically picks the correct (arch and subarch specific) impls in favour of generic impls. make O=/tmp/objs PREFIX=/my/sysroot -j works now as expected (both out-of-tree as well as parallel-safe). 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>
2009-03-05Use __always_inline instead of __inline__Carmelo Amoroso
2009-01-14ldso: performs bootstrap relocations only if required by the arch.Carmelo Amoroso
It is controlled by ARCH_NEEDS_BOOTSTRAP_RELOCS macro. Signed-off-by: Jirka <olsajiri@gmail.com> Acked-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2008-12-22- non-pic support for MIPS (Catherine Moore, clm at codesourcery com)Bernhard Reutner-Fischer
2008-12-03- Use runtime pagesize (Jeremy Kerr)Bernhard Reutner-Fischer
Some powerpc machines can support 64k pages, enabled by the CONFIG_64K_PAGES option in linux. However, the uClibc dynamic loader won't currently work on these machines, as it uses hard-coded values (PAGE_ALIGN, ADDR_ALIGN and OFFS_ALIGN) in the ldso architecture-specific headers. When running on a kernel with 64k pages, ld.so tries to mmap with 4k-aligned addresses, rather than 64k, so mmap fails with -EINVAL. When booting a 64k machine with a uClibc dynamic linker, init fails with: /init:500: can't map '/lib/libc.so.0' /init:500: can't map '/lib/libc.so.0' /init:500: can't map '/lib/libc.so.0' /init: can't load library 'libc.so.0' Kernel panic - not syncing: Attempted to kill init! This change allows ld.so determine these alignment masks at runtime, rather than compile-time. Since we have the _dl_pagesize variable available, we can use that to generate the appropriate masks. Since almost all of the architectures can use the common definitions for the _ALIGN macros, we can consolidate them all in ldso.h, and override in the sysdep headers where necessary (ie, mips). This allows me to start a uClibc-based root fs on a 64k machine. Signed-off-by: Jeremy Kerr <jk at ozlabs org>
2008-09-15- commentary typo fixBernhard Reutner-Fischer
2008-07-23- fix inline keywordBernhard Reutner-Fischer
2008-04-24- fixup asm. No object-code changesBernhard Reutner-Fischer
2007-02-17Make _dl_malloc alignment arch configurable.Joakim Tjernlund
From Atsushi Nemoto.
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-03-08macro out the /10 operation so arches can have their own versions ... and ↵Mike Frysinger
create some default macros for do_rem/do_div_10 so we dont duplicate the samething in many arch header files
2006-01-29rename local i var to idx to get rid of shadow warningMike 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-14Make mips at least compileEric Andersen
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__
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-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-09-23Make do_rem() safe. From Peter Kjellerstedt.Joakim Tjernlund
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-06-19Joakim Tjernlund writes:Eric Andersen
Since MIPS don't have COPY relocs it seems apropiate to define DL_NO_COPY_RELOCS. This will optimize dl_find_hash somewhat.
2004-02-17Seperate out the startup stuff from the non-startup stuff.Eric Andersen
Begin converting some big ugly macros to inline functions instead
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 ...
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.
2002-05-28Patch from Tobias Anderberg <tobias.anderberg@axis.com> to abstractEric Andersen
out page alignment issues. As we we were assuming 4k pages, which need not be the case...
2002-05-20Fixed MIPS dynamic linker by removing link order dependency bug."Steven J. Hill"
2002-05-09Another mips patch from Steven J. Hill:Eric Andersen
Uh, this patch fixes a few bugs that I overlooked. Shoot, even BusyBox wouldn't work until these are applied. Erik, plop this into CVS please. Thanks.
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-04-02Steven J. Hill's latest mips dynamic loader updatesEric Andersen
2002-03-19Initial mips ldso porting effort from Steven J. Hill. Not yetEric Andersen
complete, but off to a fine start.