OSDN Git Service
Mike Frysinger [Sat, 1 Oct 2011 19:10:39 +0000 (15:10 -0400)]
ldso: constify reloc array itself
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Denys Vlasenko [Thu, 15 Sep 2011 14:59:21 +0000 (16:59 +0200)]
Defeat compiler optimization which assumes function addresses are never NULL
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>
Bernhard Reutner-Fischer [Mon, 12 Sep 2011 15:29:21 +0000 (17:29 +0200)]
config: tweak help text
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Denys Vlasenko [Sat, 10 Sep 2011 01:01:33 +0000 (03:01 +0200)]
resolv: simple optimizations and style/readability fixes
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>
Carmelo Amoroso [Fri, 26 Aug 2011 08:26:17 +0000 (10:26 +0200)]
ldso: fix build with PRELINK enabled and !TLS
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Bernhard Reutner-Fischer [Fri, 26 Aug 2011 07:40:30 +0000 (09:40 +0200)]
ldso: add missing include
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Daniel Mack [Tue, 12 Jul 2011 22:30:56 +0000 (00:30 +0200)]
inet: build all res_* and ns_* functions conditionally
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>
Daniel Mack [Tue, 12 Jul 2011 22:30:55 +0000 (00:30 +0200)]
include/resolv.h: provide __res_state._u even if !__UCLIBC_HAS_IPV6__
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>
Daniel Mack [Tue, 12 Jul 2011 22:30:54 +0000 (00:30 +0200)]
inet/resolv: add res_ninit and res_nclose
Some reordering of existing functions was necessary in order to provide
this functionality.
Signed-off-by: Daniel Mack <zonque@gmail.com>
Daniel Mack [Tue, 12 Jul 2011 22:30:53 +0000 (00:30 +0200)]
inet/resolv: add res_mkquery
Signed-off-by: Daniel Mack <zonque@gmail.com>
Daniel Mack [Tue, 12 Jul 2011 22:30:52 +0000 (00:30 +0200)]
inet/resolv: add ns_initparse, ns_parserr, ns_skiprr and ns_msg_getflag
There are build 'ifdef L_ns_parse'.
Signed-off-by: Daniel Mack <zonque@gmail.com>
Daniel Mack [Tue, 12 Jul 2011 22:30:51 +0000 (00:30 +0200)]
inet/resolv: add dn_skipname and ns_name_skip
One uses the other, so add them in one go.
Signed-off-by: Daniel Mack <zonque@gmail.com>
Daniel Mack [Tue, 12 Jul 2011 22:30:50 +0000 (00:30 +0200)]
inet/resolv: Add dn_comp
Signed-off-by: Daniel Mack <zonque@gmail.com>
Daniel Mack [Tue, 12 Jul 2011 22:30:49 +0000 (00:30 +0200)]
inet/resolv: add ns_name_pton, ns_name_pack and ns_name_compress
These are built '#ifdef L_ns_name'
Signed-off-by: Daniel Mack <zonque@gmail.com>
Daniel Mack [Tue, 12 Jul 2011 22:30:48 +0000 (00:30 +0200)]
inet/resolv: add ns_{put,get}{16,32}
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>
Daniel Mack [Tue, 12 Jul 2011 22:30:47 +0000 (00:30 +0200)]
libc/inet/resolv.c: comment on #endif lines
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>
Daniel Mack [Tue, 12 Jul 2011 22:30:46 +0000 (00:30 +0200)]
extra/Configs/Config.in: drop "default n" lines
"default n" is the default default. No need to mention it explicitly.
Signed-off-by: Daniel Mack <zonque@gmail.com>
Kevin Cernekee [Sun, 24 Jul 2011 08:19:14 +0000 (01:19 -0700)]
ldso/mips: Clean up warnings
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>
Kevin Cernekee [Sun, 24 Jul 2011 08:19:13 +0000 (01:19 -0700)]
ldso/mips: dlsym() incorrectly matches undefined symbols
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>
Kevin Cernekee [Sun, 24 Jul 2011 08:19:12 +0000 (01:19 -0700)]
ldso/mips: Enable bootstrap relocations
_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>
Richard Braun [Sat, 9 Jul 2011 12:06:52 +0000 (14:06 +0200)]
libdl: add option for controlling dl_cleanup
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>
Douglas Mencken [Tue, 12 Jul 2011 07:39:17 +0000 (09:39 +0200)]
ldso: fix build error due to missing variable 'st'
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>
Khem Raj [Thu, 7 Jul 2011 16:50:17 +0000 (09:50 -0700)]
x86_64/elfinterp.c: Protect missed debug _dl_printf with __SUPPORT_LD_DEBUG__
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Khem Raj [Thu, 30 Jun 2011 07:32:11 +0000 (00:32 -0700)]
mips/signalfd.h: SFD_NONBLOCK for mips is 0200 unlike 04000 commonly
Exposed by udev 171 which uses signalfd
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Khem Raj [Tue, 28 Jun 2011 00:48:18 +0000 (17:48 -0700)]
Config.in.arch: Free UCLIBC_HAS_FPU setting from depending on UCLIBC_HAS_FLOATS
UCLIBC_HAS_FLOATS and UCLIBC_HAS_FPU are denoting two different aspects.
UCLIBC_HAS_FLOATS covers the floating point operations which has nothing
to do if you have FPU or not.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Carmelo Amoroso [Mon, 27 Jun 2011 13:26:22 +0000 (15:26 +0200)]
ldso: arm: fix build when prelinking is enabled.
This is a post merge fix to address build issue when PRELINK
support is enabled.
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Carmelo Amoroso [Fri, 1 Jul 2011 07:48:01 +0000 (09:48 +0200)]
Merge remote-tracking branch 'origin/master' into prelink
* origin/master:
libc: add missing lock initialization in vswprintf
libubacktrace: fix makefile clean target
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Maksim Rayskiy [Fri, 17 Jun 2011 01:14:01 +0000 (18:14 -0700)]
libc: add missing lock initialization in vswprintf
Unlike vsnprintf, vswprintf does not properly initialize locking
elements of FILE structure, which in some unfortunate cases can result
in lockups in _vfwprintf_internal.
Interesting, the initialization code was removed in
2a915734a32c5aec9a6a76c13bcb074d30e64171 at the same time as it was added
to vsnprintf.
Signed-off-by: Maksim Rayskiy <mrayskiy@broadcom.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Carmelo Amoroso [Fri, 24 Jun 2011 14:27:36 +0000 (16:27 +0200)]
libubacktrace: fix makefile clean target
Fix makefile lean target removing the old reference to the non
existing libubacktrace_ARCH_OUT variable.
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Carmelo Amoroso [Fri, 24 Jun 2011 14:24:25 +0000 (16:24 +0200)]
Merge remote-tracking branch 'origin/master' into prelink
* origin/master: (61 commits)
fts: fix warning due to old-style function definition
ldso_tls: fix compiler warning due to missing cast
resolv: fix bug in res_init with ipv6 nameservers
config: Fix passing defconfig args
buildsys: pt-initfini.s depends on uClibc_config.h
libdl: search for ELF_RTYPE_CLASS_DLSYM in dlsym()
resolv: try next server on SERVFAIL
getaddrinfo: allow numeric service without any hints
bump version to 0.9.33-git
nptl/pthread: Correct path for machine specific pt-initfini.c
ctor/dtor nptl: Fix init and fini function compilation
Rules.mak: Rearrange appending UCLIBC_EXTRA_CFLAGS to CFLAGS
ARM: remove EABI/OABI selection
ARM: detect BX availibility at build time
ARM: #include <bits/arm_asm.h> where __USE_BX__ is used
ARM: transform the EABI/OABI choice into a boolean
ARM: remove sub-arch/variants selection from menuconfig
ARM: introduce blind options to select & force THUMB mode
ARM: reorder "Use BX" option
Fix __libc_epoll_pwait compile failure on x86
...
Conflicts:
ldso/libdl/libdl.c
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Carmelo Amoroso [Fri, 24 Jun 2011 13:05:55 +0000 (15:05 +0200)]
fts: fix warning due to old-style function definition
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Carmelo Amoroso [Mon, 13 Jun 2011 17:58:22 +0000 (19:58 +0200)]
ldso_tls: fix compiler warning due to missing cast
Fix compiler warning (as below) due to missign cast
In file included from ldso/ldso/ldso.c:42:0:
ldso/ldso/dl-tls.c: In function 'init_tls':
ldso/ldso/dl-tls.c:1028:24: error: initialization makes pointer from integer without a cast
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Bernhard Reutner-Fischer [Fri, 17 Jun 2011 18:27:51 +0000 (20:27 +0200)]
resolv: fix bug in res_init with ipv6 nameservers
Thanks to Christian Krause <chkr plauener.de> for finding and fixing
this!
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Tue, 14 Jun 2011 16:48:19 +0000 (18:48 +0200)]
config: Fix passing defconfig args
Don't rely on argument-shuffling but use correct arguments in
the first place.
In bug#3589 Thomas Suckow writes:
The modified kconfig defines -D to be the same function as -d. In
addition -d does not take an argument and Config.in should be passed as
a non-option argument. The existing argument order appears to work on
distributions such as Fedora but chokes on Cygwin (newlib?).
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Tue, 14 Jun 2011 15:51:58 +0000 (17:51 +0200)]
buildsys: pt-initfini.s depends on uClibc_config.h
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Tue, 14 Jun 2011 14:48:51 +0000 (16:48 +0200)]
libdl: search for ELF_RTYPE_CLASS_DLSYM in dlsym()
On FDPIC platforms, functions are passed by function descriptor, not by
pointers. If you don't specify ELF_RTYPE_CLASS_DLSYM when calling
_dl_find_hash() the return value from dlsym() will be a pointer not a
function descriptor, crashing the program.
The bug was introduced when TLS support was added in
534661b91c98492995274c364c8177c45efc63db
Closes bug#3433
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Tue, 14 Jun 2011 14:31:00 +0000 (16:31 +0200)]
resolv: try next server on SERVFAIL
in bug 3637 Andrey Kovalev aka pxe.ru writes:
getaddrinfo does NOT add domain to query when receive SERVFAIL
RFC1035 7.2 suggests that
- If a resolver gets a server error or other bizarre response
from a name server, it should remove it from SLIST, and may
wish to schedule an immediate transmission to the next
candidate server address.
So let's try the next server upon SERVFAIL even if it's not strictly
required.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Natanael Copa [Sun, 12 Jun 2011 12:09:04 +0000 (12:09 +0000)]
getaddrinfo: allow numeric service without any hints
This appears to correspond to what glibc does and this fixes an
issue with iptables-1.4.11 with udp and raw port numbers.
(see http://bugzilla.netfilter.org/show_bug.cgi?id=721)
This fixes #3841
https://bugs.busybox.net/show_bug.cgi?id=3841
Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Tue, 14 Jun 2011 08:27:17 +0000 (10:27 +0200)]
bump version to 0.9.33-git
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Khem Raj [Tue, 14 Jun 2011 00:13:52 +0000 (17:13 -0700)]
nptl/pthread: Correct path for machine specific pt-initfini.c
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Khem Raj [Mon, 13 Jun 2011 23:30:55 +0000 (16:30 -0700)]
ctor/dtor nptl: Fix init and fini function compilation
We need to define the rules for .S files so it
gets the include paths some architectures like mips
include headers
Some architectures e.g. SH have their own version
of pt-initfini.c so look for that first before resorting
to generic version of pt-initfini.c
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Khem Raj [Sat, 11 Jun 2011 07:15:02 +0000 (00:15 -0700)]
Rules.mak: Rearrange appending UCLIBC_EXTRA_CFLAGS to CFLAGS
UCLIBC_EXTRA_CFLAGS is currently added before the OPTIMIZATION flags
and OPTIMIZATION is chosen to be Os by default. But in OE we pass the optimisation
flags through UCLIBC_EXTRA_CFLAGS but they are not effective since -Os is
specified at last. So we need to change the order of these option flags
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Yann E. MORIN [Sun, 9 Jan 2011 00:45:10 +0000 (01:45 +0100)]
ARM: remove EABI/OABI selection
Rely on the compiler to be properly setup for the default ABI.
When installing-headers, there are two cases:
- NPTL: no issue, a cross-compiler is already expected
- LinuxThreads: no issue, EABI/OABI has no impact on installed headers.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Cc: Khem Raj <raj.khem@gmail.com>
Cc: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Cc: Carmelo AMOROSO <carmelo.amoroso@st.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Yann E. MORIN [Sun, 9 Jan 2011 00:45:09 +0000 (01:45 +0100)]
ARM: detect BX availibility at build time
The "use BX" option is now a suggestion that BX be used if available.
Use a macro to detect if BX is available at build time. If so, and
the user requested it be used, then use it. Otherwise, error out.
Macro courtesy Khem RAJ:
http://lists.uclibc.org/pipermail/uclibc/2009-April/042301.html
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Cc: Khem Raj <raj.khem@gmail.com>
Cc: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Cc: Carmelo AMOROSO <carmelo.amoroso@st.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Yann E. MORIN [Sun, 9 Jan 2011 00:45:08 +0000 (01:45 +0100)]
ARM: #include <bits/arm_asm.h> where __USE_BX__ is used
The check for __USE_BX__ will be available in bits/arm_asm.h,
so the latter must be included wherever the former is used.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Cc: Khem Raj <raj.khem@gmail.com>
Cc: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Cc: Carmelo AMOROSO <carmelo.amoroso@st.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Yann E. MORIN [Sun, 9 Jan 2011 00:45:07 +0000 (01:45 +0100)]
ARM: transform the EABI/OABI choice into a boolean
The CONFIG_ARM_OABI option is never used.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Cc: Khem Raj <raj.khem@gmail.com>
Cc: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Cc: Carmelo AMOROSO <carmelo.amoroso@st.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Yann E. MORIN [Sun, 9 Jan 2011 00:45:06 +0000 (01:45 +0100)]
ARM: remove sub-arch/variants selection from menuconfig
Rely on the compiler to be correctly set up to generate
appropriate code for the target variant.
This exposes the Thumb option, as it is no longer auto-selected.
The "Use BX" no longer depends on supported CPU to be selected,
so it now defaults to 'n' as it shall work by default on CPUs
that do not have BX.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Cc: Khem Raj <raj.khem@gmail.com>
Cc: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Cc: Carmelo AMOROSO <carmelo.amoroso@st.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Yann E. MORIN [Sun, 9 Jan 2011 00:45:05 +0000 (01:45 +0100)]
ARM: introduce blind options to select & force THUMB mode
Add three new blind options to set use of Thumb mode:
- COMPILE_IN_THUMB_MODE
- if set, CFLAGS will contain -mthumb
- if unset, the compiler's default is used
- HAS_THUMB
- CPUS with Thumb instruction set can select this
- use of BX depends on this
- FORCE_THUMB
- CPUs that are Thumb-only must select this
- this selects: HAS_THUMB, COMPILE_IN_THUMB_MODE and USE_BX
Also, remove leading space in Rules.mak.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Cc: Khem Raj <raj.khem@gmail.com>
Cc: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Cc: Carmelo AMOROSO <carmelo.amoroso@st.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Yann E. MORIN [Sun, 9 Jan 2011 00:45:04 +0000 (01:45 +0100)]
ARM: reorder "Use BX" option
"Use BX" is not available on all CPUs, so the option depends on
a correct CPU to be chosen . It is weird that e BX" then appears
_above_ the CPU selection, not below.
Move the "Use BX" after the CPU selection.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Cc: Khem Raj <raj.khem@gmail.com>
Cc: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Cc: Carmelo AMOROSO <carmelo.amoroso@st.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Phil Blundell [Sat, 11 Jun 2011 05:10:46 +0000 (01:10 -0400)]
Fix __libc_epoll_pwait compile failure on x86
This prevents "memory input 7 is not directly addressable" errors.
| libc/sysdeps/linux/common/epoll.c: In function '__libc_epoll_pwait':
| libc/sysdeps/linux/common/epoll.c:71:80: error: memory input 7 is not directly addressable
| libc/sysdeps/linux/common/epoll.c:75:86: error: memory input 7 is not directly addressable
| make: *** [libc/sysdeps/linux/common/epoll.o] Error 1
| make: *** Waiting for unfinished jobs....
Signed-off-by: Phil Blundell <pb@pbcl.net>
Signed-off-by: Jason Woodward <jason.woodward@timesys.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Khem Raj [Fri, 10 Jun 2011 20:05:34 +0000 (13:05 -0700)]
nptl/Makefile.in: Fix the build break caused by UCLIBC_CTOR_DTOR enabling
Extra / somehow does not match the target and complains that
$(top_builddir)libpthread/nptl/sysdeps/pthread/crti.o has no rules to
build
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Carmelo Amoroso [Mon, 30 May 2011 12:22:57 +0000 (14:22 +0200)]
buildsys: fix pregen target (!NPTL with LOCALE)
When NPTL is not enabled, and LOCALE support is used, compilation fails
with the following error:
-------------------------------------------------------------------------
MKDIR include/bits
GEN include/bits/sysnum.h
make[1]: *** No rule to make target `../..//include/bits/uClibc_ctype.h', needed by `../../extra/locale/gen_wc8bit.c'. Stop.
make: *** [pregen] Error 2
-------------------------------------------------------------------------
The problem is that "headers" is not listed as prerequisite of pregen.
These have been changed multiple times recently:
o Austin: order headers before pregen-headers
1f5c73c9f8a98b1d2a35cea868a585c97ab0e436
o Khem: pregen: Fix the parallel build problem in pregen target
046035ecde92262d96eff2192ba3cda716f04909
o Khem: pregen-headers: Add new target which depends on headers.
ef18cfe8ebab25f5ef92e81956f50e2dc57df602
o Carmelo: build: Fix infinite loop when no threading support is enabled
ff5e4de7088fe8d34812c2a1e604bf04be713606
In all of these commits headers was actually as prerequisite
In commit
9381d622e2411a35a5fd73a5a573eb269e2dd9c9 [nptl: fix buildsys] by Bernhard, headers was removed,
causing the problem reported above.
Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Bernhard Reutner-Fischer [Tue, 31 May 2011 07:47:12 +0000 (09:47 +0200)]
libubacktrace: Fix ASNEEDED emission
In master the variable is called SHARED_LIBNAME and not
SHARED_MAJORNAME.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Tue, 31 May 2011 07:45:44 +0000 (09:45 +0200)]
NPTL: Fix CTOR_DTOR
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Filippo Arcidiacono [Fri, 27 May 2011 15:36:20 +0000 (17:36 +0200)]
libc: make common longjmp usable with NPTL
Call _longjmp_unwind conditionally under NPTL config option,
making longjmp usable with NPTL.
Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Filippo Arcidiacono [Fri, 27 May 2011 15:17:51 +0000 (17:17 +0200)]
sh: use the common implementation for longjmp
Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Filippo Arcidiacono [Fri, 27 May 2011 15:08:36 +0000 (17:08 +0200)]
sh: fix build in !NPTL case
Fix build issue due to missing symbols in !NPTL case:
- vfork
- _longjmp_unwind
Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Alan Davis [Thu, 26 May 2011 16:15:06 +0000 (18:15 +0200)]
Correct a bug when remapping textrel segments on nommu
From: Alan Davis <adavis@ti.com>
On C6X, when trying to execute a program that has a textrel DSO, it
fails to load. The telltale line in the LD_DEBUG output is:
_dl_get_ready_to_run:779: file=''; needed by './a.out'
The corresponding DT_NEEDED entry has 'libc.so.0', but here the
filename is empty. This is what is happening in
_dl_elf_shared_library():
First, map all segments according to their permissions. Text gets
initially mapped read-only.
Then, parse the dynamic information. The dynamic table is in RW but
some of the tags may point to RO. For example, DT_NEEDED points to a
string in .dynstr which is in RO. These pointers get computed
according to the loadmap from the original mapping.
Then, in response to a DT_TEXTREL tag, the RO segment gets remapped,
thereby invaliding anything that points to it, in particular certain
dynamic tags such as DT_NEEDED.
The following patch re-parses the dynamic info after the remapping so
as to re-compute any invalid pointers.
Signed-off-by: Alan Davis <adavis@ti.com>
Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
Khem Raj [Fri, 13 May 2011 22:31:06 +0000 (15:31 -0700)]
unwind.h: Move to libc/sysdeps from nptl sysdeps
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Bernhard Reutner-Fischer [Fri, 13 May 2011 10:16:29 +0000 (12:16 +0200)]
epoll: redo cancellation to match master
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Peter S. Mazinger [Thu, 12 May 2011 23:56:08 +0000 (01:56 +0200)]
epoll.c: add cancellation to epoll_[p]wait()
While there, fix epoll_pwait syscall, it takes 6 arguments
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Thu, 12 May 2011 10:26:41 +0000 (12:26 +0200)]
libm: fix building out-of-tree
Thanks to Thierry Reding for noticing!
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Thu, 12 May 2011 10:11:14 +0000 (12:11 +0200)]
wordexp: fix mishandled return value of pipe call
and use pipe2 if available while at it.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Thu, 12 May 2011 08:37:36 +0000 (10:37 +0200)]
linux_specific: handle accept4 and pipe2
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Thu, 12 May 2011 08:30:48 +0000 (10:30 +0200)]
NPTL: needs madvise internally
This fixes
8d09a50a044638fde2ed3e1a1c4d3c7c5a3cce5c since NPTL also uses
madvise internally.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Thu, 12 May 2011 08:07:25 +0000 (10:07 +0200)]
socket: fix stubs
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Wed, 11 May 2011 20:22:51 +0000 (22:22 +0200)]
commentary typo fix
s/decriptor/descriptor/
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Wed, 11 May 2011 20:17:23 +0000 (22:17 +0200)]
epoll: unify epoll.h
Bernhard Reutner-Fischer [Wed, 11 May 2011 20:03:33 +0000 (22:03 +0200)]
commentary typo fix
use cancellation (with two 'l') uniformly.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Thierry Reding [Wed, 11 May 2011 07:28:13 +0000 (09:28 +0200)]
Implement epoll_create1 and epoll_pwait system calls.
Note: TODO: This lacks cancellation support.
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Wed, 11 May 2011 19:16:23 +0000 (21:16 +0200)]
buildsys: document UCLIBC_EXTRA_CPPFLAGS
Rename EXTRA_CPPFLAGS to UCLIBC_EXTRA_CPPFLAGS and make them override
previous flags (by appending - not prepending - them to the other flags).
Bernhard Reutner-Fischer [Wed, 11 May 2011 18:42:18 +0000 (20:42 +0200)]
lll: avoid shadow warnings
use __ret uniformly to avoid shadow warnings as seen on x86_64.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Wed, 11 May 2011 18:29:59 +0000 (20:29 +0200)]
x86_64: add TODO for R_X86_64_RELATIVE
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Wed, 11 May 2011 17:52:16 +0000 (19:52 +0200)]
libubacktrace: mv unwind.h to include
Fixes compilation if NPTL is off.
I hope this doesn't break ARM EABI but cannot check ATM.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Wed, 11 May 2011 17:16:17 +0000 (19:16 +0200)]
Revert "libubacktrace: fix config-symbol handling"
This reverts commit
7a080cd149c7b25d415d76506510d55b34819fc2.
This symbol is in fact different (as it is set no 'n').
Bernhard Reutner-Fischer [Wed, 11 May 2011 11:12:14 +0000 (13:12 +0200)]
add pipe2()
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Wed, 11 May 2011 10:05:20 +0000 (12:05 +0200)]
socketcalls: add stubs
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Wed, 11 May 2011 09:31:45 +0000 (11:31 +0200)]
accept4: Implement cancellation
.. and add proper prototype, move it into it's own obj and other such
cleanups.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Thierry Reding [Wed, 11 May 2011 06:40:58 +0000 (08:40 +0200)]
Implement accept4 system call.
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Fri, 6 May 2011 17:07:12 +0000 (19:07 +0200)]
libubacktrace: fix config-symbol handling
Config symbals that are not set are empty, not 'n'.
Bernhard Reutner-Fischer [Wed, 11 May 2011 07:37:35 +0000 (09:37 +0200)]
buildsys: Turn on strict aliasing for everyone
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Tue, 10 May 2011 19:22:25 +0000 (21:22 +0200)]
ldso: commentary typo fix
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Tue, 10 May 2011 18:19:46 +0000 (20:19 +0200)]
getcwd: Fix memory-leak in error path
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Tue, 10 May 2011 18:09:36 +0000 (20:09 +0200)]
__uc_malloc: Fix memory-leak in error path
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Filippo Arcidiacono [Fri, 6 May 2011 14:49:28 +0000 (16:49 +0200)]
libdl: fix local symbol's address handling in dladdr
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>
Bernhard Reutner-Fischer [Tue, 10 May 2011 08:03:58 +0000 (10:03 +0200)]
*/crtn.S: Remove .size directive for _init and _fini
These are split across objects so setting size does not (and never did)
work since the expression cannot be computed at assembly time.
This avoids errors from recent (> 2.21) gas.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Timo Teräs [Wed, 20 Apr 2011 10:59:15 +0000 (13:59 +0300)]
posix_fadvise64: fix x86 implementation
Commit
73d59554144f429b1cf0d4d7fa7de42bdf59ad92 completely broke
the x86 implementation of posix_fadvise64. It moved the first
the assembly code retn instruction gets missing depending on the
Technically the file has two implementaions for posix_fadvise64,
one when __NR_fadvise64_64 is available, and second one if only
__NR_fadvise64 is there. Fix the #ifdef's to be proper for that.
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Bernhard Reutner-Fischer [Thu, 5 May 2011 07:33:14 +0000 (09:33 +0200)]
i386: fix .size of _init/_fini
binutils-2.21 barf on .size that do not evaluate to const, so use
the section size and not a function that is not visible here.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Thu, 5 May 2011 07:27:15 +0000 (09:27 +0200)]
x86_64: fix .size of _init/_fini
binutils-2.21 barf on .size that do not evaluate to const, so use the
section size and not a function that is not visible here.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Thu, 5 May 2011 07:19:16 +0000 (09:19 +0200)]
Revert "*/crt?.S: remove .size directives"
Removing them generally was not a good idea
This reverts commit
233c504cd940d9802226b6a3a092368b86978f5e.
Bernhard Reutner-Fischer [Wed, 4 May 2011 08:01:24 +0000 (10:01 +0200)]
*/crt?.S: remove .size directives
sed -i -e '/\.size[[:space:]]/d' $(grep -l "\.size" libc/sysdeps/linux/*/crt*.[sSc])
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Carmelo Amoroso [Wed, 4 May 2011 06:31:16 +0000 (08:31 +0200)]
Merge remote-tracking branch 'origin/master' into prelink
* origin/master: (32 commits)
libubacktrace: fix backtrace support on arm-eabi, which needs libgcc_eh linked too
getaddrinfo.c: fix incorrect check for ERANGE from gethostbyaddr_r
getaddrinfo.c: improve code readability. No functional changes
string: remove unused variable
x86_64: silence warning if !TLS
buildsys: prettify ssp.c handling
madvise is LINUX_SPECIFIC
test_nptl: fix expected result for tst-cputimer[123]
test_nptl: fix expected result for tst-clock2 test
buildsys: make $(LOCAL_INSTALL_PATH) phony
ether_aton: reject invalid input
tests: disable ether tests if !HAS_SOCKET
inet: add ether_aton testcase
sysconf: clock_getres depends on HAS_REALTIME
__rt_sigwaitinfo: depends on HAS_REALTIME
buildsys: minor fixes in Makefile.arch for C6X
buildsys: minor fixes in Makefile.arch for microblaze
libubacktrace: enabled for all archs indeed.
sparc: don't access fp registers when configured for no fpu
libubacktrace: generic implementation based dwarf
...
Conflicts:
ldso/ldso/dl-elf.c
ldso/ldso/mips/elfinterp.c
ldso/ldso/x86_64/elfinterp.c
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Henning Heinold [Fri, 29 Apr 2011 11:58:02 +0000 (13:58 +0200)]
libubacktrace: fix backtrace support on arm-eabi, which needs libgcc_eh linked too
Signed-off-by: Henning Heinold <heinold@inf.fu-berlin.de>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Denys Vlasenko [Tue, 3 May 2011 15:29:35 +0000 (17:29 +0200)]
getaddrinfo.c: fix incorrect check for ERANGE from gethostbyaddr_r
Also, freeaddrinfo(NULL) is ok, no need to check parameted for NULL
before calling it.
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Denys Vlasenko [Tue, 3 May 2011 15:28:19 +0000 (17:28 +0200)]
getaddrinfo.c: improve code readability. No functional changes
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Bernhard Reutner-Fischer [Tue, 3 May 2011 14:40:31 +0000 (16:40 +0200)]
string: remove unused variable
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Tue, 3 May 2011 14:36:15 +0000 (16:36 +0200)]
x86_64: silence warning if !TLS
TODO: fix all other arches
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Tue, 3 May 2011 14:24:08 +0000 (16:24 +0200)]
buildsys: prettify ssp.c handling
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer [Tue, 3 May 2011 14:15:30 +0000 (16:15 +0200)]
madvise is LINUX_SPECIFIC
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Filippo Arcidiacono [Tue, 3 May 2011 07:32:53 +0000 (09:32 +0200)]
test_nptl: fix expected result for tst-cputimer[123]
Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>