summaryrefslogtreecommitdiff
path: root/ldso/ldso
AgeCommit message (Collapse)Author
2013-11-12ldso: silence warnings in debug codeBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-11-06ldso: fix unused variable warningBaruch Siach
This fixes the following warning when SUPPORT_LD_DEBUG_EARLY is not enabled: ldso/ldso/ldso.c: In function '_dl_get_ready_to_run': ldso/ldso/ldso.c:754:16: warning: unused variable 'tmp' [-Wunused-variable] This was introduced with commit 94cc6edb (ldso: Rework global scope handling and symbol lookup mechanism). Cc: Filippo Arcidiacono <filippo.arcidiacono@st.com> Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-05-13libc: deal with aux vect inside __uClibc_main only if !SHAREDFilippo ARCIDIACONO
It's not safe to use the aux vect inside __uClibc_main if we are running with shared libraries, because it could have been already modified. For example, if some constructor plays with environment variables by using unsetenv, the modifications done into the stack to unset an environment variable, have impacts on the aux vect due to the extra NULL entries added. Due to this, __uClibc_main is not able to detect where the aux vect starts, so all the entries that are used by __uClibc_main (AT_UID, AT_EUID, AT_GID, AT_EGID, AT_PAGESZ and possibly other arch specific) are impacted. Same side effect on the aux vect is caused by the ld.so when running a SUID program with some of the unsecure environment variables set, that will be unset by the ld.so itself. In order to fix this issue, it needs to handle aux vect entries into __uClibc_main only if SHARED is not defined. In SHARED case, libc refers to __dl_secure and _dl_pagesize as initialised by the ld.so where the aux vext is still untouched. Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com> Reviewed-by: Carmelo Amoroso <carmelo.amoroso@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2013-03-14metag: Add NPTL supportMarkos Chandras
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-03-14metag: Add support for loading shared objects into core memories.Markos Chandras
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-03-14Add support for the Meta architectureMarkos Chandras
Meta cores are 32-bit, hardware multithreaded, general purpose, embedded processors which also feature a DSP instruction set, and can be found in many digital radios. They are capable of running different operating systems on different hardware threads, for example a digital radio might run RTOSes for DAB decoding and audio decoding on 3 hardware threads, and run Linux on the 4th hardware thread to manage the user interface, networking etc. HTPs are also capable of running SMP Linux on multiple hardware threads. Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-03-07buildsys: Add missing $(SYMBOL_PREFIX) to symbol namesMarkos Chandras
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-02-05mman: rename MAP_UNINITIALIZE to MAP_UNINITIALIZEDBernhard Reutner-Fischer
The name was changed to include a trailing 'D' when it went into the kernel. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-11-18Replace FSF snail mail address with URLsMike Frysinger
This matches a similar change made to glibc. No functional changes here. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-06-15add LDSO_SAFE_RUNPATH config optionPeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> 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-06-15ldso: use _dl_strdup and _dl_dprintf only in ld-uClibc.soPeter S. Mazinger
Add support for %p to _dl_dprintf for later corrections in debug messages. Disable _dl_debug_file if LD debugging is not enabled and change it's use to 2. The use of dprintf in elfinterp.c will spit out warnings, will be fixed in the reworked ldso. Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15avr32: common do_rem is good for itPeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15ppc/elfinterp.c: fix comment typosPeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15ldso: use .arm mode for resolver unconditionallyBernhard Reutner-Fischer
as per comment in the file. Fixes runtime with __THUMB_INTERWORK__ enabled. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-13Update C6X supportMark Salter
This patch updates the C6X support to work with latest uClibc code and uses reworked DSBT support to allow using kernel FDPIC loader. Signed-off-by: Mark Salter <msalter@redhat.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-06ldso: preload standard path library with setuid bit setFilippo Arcidiacono
For set-user-ID/set-group-ID ELF binaries, only libraries in the standard search directories that are also set-user-ID must be loaded. This patch fixes existing logic according to the above statement. Furthermore if either library setuid bit isn't set or it cannot be found in the standard search path, the library won't be preloaded but execution go ahead with default one. Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-06Clean up DSBT supportMark Salter
The existing DSBT support relies on the kernel to provide DSBT info as part of the load maps passed to user space. The problem with this approach is that the DSBT info is in the dynamic section, so the kernel must access a userspace mapping of the dynamic section (or separately read a copy for the kernel) in order to retrieve the information needed by userspace. This patch reworks the DSBT support to remove the reliance on DSBT info coming from the kernel. Instead, ldso reads the info itself from the dynamic section. One other benefit of this is that it allows the existing kernel FDPIC loader to also load DSBT binaries. Signed-off-by: Mark Salter <msalter@redhat.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-05-18ldso: sh: handle _dl_skip_args in linker startup instead of __uClibc_mainFilippo Arcidiacono
Handle _dl_skip_args in the asm part of the dynamic linker startup, to skip the ldso arguments, so we can keep this symbol hidden as other archs do. Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2012-04-08ldso: fix fdpic support broken from prelink patchFilippo Arcidiacono
The fdpic support has been broken since the prelink support was added, because it didn't take into account DL_LOADADDR_TYPE could be a different type of ElfW(Addr). Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
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-27ldso: bfin: add alias from __start to _startMike Frysinger
On Blackfin systems, we have underscore prefixes in our ABI. So instead of _start, we use __start. However, the makefile explicitly sets _start as the entry point to support toolchains that implicitly use other symbols as the default entry. It's easy enough to add a hidden alias in the Blackfin code for free to support this. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-03-26ldso: bfin: tweak styleMike Frysinger
No functional changes here. We don't need line continuations as gcc is smart enough to merge the multiple strings for us. 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-03-15ldso: remove duplicated assignment with TLS symbolCarmelo Amoroso
The tpnt field is already set, so not needed to assign it again. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2012-03-14ldso:sh: fix compiler warning due to unused-but-set-variableCarmelo Amoroso
gcc 4.6.x raises useful warnings due to unused-but-set-variable, This patch fixes the following one by using properly preprocessor guard In file included from ldso/libdl/libdl.c:129:0: ./ldso/ldso/sh/elfinterp.c: In function '_dl_do_reloc': ./ldso/ldso/sh/elfinterp.c:163:22: warning: variable 'tls_tpnt' set but not used [-Wunused-but-set-variable] Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2012-01-27ldso: fix typo in debug messageBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
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>
2012-01-14buildsys: cache build flags in varsMike Frysinger
Running `make clean` atm takes like 20 seconds because every subdir re-evaluates all the toolchain flags. Add some helpers to automate the process of setting up variables to cache the result of tests, as well as the checking of an already set flag. Now `make clean` takes like 2 seconds on my system. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-01-02ldso: setup search path even when there are no "/"Mike Frysinger
If people use an interp path such as "ld.so", then there is no "/" found, and we end up dereferencing a NULL pointer. Simplify the logic by having a relative interp path like that be the same as "" (which the code later on interprets as $PWD). While we're here, document some of the nuances of this code. Reported-by: Ignacy Gawędzki <uclibc@qult.net> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-01-02ldso: simplify interp path search logicMike Frysinger
The setup logic is duplicated, so unify it in a local func. Mark the variable const while we're doing this, and add missing ifdef protection to the header that declares it availability. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-11-27ldso: bfin: fix sram_flags initMike Frysinger
An earlier version had this, but was lost as code was shuffled around. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-11-27ldso: bfin: shrink sram mapping funcMike Frysinger
The L1 data and L2 code paths duplicate a lot, so unify them. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-11-27ldso: fdpic: clean up styleMike Frysinger
There should (hopefully) be no functional changes here. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-11-27ldso: fdpic: unify duplicate bfin/frv logicMike Frysinger
Much of the logic in the bfin/frv subdirs is FDPIC specific and not arch specific. So start a new fdpic/ subdir to keep common things. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-11-27ldso: use __func__ rather than __FUNCTION__Mike Frysinger
The former is part of a standard (C99) while the latter is not. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-11-07ldso: support RTLD_NOLOADTimo Teräs
So application query if specified module is loaded or not with dlopen. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-10-25ldso: let people disable to lookup into LD_LIBRARY_PATHCarmelo Amoroso
On hardened system it could be useful to disable the use of LD_LIBRARY_PATH. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-10-25ldso: minor fixes to implicit search pathCarmelo Amoroso
Do not defined _dl_ldsopatch if implicit search path if not enabled, and avoid to call search_for_named_library (even if it is able to handle NULL search path). Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-10-25ldso: disable the implicit path search in stand-alone mode as wellCarmelo Amoroso
Honour LDSO_SEARCH_INTERP_PATH knob option also when running in stand-alone mode. Signed-off-by: Rune <u-uclibc-y2lt@aetey.se> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-10-19libdl: remove _dl_ldsopath from libdl.aCarmelo Amoroso
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.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: unify pread syscall definitionMike Frysinger
A few arches want pread() defined, so move it to common code. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-10-06ldso: bfin/frv: drop dead simulator codeMike Frysinger
Nowhere do we define DYNAMIC_LOADER_IN_SIMULATOR, so drop the little bit of code that depends on it. At least in the Blackfin case, we can run an FDPIC ldso just fine under the simulator without hacks. Signed-off-by: Mike Frysinger <vapier@gentoo.org> 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-06microblaze mmu/elf/shared lib supportRyan Flux
microblaze can either be with mmu or without If with, use elf rather than flat, and support shared libs Signed-off-by: Ryan Flux <ryan.flux@emsolutions.com.au> Signed-off-by: Steve Bennett <steveb@workware.net.au> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-10-01ldso: x86_64: delete unused variableMike Frysinger
gcc informed me: In file included from ldso/ldso/ldso.c:46:0: ldso/ldso/x86_64/elfinterp.c: In function '_dl_do_lazy_reloc': ldso/ldso/x86_64/elfinterp.c:294:6: warning: variable 'symtab_index' set but not used [-Wunused-but-set-variable] Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-10-01ldso: constify reloc array itselfMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-08-26ldso: fix build with PRELINK enabled and !TLSCarmelo Amoroso
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.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>