summaryrefslogtreecommitdiff
path: root/ldso/ldso/mips
AgeCommit message (Collapse)Author
11 daysGeneralize vDSO code.Dmitry Chestnykh
- Add macroses for vDSO functions names because in some architectures these names differ from the default ones. - Add header guards in dl-syscalls.h . Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
11 daysFix vDSO support for all supported architectures.Dmitry Chestnykh
- Cleanup dl-vdso.c code. - Pass `void *` as first arg to `load_vdso()`, using 32-bit type is completely wrong on 64bit architectures. - Split libc code and vDSO-related code. Move arch-specific implementations into separate files. The performance improvement is for example 50-60 times on ARMv7 and about 4 times on x86_64. Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
2022-09-07Added support for creation of Static Position-Independent Executables (PIE) ↵linted
on mips Updated config to allow compilation of rcrt1.o for mips and modified it's crt1.S to perform relocates in __start. The mips architecture performs relocations differently then most other architectures. reloc_static_pie was rewritten, taking code from dl-startup.c, in order to perfrom the additional relocations. Modifications were made to mips' dl-startup.h to allow for the use of contained macros without including _start definition. Signed-off-by: linted <linted@users.noreply.github.com>
2017-06-21remove editor hints for viWaldemar Brodkorb
2017-01-14ldso: do not resolve relocations for debug, dig them up when debuggingWaldemar Brodkorb
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
2017-01-05ld.so: fix mips{32,64}r6 supportWaldemar Brodkorb
Signed-off-by: Matthew Fortune <Matthew.Fortune@imgtec.com>
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>
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: Add remaining relocation types to the tableGregory Fong
The table format is thrown off a bit because some of these names are too long to fit the previous format so they were put on their own lines. Signed-off-by: Gregory Fong <gregory.0xf0@gmail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
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-06-15mips/README: fix comment about file from which functions were copiedPeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-03-29ldso: mark _start hiddenMike Frysinger
There's no need to export this symbol, so mark them all hidden. Signed-off-by: Mike Frysinger <vapier@gentoo.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>
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-10-06ldso: merge duplicate dl-syscalls.h code to common headerMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-10-01ldso: constify reloc array itselfMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
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-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-02-03Merge remote branch 'origin/master' into prelinkCarmelo Amoroso
* origin/master: arm: fix the static link problem for ARM due to undefined __tls_get_addr nios2: Name architecture correctly in endian.h header nptl/mips64: Fix build when using mips64 and ABIs other than o32 mips: avoid segmentation fault when RLD_MAP is 0 libc: fix linker script generation for libubacktrace.so stdio: fix diagnostic message 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>
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-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-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-03-05Use __always_inline instead of __inline__Carmelo Amoroso
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>
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>
2009-01-04ldso/ldso/dl-startup.c: make _dl_elf_main static; remove one dead variable.Denis Vlasenko
ldso/ldso/avr32/dl-startup.h: remove superfluous definition of START() macro. ldso/ldso/*/dl-startup.h: fix a typo in comment text data bss dec hex filename - 16752 244 92 17088 42c0 lib/ld-uClibc.so + 16709 240 92 17041 4291 lib/ld-uClibc.so
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-07-23- fix asm and volatile keywordsBernhard 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.
2007-02-13use /*...*/ comments rather than #... so we can preprocessMike Frysinger