summaryrefslogtreecommitdiffstats
path: root/ldso/include
Commit message (Collapse)AuthorAgeFilesLines
* ldso: support RTLD_NOLOADTimo Teräs2011-12-231-2/+4
| | | | | | | | So application query if specified modile is loaded or not with dlopen. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
* libdl: fix local symbol's address handling in dladdrFilippo Arcidiacono2011-05-101-0/+8
| | | | | | | | | | | Fix dladdr to correctly handle local function's address so backtrace_symbols print only the function address for these function, instead of showing the name of nearest one. Indeed the dladdr walk through the hash table to find the nearest symbol, that doesn't contain local symbols. Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* Fix nommu handling of DT_TEXTRELBernd Schmidt2011-04-112-1/+3
| | | | | | | | | | | | | | | | | We have a problem with DT_TEXTREL shared libraries on nommu machines. The dynamic linker's strategy is to map the text segment read-only first, then look for DT_TEXTREL, and use mprotect to change protections if necessary. This fails on nommu, since a nommu kernel can decide to share the memory for private read-only file mappings, and mprotect doesn't (can't) do anything about this sharing. Existing nommu targets apparently have no need for this, but on C6X, we may need to assign library indices at run-time if no --dsbt-index option was passed to the linker at build time. Hence, the following patch, which instead of using mprotect, redoes the mapping with PF_W set. Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
* remove trailing ';' from _syscallX()Peter S. Mazinger2011-03-091-1/+1
| | | | Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* Add support for DSBT ELF to ld.soMark Salter2011-03-052-2/+11
| | | | | | | | | | This adds support for DSBT ELF to ld.so. This uses loadmaps like FD-PIC. Some code is added in ld.so to initialize the DSBT tables, and there's also a new target macro FINISH_BOOTSTRAP_RELOC. Signed-off-by: Mark Salter <msalter@redhat.com> Signed-off-by: Aurelien Jacquiot <a-jacquiot@ti.com> Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
* ldso: fix fdpic buildsMike Frysinger2011-02-211-2/+7
| | | | | | | | | | | | Commit 33cb7f0b4 tried to add a small optimization for skipping unnecessary .dynamic adjustments, but did so by referencing an opaque type. While this works for non-fdpic targets (since the type can be cast to an integer), it falls apart for fdpic targets where the type is actually a structure. Since FDPIC can't support this optimization without walking a series of linked structures, just skip it. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* ldso: get rid of _dl_lookup_hashCarmelo Amoroso2011-01-201-7/+1
| | | | | | | | Now _dl_find_hash and _dl_lookup_hash are exactly the same, we can get rid of the _dl_lookup_hash, reverting the _dl_find_hash from a wrapper of _dl_lookup_hash to its original role. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* Add protected symbols support for all architecturesSalvatore Cro2011-01-201-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* ldso/include/dl-hash.h: suppress compiler warning. no code changesDenys Vlasenko2010-11-021-6/+6
| | | | | | | | | | The warning was repeated for every .c file which is including this header: ./ldso/include/dl-hash.h: In function '_dl_find_hash': ./ldso/include/dl-hash.h:150: warning: unused parameter 'tpntp' Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ldso: Do not adjust dynamic section entries unnecessarilyFilippo Arcidiacono2010-09-151-7/+10
| | | | | Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* silence warning about incompatible types with _dl_init_static_tlsBernhard Reutner-Fischer2010-07-271-1/+1
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* ldso: Fix DL_BOOT_COMPUTE_DYN macroFilippo Arcidiacono2010-07-261-1/+1
| | | | | Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* powerpc: Add TLS and NPTL supportKhem Raj2010-05-091-0/+4
| | | | | Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* include dlfcn.h in ldso.h to get RTLD_NODELETE definitionAustin Foxley2010-04-281-0/+1
| | | | Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* ldso: support RTLD_NODELETE and DF_1_NODELETETimo Teräs2010-04-221-7/+13
| | | | | | | | | Honor the nodelete flags so we don't delete shared library if it's sticky. This is useful for libpthread if it gets pulled in by a dlopen'ed library. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* whitespace cleanupBernhard Reutner-Fischer2010-04-121-5/+5
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* ldso: fix USE_TLS checkAustin Foxley2010-02-111-1/+1
| | | | | | this was causing tls symbols to leak into non-tls builds Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* ldso: add missing prototypesBernhard Reutner-Fischer2010-02-051-0/+5
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* check if USE_TLS is defined before useHans-Christian Egtvedt2009-12-171-2/+2
| | | | | | | | | | | This patch will convert all the #ifdef USE_TLS and #if USE_TLS to #if defined(USE_TLS) && USE_TLS. By checking if the USE_TLS is defined before checking its value will result in correct behavior for architectures not defining this config symbol. Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com> Acked-by: Carmelo AMOROSO <carmelo.amoroso@st.com>
* remove superfluous extra semicolonsBernhard Reutner-Fischer2009-11-201-16/+17
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* ldso: drop duplicated/unused definesMike Frysinger2009-10-151-23/+0
| | | | | | | We already include bits/fcntl.h for some of these defines, and most of the bits/stat.h defines are unused. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* ldso: unify and cleanup _dl_mmap codeMike Frysinger2009-10-151-40/+22
| | | | | | The interface should be straight forward now and the same for everyone. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* ldso: define MAP_FAILED for everyoneMike Frysinger2009-10-151-1/+1
| | | | | | This fixes build errors where common code has started using MAP_FAILED. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* ldso: simplify handling of extra _dl_lookup_hash() argMike Frysinger2009-10-151-14/+6
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* ldso: clean up breakage in tls mergeMike Frysinger2009-10-152-9/+8
| | | | | | | | | | 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>
* ldso: pull in missing bits/fcntl.h header for O_CLOEXECMike Frysinger2009-10-071-0/+2
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* whitespace cleanupBernhard Reutner-Fischer2009-10-061-4/+4
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* ldso/: tls support for dynamic linkerAustin Foxley2009-09-263-14/+200
| | | | Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* fix building for systems w/out ldso supportMike Frysinger2009-07-201-0/+5
| | | | | | | If an arch (like alpha and others) have no ldso support at all, then there is no point in attempting to walk loaded modules in the dl-* helper funcs. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sparc also needs CONSTANT_STRING_GOT_FIXUP for doing debug printing in ldsoaustinf2009-04-111-1/+1
| | | | Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* Fix the ifdef logic broken by last commit for !defined (__mcoldfire__)Khem Raj2009-04-091-3/+1
|
* The attached patches fixes the problems found bringing up uclibc on coldfire Khem Raj2009-04-091-2/+2
| | | | | | | | | | | | | | M5485 processor 1. Disable mmap2() if we're compiling for coldfire and fall back to mmap(). It seems to map a different file area on a 2.6.25 linux kernel. 2. Uses pc-relative addresing[1], computes ADDR_ALIGN, PAGE_ALIGN and OFFSET_ALIGN relatively to _dl_pagesize[3]. On coldfire/M5485 _dl_pagesize is 0x2000. Signed-off-by: Groleo Marius <groleo@gmail.com>
* ldso: do not comment out unused variables, just delete it.Carmelo Amoroso2009-01-121-1/+0
| | | | | SIgned-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* simple optimizations and style fixes in dynamic loadingDenis Vlasenko2009-01-102-21/+21
| | | | | | | | | | | text data bss dec hex filename - 16709 240 92 17041 4291 lib/ld-uClibc.so + 16634 236 92 16962 4242 lib/ld-uClibc.so - 4602 344 4 4950 1356 lib/libdl-0.9.30-svn.so + 4571 328 4 4903 1327 lib/libdl-0.9.30-svn.so - 4602 344 4 4950 1356 lib/libdl.so + 4571 328 4 4903 1327 lib/libdl.so
* - Use runtime pagesize (Jeremy Kerr)Bernhard Reutner-Fischer2008-12-031-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix whitespace damage in file.Hans-Christian Egtvedt2008-11-031-1/+1
| | | | | Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
* Use __always_inline for _dl_gettimeofday as well.Carmelo Amoroso2008-09-181-1/+1
| | | | Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* - fix inline keywordBernhard Reutner-Fischer2008-07-233-4/+4
|
* - Revert _dl_exit touch-up.Bernhard Reutner-Fischer2008-06-031-5/+1
| | | | It breaks on arches that don't define proper/complete/nice syscall facilities.
* - adds several config-options to allow for turning off certain featuresBernhard Reutner-Fischer2008-06-031-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | like o UCLIBC_HAS_GNU_ERROR o UCLIBC_HAS_BSD_ERR o UCLIBC_HAS_PTY o UCLIBC_HAS_GETPT (1) o UCLIBC_SYSCALL_STUBS o UCLIBC_SYSCALL_STUB_WARNING o UCLIBC_LINUX_SPECIFIC (2) o UCLIBC_BSD_SPECIFIC (3) o UCLIBC_NTP_LEGACY (4) o UCLIBC_SV4_DEPRECATED (5) o UCLIBC_HAVE_REALTIME (6) o UCLIBC_HAVE_ADVANCED_REALTIME (7) o UCLIBC_HAVE_EPOLL (8) o UCLIBC_HAVE_XATTR (9) o UCLIBC_HAVE_PROFILING (10) (1) make non-standard getpt optional and implement standard posix_openpt (2) fstatfs(), inotify_*(), ioperm(), iopl(), madvise(), modify_ldt(), personality() ppoll(), setresuid() (3) mincore(), getdomainname(), setdomainname() (4) ntp_adjtime(), ntp_gettime() aliases (5) ustat() [use statfs(2) in your code instead] (6) All marked as "(REALTIME)" in SUSv3 (7) All marked as "(ADVANCED REALTIME)" in SUSv3 (8) epoll_create(), epoll_ctl(), epoll_wait() (9) all Extended Attributes (10) helpers for gcc's -finstrument-functions - Fixes _dl_exit() - Implements sleep(3) for !UCLIBC_HAVE_REALTIME - Implements usleep(3) for !UCLIBC_HAVE_REALTIME - adds #warning about incorrect posix_fadvise{,64}() - removes unused and unwanted uselib() Net outcome is that an allnoconfig with HAVE_SHARED is now about 88k instead of formerly 130k.
* - fix the macros rather than the callees as rightfully noted by bernds (duh!)Bernhard Reutner-Fischer2008-05-301-3/+3
|
* Fix the recent dladdr changes so that they compile on FD-PIC targets.Bernd Schmidt2008-02-081-1/+1
|
* This patch solves a problem in dladdr caused by the wrong valueCarmelo Amoroso2008-01-182-2/+3
| | | | | | | of elf_resolve's loadaddr field for the main application. Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* fix broken whitespace in many places; no functional changesMike Frysinger2008-01-094-13/+12
|
* Some more Blackfin/FDPIC ldso merging work. Include dl-inlines.h when itBernd Schmidt2008-01-081-0/+4
| | | | exists, and move some definitions to their proper place.
* change NO_UNDERSCORES to just UNDERSCORES so as to be less confusing when ↵Mike Frysinger2008-01-081-3/+3
| | | | doing double negatives
* Chris Zankel writes:Mike Frysinger2008-01-051-1/+1
| | | | | | | | | | | | | | | | | | The following patches add support for the Xtensa processor architecture to uClibc. They are based on a recent SVN checkout (12/05/2007). The first patch (attached to this post) adds Xtensa support to various shared configuration and make files. The following patches then include the Xtensa specific files and directories. I welcome any feedback and would appreciate it if you could include the patches into the mainline tree. I am certainly committed to maintain the port. Bob Wilson was kind enough to review the patches. Some notes about the architecture: Xtensa is a configurable and extensible processor architecture developed by Tensilica. For more information, please visit: www.linux-xtensa.org.
* whitespace only: fix indentationMike Frysinger2008-01-051-1/+1
|
* Blackfin FD-PIC patch 6/6.Bernd Schmidt2007-12-041-1/+50
| | | | | | | These are mostly the changes necessary to deal with loading the libraries into memory. A couple new target macros are defined for this purpose, and the code in dl-elf.c is modified to deal with nommu systems.
* Blackfin FD-PIC patches 5/6.Bernd Schmidt2007-12-032-1/+23
| | | | | | | A couple more target macros for ld.so to deal with FD-PIC support. We need special code to compute the initial got and dpnt, and we need to pass extra arguments to _dl_get_ready_to_run.