summaryrefslogtreecommitdiffstats
path: root/ldso
Commit message (Collapse)AuthorAgeFilesLines
...
| * avoid warning about unused variableBernhard Reutner-Fischer2009-11-251-11/+10
| | | | | | | | | | | | If LDSO_SEARCH_INTERP_PATH is off then ptmp wasn't used. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
| * nommu: use MAP_UNINITIALIZE for mallocsMike Frysinger2009-11-232-2/+2
| | | | | | | | | | | | | | | | | | Now that the kernel supports MAP_UNINITIALIZE, have the malloc places use it to get real uninitialized memory on no-mmu systems. This avoids a lot of normally useless overhead involved in zeroing out all of the memory (sometimes multiple times). Signed-off-by: Mike Frysinger <vapier@gentoo.org>
| * ldso: let people disable the implicit path searchMike Frysinger2009-11-221-0/+2
| | | | | | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* | ldso: initialize stack_chk_guard after TLS is initializedNatanael Copa2009-11-271-13/+13
|/ | | | | | | | stack_chk_guard is on thread local storage so we need to init TLS before we can init stack_chk_guard. Signed-off-by: Natanael Copa <natanael.copa@gmail.com> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* remove superfluous extra semicolonsBernhard Reutner-Fischer2009-11-201-16/+17
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* ldso: Add missing newlines to some debug messagesBernhard Reutner-Fischer2009-11-158-14/+14
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* ldso: fixup missed variable rename ( tls_tpnt -> tpntp )Austin Foxley2009-10-161-2/+2
| | | | Signed-off-by: Austin Foxley <austinf@cetoncorp.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-152-15/+7
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* ldso: clean up breakage in tls mergeMike Frysinger2009-10-1514-159/+137
| | | | | | | | | | 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: fixup all the rest of the calls to _dl_find_hashAustin Foxley2009-10-147-13/+13
| | | | | | | | With TLS _dl_find_hash grew an extra param. These archs don't have TLS reloc support yet, but they do need to compile without it. Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* check_ld some more flagsBernhard Reutner-Fischer2009-10-091-1/+1
| | | | | | gold does not currently implement these. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* ldso: pull in missing bits/fcntl.h header for O_CLOEXECMike Frysinger2009-10-071-0/+2
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* ldso: use O_CLOEXEC for cache fileMike Frysinger2009-10-071-1/+1
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* ldso: use MAP_FAILED with ld.so.cacheMike Frysinger2009-10-071-5/+5
| | | | | | | Rather than use our own custom casted -1 value, just use the MAP_FAILED that common code already sets up for us for mmap(). Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* fix coding styleBernhard Reutner-Fischer2009-10-061-25/+16
| | | | | | TODO: use likely/unlikely Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* commentary typo fixBernhard Reutner-Fischer2009-10-061-2/+2
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* trim whitespaceBernhard Reutner-Fischer2009-10-061-10/+10
| | | | | | and wrap superlong line. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* whitespace cleanupBernhard Reutner-Fischer2009-10-061-4/+4
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* mips: fix typo in elfinterp.cAustin Foxley2009-10-041-1/+1
| | | | Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* ldso/: tls support for dynamic linkerAustin Foxley2009-09-2624-148/+2239
| | | | Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* support building out-of-treeBernhard Reutner-Fischer2009-08-172-0/+4
| | | | | | Handle O= Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* Blackfin: rename __dl_boot to __startMike Frysinger2009-07-232-11/+8
| | | | | | | | | | | | | The entry symbol is __start rather than __dl_boot. While in the past this was silently ignored, now with common code checking the _start symbol in C code, we end up with link errors: ldso/ldso/ld-uClibc_so.a(ldso.oS): In function `__dl_get_ready_to_run': ldso/ldso/ldso.c:(.text+0x2b30): undefined reference to `__start' collect2: ld returned 1 exit status make[1]: *** [lib/ld-uClibc.so] Error 1 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: fix incorrect attribute orderMike Frysinger2009-07-231-1/+2
| | | | | | | | | | | | | | | | | The order of attributes in a function definition matters and in a few places in the Blackfin code, it was being applied to the return type instead of the function itself. In file included from ldso/ldso/ldso.c:43: ldso/ldso/bfin/elfinterp.c: At top level: ldso/ldso/bfin/elfinterp.c:42: warning: '__visibility__' attribute ignored on non-class types In file included from ldso/ldso/bfin/elfinterp.c:341, from ldso/ldso/ldso.c:43: libc/sysdeps/linux/bfin/crtreloc.c: At top level: libc/sysdeps/linux/bfin/crtreloc.c:91: warning: 'visibility' attribute ignored on non-class types Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: add elf_machine_load_address() stubMike Frysinger2009-07-231-0/+8
| | | | | | | | | | | The Blackfin port never defined elf_machine_load_address() because the one place this code is called never matters to us. But without it, common code likes to hit a build failure, so stub it out. ldso/ldso/dl-startup.c: In function '_dl_start': ldso/ldso/dl-startup.c:170: warning: implicit declaration of function 'elf_machine_load_address' Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* ldso: fix building for FDPIC systemsMike Frysinger2009-07-231-1/+1
| | | | | | | | | | The force shareable code missed a spot of using the DL_RELOC_ADDR() indirection thus leading to invalid operands: ldso/ldso/ldso.c: In function '_dl_get_ready_to_run': ldso/ldso/ldso.c:409: error: invalid operands to binary + (have 'Elf32_Addr' and 'struct elf32_fdpic_loadaddr') Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* silence warnings in Blackfin ldso codeMike Frysinger2009-07-233-3/+3
| | | | | | | | | | | | | | | | In file included from ./ldso/include/ldso.h:135, from ldso/ldso/ldso.c:34: ./ldso/ldso/bfin/dl-inlines.h: In function '__dl_init_loadaddr_map': ./ldso/ldso/bfin/dl-inlines.h:43: warning: assignment makes pointer from integer without a cast In file included from ldso/ldso/ldso.c:43: ldso/ldso/bfin/elfinterp.c: In function '_dl_do_lazy_reloc': ldso/ldso/bfin/elfinterp.c:299: warning: assignment makes pointer from integer without a cast ldso/ldso/ldso.c: In function '_dl_get_ready_to_run': ldso/ldso/ldso.c:534: warning: assignment makes integer from pointer without a cast Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: add support for automatic loading of L2 SRAM regionsJie Zhang2009-07-231-17/+36
| | | | | | | These match the kernel/etc... pieces already merged. Signed-off-by: Jie Zhang <jie.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* 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>
* Avoid type-punned pointers that break strict-aliasingRon2009-07-052-2/+5
| | | | | Signed-off-by: Ron Lee <ron@debian.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Move extern prototype out of function scopeRon2009-07-051-1/+2
| | | | | | | gcc-4.4 now barks about this, so appease it. Signed-off-by: Ron Lee <ron@debian.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: make sure all relocs are uppercaseMike Frysinger2009-06-013-14/+14
| | | | | | This is to match changes in the toolchain. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* for sparc v8 MAGIC1 was defined incorrectlyaustinf2009-04-111-1/+1
| | | | | Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* 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-093-9/+30
| | | | | | | | | | | | | | 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>
* Use __always_inline instead of __inline__Carmelo Amoroso2009-03-0511-38/+38
|
* - fix weak ssp symbol on some arches (Peter S. Mazinger)Bernhard Reutner-Fischer2009-02-231-8/+6
| | | | | Work around alleged binutils glitch with weak symbols on some arches. See binutils ML, weak psm and vapier.
* Remove check for the relocation type check in the resolver,Carmelo Amoroso2009-01-2813-91/+0
| | | | | | | from all archs. Signed-off-by: Jiri Olsa <olsajiri@gmail.com>
* ldso: performs bootstrap relocations only if required by the arch.Carmelo Amoroso2009-01-1410-31/+69
| | | | | | | | It is controlled by ARCH_NEEDS_BOOTSTRAP_RELOCS macro. Signed-off-by: Jirka <olsajiri@gmail.com> Acked-by: Carmelo Amoroso <carmelo.amoroso@st.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>
* replace yet another _dl_malloc + _dl_memset with _dl_zallocDenis Vlasenko2009-01-111-2/+1
|
* simple optimizations and style fixes in dynamic loadingDenis Vlasenko2009-01-107-222/+222
| | | | | | | | | | | 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
* ldso/ldso/dl-startup.c: make _dl_elf_main static; remove one dead variable.Denis Vlasenko2009-01-0414-43/+23
| | | | | | | | | | 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
* - non-pic support for MIPS (Catherine Moore, clm at codesourcery com)Bernhard Reutner-Fischer2008-12-224-4/+155
|
* - use proper macrosBernhard Reutner-Fischer2008-12-032-3/+3
|
* - use proper macro (no obj-code changes)Bernhard Reutner-Fischer2008-12-031-1/+1
|
* - Use runtime pagesize (Jeremy Kerr)Bernhard Reutner-Fischer2008-12-0315-80/+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>