summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* ldso: let people disable to lookup into LD_LIBRARY_PATHCarmelo Amoroso2011-10-254-2/+24
| | | | | | | On hardened system it could be useful to disable the use of LD_LIBRARY_PATH. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* ldso: minor fixes to implicit search pathCarmelo Amoroso2011-10-252-1/+3
| | | | | | | | 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>
* ldso: disable the implicit path search in stand-alone mode as wellCarmelo Amoroso2011-10-251-9/+13
| | | | | | | | 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>
* config: add support for <custom>_defconfigCarmelo Amoroso2011-10-252-0/+11
| | | | | | | | Add support for platform specific and/or custom defconfig per arch. They have to be suffixed by '_defconfig' and are automatically detected and displayed by issuing 'make ARCH=<arch> help'. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* config: revise defconfigs strategyCarmelo Amoroso2011-10-2525-1/+1
| | | | | | | | Revise the way defconfigs are defined, by renaming them from defconfigs/<arch> to defconfigs/<arch>/defconfig. It allows to have multiple defconfigs per arch. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* config: tidy-up of config targetsCarmelo Amoroso2011-10-251-20/+22
| | | | | | | Introduce two local variables for 'conf' and 'mconf' binaries. Use $^ automatic variable to invoke [m]conf tool. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* resolv: fix memory leakBernhard Reutner-Fischer2011-10-211-0/+2
| | | | | | | | Timothy Holdener writes: small memory leak in __dns_lookup() when the A record in the DNS answer is preceded by one or more CNAME records. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* resolv: commentary typo fixBernhard Reutner-Fischer2011-10-201-1/+1
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* gethostbyname_r: set correct h_errno upon failureBernhard Reutner-Fischer2011-10-201-0/+1
| | | | | | | | | | | | | | | previously gethostbyname_r(ipv6.google.com);herror("ERROR:") gave Answer name = |ipv6.google.com| Answer type = |5| herrno=1 h_errno=0 ERROR:: Error 0 herrno=1 h_errno=1 ERROR:: Unknown host Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* resolv: fix compilationBernhard Reutner-Fischer2011-10-201-2/+2
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* libdl: remove _dl_ldsopath from libdl.aCarmelo Amoroso2011-10-192-3/+2
| | | | Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* ldd: take LD_LIBRARY_PATH into accountCarmelo Amoroso2011-10-182-3/+49
| | | | | | | | | | | Extend the environment variables adding the LD_LIBRARY_PATH if actually passed when doing shared library tracings through the ld.so trace capability. This is possible only using the system dynamic linker in stand-alone mode to avoid any vulnerability. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* Config.in: fix erroneously deleted lineBernhard Reutner-Fischer2011-10-141-0/+1
| | | | | | blame e9d74358093b61e2e597fa9e066ba0468df14cba Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* ldso: silence harmless warning for !LDSO_PRELINK_SUPPORTBernhard Reutner-Fischer2011-10-1413-13/+26
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* libc: fix daylight saving time handlingGuillaume Bourcier2011-10-121-1/+1
| | | | | | | | | | | | | The algorithm computing daylight saving time incorrectly adds a day for each month after January for leap years. The clock shift from/to DST can be delayed if the last Sunday of a transition month is exactly seven days before the first of the following month. This change adds a day for the February month only. Signed-off-by: Guillaume Bourcier <guillaumebourcier@free.fr> Signed-off-by: Richard Braun <rbraun@sceen.net> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* ldso: unify pread syscall definitionMike Frysinger2011-10-064-46/+24
| | | | | | | 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>
* ldso: bfin/frv: drop dead simulator codeMike Frysinger2011-10-062-304/+0
| | | | | | | | | 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>
* ldso: merge duplicate dl-syscalls.h code to common headerMike Frysinger2011-10-0617-101/+17
| | | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* microblaze mmu/elf/shared lib supportRyan Flux2011-10-0613-7/+708
| | | | | | | | | 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>
* microblaze linux has no SDA supportSteve Bennett2011-10-062-8/+0
| | | | | | | | | The linker does not set up the Small Data Area symbols, _SDA_BASE_ and _SDA2_BASE_ so don't try to resolve them 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>
* microblaze can be either big or little endianSteve Bennett2011-10-062-2/+8
| | | | | Signed-off-by: Steve Bennett <steveb@workware.net.au> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* microblaze has long double support tooRyan Flux2011-10-061-1/+1
| | | | | | 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>
* Use the generic bits/select.h for microblazeSteve Bennett2011-10-061-58/+0
| | | | | | | This avoids warnings about type-punned pointers Signed-off-by: Steve Bennett <steveb@workware.net.au> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* tests: ignore new inet testMike Frysinger2011-10-011-0/+1
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: add fallback for mktemp()Mike Frysinger2011-10-011-0/+22
| | | | | | | | If SuSv3 legacy support is disabled, then mktemp() isn't available, and we end up getting a lot of build errors. So add a fallback built on top of tempnam() since that currently cannot be disabled. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* ldso: x86_64: delete unused variableMike Frysinger2011-10-011-2/+0
| | | | | | | | | | 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>
* ldso: constify reloc array itselfMike Frysinger2011-10-0115-15/+15
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Defeat compiler optimization which assumes function addresses are never NULLDenys Vlasenko2011-09-152-20/+42
| | | | | | | | | | | | | From email: A warning for people who can be hit by the same or similar issue: gcc 4.1.2 with -march=i486 here with -Os and even with -O2 or -O is "optimizing away" the check if (_stdio_term) in libc/stdlib/_atexit.c which results in a "call 0" and a segfault at exit if you do not happen to link in stdio. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* config: tweak help textBernhard Reutner-Fischer2011-09-121-2/+2
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* resolv: simple optimizations and style/readability fixesDenys Vlasenko2011-09-102-122/+107
| | | | | | | | | | text data bss dec hex filename - 2915 0 0 2915 b63 libc/inet/ns_name_old.o + 2656 0 0 2656 a60 libc/inet/ns_name.o - 958 0 0 958 3be libc/inet/ns_parse_old.o + 898 0 0 898 382 libc/inet/ns_parse.o Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ldso: fix build with PRELINK enabled and !TLSCarmelo Amoroso2011-08-261-0/+2
| | | | Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* ldso: add missing includeBernhard Reutner-Fischer2011-08-261-0/+1
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* inet: build all res_* and ns_* functions conditionallyDaniel Mack2011-08-261-3/+2
| | | | | | | | | | | | This patch changes the build system so that all DNS resolver related functions (ie, those starting with dn_, ns_ and res_) are only built if UCLIBC_HAS_RESOLVER_SUPPORT is set. This means that the libc will lack support for things that existed in the library before unless this new config option is set. On the other hand, if users really need support for resolver functions, they now get a more complete set, and the library is smaller than before it is deselected. Signed-off-by: Daniel Mack <zonque@gmail.com>
* include/resolv.h: provide __res_state._u even if !__UCLIBC_HAS_IPV6__Daniel Mack2011-08-261-2/+2
| | | | | | | This struct is used for IPv4 as well, so only make the members conditional that are purely used by IPv6. Signed-off-by: Daniel Mack <zonque@gmail.com>
* inet/resolv: add res_ninit and res_ncloseDaniel Mack2011-08-262-17/+132
| | | | | | | Some reordering of existing functions was necessary in order to provide this functionality. Signed-off-by: Daniel Mack <zonque@gmail.com>
* inet/resolv: add res_mkqueryDaniel Mack2011-08-264-4/+126
| | | | Signed-off-by: Daniel Mack <zonque@gmail.com>
* inet/resolv: add ns_initparse, ns_parserr, ns_skiprr and ns_msg_getflagDaniel Mack2011-08-264-6/+206
| | | | | | There are build 'ifdef L_ns_parse'. Signed-off-by: Daniel Mack <zonque@gmail.com>
* inet/resolv: add dn_skipname and ns_name_skipDaniel Mack2011-08-262-2/+54
| | | | | | One uses the other, so add them in one go. Signed-off-by: Daniel Mack <zonque@gmail.com>
* inet/resolv: Add dn_compDaniel Mack2011-08-262-3/+16
| | | | Signed-off-by: Daniel Mack <zonque@gmail.com>
* inet/resolv: add ns_name_pton, ns_name_pack and ns_name_compressDaniel Mack2011-08-262-0/+469
| | | | | | These are built '#ifdef L_ns_name' Signed-off-by: Daniel Mack <zonque@gmail.com>
* inet/resolv: add ns_{put,get}{16,32}Daniel Mack2011-08-264-0/+46
| | | | | | | This patch introduces a new config directive 'UCLIBC_HAS_RESOLVER_SUPPORT' and adds the new symbols conditionally. Signed-off-by: Daniel Mack <zonque@gmail.com>
* libc/inet/resolv.c: comment on #endif linesDaniel Mack2011-08-261-30/+30
| | | | | | | | While reading this file, I found it rather confusing to relate the "endif" lines to their opening counter-part. This patch adds comments to most of these lines to denote what the actually do. Signed-off-by: Daniel Mack <zonque@gmail.com>
* extra/Configs/Config.in: drop "default n" linesDaniel Mack2011-08-261-76/+0
| | | | | | "default n" is the default default. No need to mention it explicitly. Signed-off-by: Daniel Mack <zonque@gmail.com>
* ldso/mips: Clean up warningsKevin Cernekee2011-07-271-1/+4
| | | | | | | | | | | | | | | | 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>
* ldso/mips: dlsym() incorrectly matches undefined symbolsKevin Cernekee2011-07-272-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* ldso/mips: Enable bootstrap relocationsKevin Cernekee2011-07-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | _dl_reltypes_tab[] is an array of pointers to constant strings: Contents of section .data: 20000 01000000 02000000 00000000 00000000 ................ 20010 70e50000 7ce50000 88e50000 94e50000 p...|........... ^^^^^^^^ ^^^^^^^^ ^^^^^^^^ ^^^^^^^^ (pointers are LE) Contents of section .rodata: e570 525f4d49 50535f4e 4f4e4500 525f4d49 R_MIPS_NONE.R_MI e580 50535f31 36000000 525f4d49 50535f33 PS_16...R_MIPS_3 e590 32000000 525f4d49 50535f52 454c3332 2...R_MIPS_REL32 These pointers require relocation: DYNAMIC RELOCATION RECORDS OFFSET TYPE VALUE 00000000 R_MIPS_NONE *ABS* 0001fffc R_MIPS_REL32 *ABS* 00020010 R_MIPS_REL32 *ABS* 00020014 R_MIPS_REL32 *ABS* 00020018 R_MIPS_REL32 *ABS* On MIPS, only GOT relocations are currently handled by ldso during startup. The net effect is that when running with "LD_DEBUG=reloc", ldso itself crashes before the program even starts. This is caused by _dl_dprintf() dereferencing an unadjusted string pointer such as 0xe570. This patch enables the missing relocations and allows LD_DEBUG to work as designed. Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* libdl: add option for controlling dl_cleanupRichard Braun2011-07-253-1/+19
| | | | | | | | | | | When debugging memory leaks with Valgrind, it is required that dynamically loaded shared objects are not unloaded when a process exits, otherwise symbols from those files aren't correctly resolved in allocation traces. This patch adds the LDSO_NO_CLEANUP configuration option to control this behaviour. Signed-off-by: Richard Braun <rbraun@sceen.net> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* ldso: fix build error due to missing variable 'st'Douglas Mencken2011-07-121-0/+1
| | | | | | | | Fix a build error triggered when LDSO_PRELOAD_FILE_SUPPORT is enabled due to missing definition of 'st' variable. Signed-off-by: Douglas Mencken <dougmencken@gmail.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* x86_64/elfinterp.c: Protect missed debug _dl_printf with __SUPPORT_LD_DEBUG__Khem Raj2011-07-071-1/+4
| | | | Signed-off-by: Khem Raj <raj.khem@gmail.com>
* mips/signalfd.h: SFD_NONBLOCK for mips is 0200 unlike 04000 commonlyKhem Raj2011-07-011-0/+9
| | | | | | Exposed by udev 171 which uses signalfd Signed-off-by: Khem Raj <raj.khem@gmail.com>