summaryrefslogtreecommitdiff
path: root/libc
AgeCommit message (Collapse)Author
2012-01-13libc: allow to backtrace out of abort callCarmelo Amoroso
Build raise and abort function with dwarf2 info by using -fasynchronous-unwind-tables to make backtrace() working across a call to abort. A scenario where it could be useful is within a signal handler that wants to dump a backtrace when catching some signal (i.e SIGABRT). Without having abort & raise built with DWARF2 information, it is not possible for the libgcc stack unwinder to walk through the call stack out of the abort/raise function. Impacts in terms of size are really limited Current text data bss dec hex filename 164 0 0 164 a4 ./libpthread/nptl/sysdeps/unix/sysv/linux/raise.os 164 0 0 164 a4 ./libpthread/nptl/sysdeps/unix/sysv/linux/raise.oS 220 24 4 248 f8 ./libc/stdlib/abort.os With (-fasynchronous-unwind-tables) text data bss dec hex filename 216 0 0 216 d8 ./libpthread/nptl/sysdeps/unix/sysv/linux/raise.os 216 0 0 216 d8 ./libpthread/nptl/sysdeps/unix/sysv/linux/raise.oS 280 24 4 308 134 ./libc/stdlib/abort.os Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com> Acked-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-01-01getpass: s/sizeof(buf)-1/sizeof(buf)/ in fgetsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-12-23getpass: several fixesDenys Vlasenko
fixes bogus fgets error check fixes bogus strlen() < 0 check switches off buffering regardless of tcgetattr() success prints newline even on error or if there was no '\n' on input uses sizeof(buf) instead of PWD_BUFFER_SIZE Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2011-12-03x86_64: add PLT bypass for __sigsetjmpMike Frysinger
The current x86_64 setjmp helpers incur a reloc, so fix that up. $ readelf -r lib/libc.so.0 ... Relocation section '.rela.plt' at offset 0xb058 contains 10 entries: Offset Info Type Sym. Value Sym. Name + Addend 000000236010 02a400000007 R_X86_64_JUMP_SLO 000000000000b3c4 __sigsetjmp + 0 ... Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-12-03getutid: add a hidden defMike Frysinger
The pututline func calls getutid, so add a hidden def for it to avoid plt relocs: $ readelf -r lib/libc.so.0 ... Relocation section '.rela.plt' at offset 0xb058 contains 11 entries: Offset Info Type Sym. Value Sym. Name + Addend 000000236000 01cf00000007 R_X86_64_JUMP_SLO 00000000000190ab getutid + 0 ... Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-11-27make ARRAY_SIZE commonly available internallyMike Frysinger
Some places have opencoded the ARRAY_SIZE macro, so move it to a global internal location so other places can leverage it. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-11-25buildsys: s/CROSS/CROSS_COMPILE/gCarmelo Amoroso
Use CROSS_COMPILE instead of CROSS as other projects are doing (i.e. kernel, busybox, buildroot). CROSS is still supported for backward compatibility only Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-11-23libc: do not rely upon ulimit kernel syscall.Carmelo Amoroso
On several architectures __NR_ulimit syscall number is currently defined but it is remapped onto sys_ni_syscall, while on other architectures they are not longer defined. So use {get,set}rlimit only to implement ulimit interface. It fixes LTP ulimit01 test case. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com> Acked-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-20stdio: add support for "e" flag with fopen()Mike Frysinger
Support this useful glibc extension for optionally setting O_CLOEXEC on fopen streams. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-11-17misc: hide __gen_tempnameBernhard Reutner-Fischer
fix signed vs. unsigned comparison warnings while at it Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-17stdio: hide _stdio_validate_FILEBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-17regex_old: make some internal helpers staticBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-17inet: hide relocationsBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-17unistd: hide relocationsBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-17resolv: hide relocationsBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-14Add a C6X-specific ipc.h.Bernd Schmidt
Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
2011-11-07libc: flesh out linux scheduler functionsHenning Heinold
Most stuff was taken from the eglibc. Signed-off-by: Henning Heinold <heinold@inf.fu-berlin.de> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
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-11-07stdlib: add qsort_rBernhard Reutner-Fischer
GNU extension like qsort but takes a 3 parameter comparision function. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-04powerpc: Fix typo in clone()Bernhard Reutner-Fischer
Thanks to strauman at slac stanford edu for noticing Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-04Add stub for eventfd.Jean-Christian de Rivaz
Warn if the enventfd() function is not implemented. Signed-off-by: Jean-Christian de Rivaz <jc@eclis.ch> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-04libm: implement a generic sincos().William Pitcock
We already provide sincos() on some archs, so we should ship a generic version. Signed-off-by: William Pitcock <nenolod@dereferenced.org> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-02setegid: use setresgid conditionallyBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-02stubs: remove leftover undefsBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-02stubs: handle linux module functionsBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-02stubs: handle linux-specificBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-02stubs: fix inverted socket logicBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-02stubs: undef linux specific unless they were asked forBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-10-31Add eventfd support.Jean-Christian de Rivaz
Hello, I whould like to share this simple patch that add the eventfd call to uClibc. Please review so it can be accepted to be merged. Jean-Christian Signed-off-by: Jean-Christian de Rivaz <jc@eclis.ch> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-10-27sparc: fix build for linuxthreads.oldRob Landley
sparc target has assembly implementations of clone.S that doesn't get used, and thus the build breaks. Also, sparc is missing a header file in pthreads.old that exists in pthreads.new. Signed-off-by: Rob Landley <rob@landley.net> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2011-10-27sh: fix build for SH in !NPTL caseRob Landley
Signed-off-by: Rob Landley <rob@landley.net> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-10-21resolv: fix memory leakBernhard Reutner-Fischer
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>
2011-10-20resolv: commentary typo fixBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-10-20gethostbyname_r: set correct h_errno upon failureBernhard Reutner-Fischer
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>
2011-10-20resolv: fix compilationBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-10-12libc: fix daylight saving time handlingGuillaume Bourcier
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>
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-06microblaze linux has no SDA supportSteve Bennett
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>
2011-10-06microblaze can be either big or little endianSteve Bennett
Signed-off-by: Steve Bennett <steveb@workware.net.au> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-10-06Use the generic bits/select.h for microblazeSteve Bennett
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>
2011-09-15Defeat compiler optimization which assumes function addresses are never NULLDenys Vlasenko
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>
2011-09-10resolv: simple optimizations and style/readability fixesDenys Vlasenko
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>
2011-08-26inet: build all res_* and ns_* functions conditionallyDaniel Mack
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>
2011-08-26inet/resolv: add res_ninit and res_ncloseDaniel Mack
Some reordering of existing functions was necessary in order to provide this functionality. Signed-off-by: Daniel Mack <zonque@gmail.com>
2011-08-26inet/resolv: add res_mkqueryDaniel Mack
Signed-off-by: Daniel Mack <zonque@gmail.com>
2011-08-26inet/resolv: add ns_initparse, ns_parserr, ns_skiprr and ns_msg_getflagDaniel Mack
There are build 'ifdef L_ns_parse'. Signed-off-by: Daniel Mack <zonque@gmail.com>
2011-08-26inet/resolv: add dn_skipname and ns_name_skipDaniel Mack
One uses the other, so add them in one go. Signed-off-by: Daniel Mack <zonque@gmail.com>
2011-08-26inet/resolv: Add dn_compDaniel Mack
Signed-off-by: Daniel Mack <zonque@gmail.com>
2011-08-26inet/resolv: add ns_name_pton, ns_name_pack and ns_name_compressDaniel Mack
These are built '#ifdef L_ns_name' Signed-off-by: Daniel Mack <zonque@gmail.com>
2011-08-26inet/resolv: add ns_{put,get}{16,32}Daniel Mack
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>