OSDN Git Service

uclinux-h8/uClibc.git
13 years agonptl: fix compilation on x86_64
William Pitcock [Tue, 8 Mar 2011 08:12:11 +0000 (02:12 -0600)]
nptl: fix compilation on x86_64

This commit gives us a fully functioning NPTL on x86-64 by using the GOTOFF macro
as needed.

Signed-off-by: William Pitcock <nenolod@dereferenced.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 years agoshm.h: fix vax's bits/shm.h
Peter S. Mazinger [Tue, 8 Mar 2011 16:23:30 +0000 (17:23 +0100)]
shm.h: fix vax's bits/shm.h

Do not use __ipc_pid_t, since that is not visible after install.
Provide and use shmatt_t.
Add missing __END_DECLS.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agoMakefile.in: remove uClibc_fpmax.h independently of any config option
Peter S. Mazinger [Tue, 8 Mar 2011 14:50:01 +0000 (15:50 +0100)]
Makefile.in: remove uClibc_fpmax.h independently of any config option

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agoresolv.h: disable unneeded prototypes
Peter S. Mazinger [Tue, 8 Mar 2011 13:01:04 +0000 (14:01 +0100)]
resolv.h: disable unneeded prototypes

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agoMakefile.in: remove uClibc_uwchar.h and uClibc_va_copy.h on install
Peter S. Mazinger [Tue, 8 Mar 2011 13:00:06 +0000 (14:00 +0100)]
Makefile.in: remove uClibc_uwchar.h and uClibc_va_copy.h on install

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agoMakerules: respect HARDWIRED_ABSPATH in interp.c
Peter S. Mazinger [Tue, 8 Mar 2011 11:56:13 +0000 (12:56 +0100)]
Makerules: respect HARDWIRED_ABSPATH in interp.c

Build LDSO path according to the HARDWIRED_ABSPATH setting
While there, remove duplicated slashes in interp.c

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agotry to fix duplicated slashes in the generated lib*.so files (round 2)
Peter S. Mazinger [Tue, 8 Mar 2011 11:49:10 +0000 (12:49 +0100)]
try to fix duplicated slashes in the generated lib*.so files (round 2)

sed s://:/:g on libc.so/libpthread.so if HARDWIRED_ABSPATH is defined

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agoRevert "buildsys: prefer the form HEADERS_RM-$(<config>)"
Carmelo Amoroso [Tue, 8 Mar 2011 10:39:48 +0000 (11:39 +0100)]
Revert "buildsys: prefer the form HEADERS_RM-$(<config>)"

This reverts commit 07044019e6260991729926645e7d221f38376f9d.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agobuildsys: prefer the form HEADERS_RM-$(<config>)
Carmelo Amoroso [Mon, 7 Mar 2011 17:31:19 +0000 (18:31 +0100)]
buildsys: prefer the form HEADERS_RM-$(<config>)

Fix removal of sgtty.h using HEADERS_RM-$(<config>) syntax.
Sort it alphabetically.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agolocale.c: export newlocale only if XLOCALE is defined
Peter S. Mazinger [Mon, 7 Mar 2011 16:39:14 +0000 (17:39 +0100)]
locale.c: export newlocale only if XLOCALE is defined

newlocale is used by setlocale, so we need the hidden version
even if XLOCALE is not defined

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agolocale.c, locale.h: no need for hidden duplocale
Peter S. Mazinger [Mon, 7 Mar 2011 16:28:57 +0000 (17:28 +0100)]
locale.c, locale.h: no need for hidden duplocale

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agosimplify ffs* code
Peter S. Mazinger [Sun, 6 Mar 2011 16:08:38 +0000 (17:08 +0100)]
simplify ffs* code

Remove __libc_ffs*, unneeded

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agoremove unused ARCH_CFLAGS and ARCH_LDFLAGS
Peter S. Mazinger [Sun, 6 Mar 2011 16:02:56 +0000 (17:02 +0100)]
remove unused ARCH_CFLAGS and ARCH_LDFLAGS

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agoRevert "try to fix duplicated slashes in the generated lib*.so files"
Peter S. Mazinger [Sun, 6 Mar 2011 14:40:09 +0000 (15:40 +0100)]
Revert "try to fix duplicated slashes in the generated lib*.so files"

This reverts commit 624be66cb9b350d5c6538fca8592cdb3a4c23d37.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agoImplement ffsl and ffsll.
Bernd Schmidt [Tue, 22 Feb 2011 23:14:42 +0000 (00:14 +0100)]
Implement ffsl and ffsll.

This imports and adapts ffsll.c from glibc. The same mechanism as in glibc
is used to choose between ffs and ffsll to implement ffsl. The single user
in libc is changed to use the hidden version __libc_ffs.

Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
Acked-by: Bernhard Reutner-Fischer <aldot@uclibc.org>
13 years agoAdd sanity checks to ld.so DSBT support
Mark Salter [Wed, 2 Mar 2011 20:12:48 +0000 (21:12 +0100)]
Add sanity checks to ld.so DSBT support

This adds some DSBT index sanity checks to the runtime linker. It
catches libraries which have no index (index 0) and libraries which
try to use an already used index.

Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
13 years agoThe C6X port
Aurelien Jacquiot [Wed, 23 Feb 2011 12:04:59 +0000 (13:04 +0100)]
The C6X port

This adds support for the TI C6X family of processors.

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>
13 years agoAllow ABIs where SP points below the stack frame.
Bernd Schmidt [Wed, 23 Feb 2011 01:57:49 +0000 (02:57 +0100)]
Allow ABIs where SP points below the stack frame.

On C6X, the stack pointer points to a word that is not part of the current
function's stack frame.  It may be overwritten by callees.  Take this into
account when creating the stack for a cloned thread.

Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
13 years agoAdd support for DSBT ELF to ld.so
Mark Salter [Wed, 23 Feb 2011 11:56:43 +0000 (12:56 +0100)]
Add support for DSBT ELF to ld.so

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>
13 years agoAdd Makefile support for DSBT ELF.
Bernd Schmidt bernds_cb1@t-online.de [Wed, 2 Mar 2011 17:22:01 +0000 (18:22 +0100)]
Add Makefile support for DSBT ELF.

This adds support for a new binary format, DSBT ELF, to the Makefiles.
Every shared library is assigned a DSBT index, and the link.so macro is
adjusted to ensure the correct linker argument is passed.

Configuration and ldso support will follow in separate commits.

Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agofix locale build
Peter S. Mazinger [Fri, 4 Mar 2011 17:28:26 +0000 (18:28 +0100)]
fix locale build

make xlocale.h a dummy, locale_t is needed without it and
uClibc_locale.h is already included by locale.h

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agofix removal of sgtty.h
Peter S. Mazinger [Fri, 4 Mar 2011 12:18:27 +0000 (13:18 +0100)]
fix removal of sgtty.h

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agonptl: fix use of IS_IN_LIBPTHREAD macro
Carmelo Amoroso [Fri, 4 Mar 2011 12:04:13 +0000 (13:04 +0100)]
nptl: fix use of IS_IN_LIBPTHREAD macro

IS_IN_LIBPTHREAD should be IS_IN_libpthread instead.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agoremove obsoleted and incorrect comment
Peter S. Mazinger [Thu, 3 Mar 2011 15:23:05 +0000 (16:23 +0100)]
remove obsoleted and incorrect comment

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agoprovide internal hidden version of __fcntl_nocancel
Peter S. Mazinger [Thu, 3 Mar 2011 15:04:03 +0000 (16:04 +0100)]
provide internal hidden version of __fcntl_nocancel

guard the prototype with _LIBC, it is only for internal use

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agoadd _dl_errno support to errno.h, cleanup
Peter S. Mazinger [Thu, 3 Mar 2011 14:06:47 +0000 (15:06 +0100)]
add _dl_errno support to errno.h, cleanup

Add support to use errno.h in ldso.
Move __set_errno into _LIBC guard.
Remove uClibc_errno.h, unused.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agodo not enforce FORCE_SHAREABLE_TEXT_SEGMENTS on sh4
Peter S. Mazinger [Thu, 3 Mar 2011 12:52:34 +0000 (13:52 +0100)]
do not enforce FORCE_SHAREABLE_TEXT_SEGMENTS on sh4

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agosgtty.h is useless, remove it on STRICT_HEADERS
Peter S. Mazinger [Thu, 3 Mar 2011 12:20:21 +0000 (13:20 +0100)]
sgtty.h is useless, remove it on STRICT_HEADERS

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agopaths.h: add _PATH_GSHADOW
Peter S. Mazinger [Thu, 3 Mar 2011 12:08:54 +0000 (13:08 +0100)]
paths.h: add _PATH_GSHADOW

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agoguard nl_catd structure and related constants with STRICT_HEADERS
Peter S. Mazinger [Thu, 3 Mar 2011 11:44:18 +0000 (12:44 +0100)]
guard nl_catd structure and related constants with STRICT_HEADERS

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agobetter guard of IPV6 related stuff
Peter S. Mazinger [Thu, 3 Mar 2011 11:35:29 +0000 (12:35 +0100)]
better guard of IPV6 related stuff

Function prototypes are visible whenever IPV6 option is enabled.
Structures and constants are visible either if IPV6 is enabled
or STRICT_HEADERS is disabled.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agodo not care about libc-internal.h, remove hp-timing.h
Peter S. Mazinger [Thu, 3 Mar 2011 11:17:42 +0000 (12:17 +0100)]
do not care about libc-internal.h, remove hp-timing.h

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agostrcpy: remove unneeded includes from the generic version
Peter S. Mazinger [Thu, 3 Mar 2011 10:41:44 +0000 (11:41 +0100)]
strcpy: remove unneeded includes from the generic version

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agoupdate some headers
Peter S. Mazinger [Thu, 3 Mar 2011 10:37:16 +0000 (11:37 +0100)]
update some headers

Sync some headers with glibc.
realpath is an XSI extension in SuSv4, add back guard and update comment,
since it seems to allow != NULL in second arg.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agoupdate some headers
Peter S. Mazinger [Wed, 2 Mar 2011 23:37:29 +0000 (00:37 +0100)]
update some headers

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agomake it possible to compile with -std=gnu99/c99 and use extern inlines
Peter S. Mazinger [Wed, 2 Mar 2011 21:42:47 +0000 (22:42 +0100)]
make it possible to compile with -std=gnu99/c99 and use extern inlines

When compiled with -std=gnu99/c99 __GNUC_GNU_INLINE__ is not defined

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agosimplify guard of uClibc internals
Peter S. Mazinger [Wed, 2 Mar 2011 21:30:10 +0000 (22:30 +0100)]
simplify guard of uClibc internals

Simplify guard of uClibc internals, since _LIBC sections are removed on install.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agoremove libc-internal.h on install
Peter S. Mazinger [Wed, 2 Mar 2011 21:24:26 +0000 (22:24 +0100)]
remove libc-internal.h on install

Remove libc-internal.h on install, I think internal is a typo.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agoremove ucontext.h and guard sigstack structure with SUSV4_LEGACY and STRICT_HEADERS
Peter S. Mazinger [Wed, 2 Mar 2011 20:59:58 +0000 (21:59 +0100)]
remove ucontext.h and guard sigstack structure with SUSV4_LEGACY and STRICT_HEADERS

Remove ucontext.h if SUSV4_LEGACY is not set and fix it's references.
Guard sigstack structure with SUSV4_LEGACY and STRICT_HEADERS.
Disable sigstack function prototype, it is not provided by uClibc.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agomake parse_printf_format() depend on UCLIBC_HAS_GLIBC_CUSTOM_PRINTF
Peter S. Mazinger [Wed, 2 Mar 2011 14:31:00 +0000 (15:31 +0100)]
make parse_printf_format() depend on UCLIBC_HAS_GLIBC_CUSTOM_PRINTF

we already remove the printf.h header if this option is disabled

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agoremove error handling from some syscalls
Peter S. Mazinger [Wed, 2 Mar 2011 14:06:51 +0000 (15:06 +0100)]
remove error handling from some syscalls

Remove error handling from getegid/getgid/geteuid/getuid/getppid/getpid/getpgrp
Use strong_alias if fallbacks are needed

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agofix dependency on ADVANCED_REALTIME
Peter S. Mazinger [Sat, 26 Feb 2011 23:25:56 +0000 (00:25 +0100)]
fix dependency on ADVANCED_REALTIME

Do not depend on ADVANCED REALTIME for mq_send/mq_receive
Added stubs implementation based on libc's stubs.c

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agofix stubs
Peter S. Mazinger [Sat, 26 Feb 2011 23:20:58 +0000 (00:20 +0100)]
fix stubs

We use enosys_stub only in this file so make it static

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agoinitialize 2 variables to get rid of compiler warning
Peter S. Mazinger [Sat, 26 Feb 2011 21:13:19 +0000 (22:13 +0100)]
initialize 2 variables to get rid of compiler warning

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agoCorrect ssp code
Peter S. Mazinger [Sat, 26 Feb 2011 20:49:38 +0000 (21:49 +0100)]
Correct ssp code

Avoid using strong_alias in ssp, some archs dislike it.
Make stack_chk_guard static.
Export __stack_smash_handler only if compatibility option is enabled.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agoadd missing prototypes
Peter S. Mazinger [Sat, 26 Feb 2011 18:41:29 +0000 (19:41 +0100)]
add missing prototypes

Add some missing prototypes

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agouse common sigthread.h
Peter S. Mazinger [Sat, 26 Feb 2011 18:33:21 +0000 (19:33 +0100)]
use common sigthread.h

NPTL build did not use the correct bits/sigthread.h, use a common version
avoiding this.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agoadd missing prototypes
Peter S. Mazinger [Sat, 26 Feb 2011 18:31:39 +0000 (19:31 +0100)]
add missing prototypes

Add some missing prototypes

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agostyle update
Peter S. Mazinger [Sat, 26 Feb 2011 18:28:53 +0000 (19:28 +0100)]
style update

Style update avoiding compile warnings

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agosyntax fixes
Peter S. Mazinger [Sat, 26 Feb 2011 18:26:30 +0000 (19:26 +0100)]
syntax fixes

Avoid compile warnings about the use of undefined constants

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agoavoid warnings on _STACK_GROWS_* usage
Peter S. Mazinger [Sat, 26 Feb 2011 18:23:10 +0000 (19:23 +0100)]
avoid warnings on _STACK_GROWS_* usage

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agosyntax fix
Peter S. Mazinger [Sat, 26 Feb 2011 18:20:18 +0000 (19:20 +0100)]
syntax fix

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agotry to fix duplicated slashes in the generated lib*.so files
Peter S. Mazinger [Sat, 26 Feb 2011 18:15:32 +0000 (19:15 +0100)]
try to fix duplicated slashes in the generated lib*.so files

Try to fix duplicated slashes in the generated lib*.so files
and make sure that on installation the *bin directories are
really created (avoid the misbehaviour of creating usrbin dir).

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agoinitialize tls_tpnt to NULL on all archs
Peter S. Mazinger [Sat, 26 Feb 2011 18:09:46 +0000 (19:09 +0100)]
initialize tls_tpnt to NULL on all archs

Initialize tls_tpnt to NULL on all archs instead of 0.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agodisable build warnings in utils
Peter S. Mazinger [Sat, 26 Feb 2011 17:52:21 +0000 (18:52 +0100)]
disable build warnings in utils

Disable some build warnings in utils.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agoguard IPv6 stuff
Peter S. Mazinger [Sat, 26 Feb 2011 17:45:19 +0000 (18:45 +0100)]
guard IPv6 stuff

disable IPv6 related stuff if feature is disabled.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agoadd UCLIBC_STRICT_HEADERS config option
Peter S. Mazinger [Sat, 26 Feb 2011 17:28:19 +0000 (18:28 +0100)]
add UCLIBC_STRICT_HEADERS config option

Add config option to disable the visibility of structures/constants
that should not be visible unless a feature is enabled.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agoinclude features.h
Peter S. Mazinger [Sat, 26 Feb 2011 17:15:29 +0000 (18:15 +0100)]
include features.h

include features.h to make the next ifdef work.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
13 years agoldso: use ADDR_ALIGN instead of hard-coded value
Carmelo Amoroso [Thu, 3 Mar 2011 08:22:15 +0000 (09:22 +0100)]
ldso: use ADDR_ALIGN instead of hard-coded value

Use ADDR_ALIGN to align the minvma when loading shared libraries instead
of the hard coded 0xffffU value.
This fixes teh stand/alone support on ARM as reported in bug #3133.

Signed-off-by: Sven Ola <sven-ola@gmx.de>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agonptl:arm: add a wrapper for .cfi_sections pseudo-ops
Carmelo Amoroso [Mon, 7 Feb 2011 17:03:36 +0000 (18:03 +0100)]
nptl:arm: add a wrapper for .cfi_sections pseudo-ops

ARM disables by default the support for ASM CFI directives.
Anyway using an old version of binutils that does not support some new
pseudo-op, the build fails as below:

  AS libpthread/nptl/sysdeps/unix/sysv/linux/close.oS
libpthread/nptl/sysdeps/unix/sysv/linux/close.S: Assembler messages:
libpthread/nptl/sysdeps/unix/sysv/linux/close.S:9: Error: unknown pseudo-op: `.cfi_sections'

The problem is that the .cfi_sections pseudo should be wrapped by a macro
that expands to nothing when the CFI is off.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
CC: Khem Ray <ray.khem@gmail.com>
13 years agolinuxthreads.old: fix nommu initial thread stack detection
Mike Frysinger [Mon, 21 Feb 2011 22:19:35 +0000 (17:19 -0500)]
linuxthreads.old: fix nommu initial thread stack detection

Because the nommu address space is flat, and the application stack can
literally be located anywhere, we cannot rely on the assumptions that the
mmu port gets away with.  Namely, that the first thread's stack lives at
the top of memory and nothing will be created above it.

Currently, the code rounds the current stack up a page and sets that as
the "top" of the stack, and then marks the "bottom" of the stack as "1".
Then as new threads are created, this assumption is further refined by
slowly backing off the "bottom" when a new stack is created within the
range of the initial stack.

Simple ascii example (tid0 is the initial thread):

1 thread:
 [bos          tid0 stack           tos]

2 threads:
                 [     tid0 stack      ]
      [tid1 stack]

3 threads:
                 [     tid0 stack      ]
      [tid1 stack]
                                            [tid2 stack]

As you can kind of see, this algorithm operates on one basic assumption:
the initial top of stack calculation is the absolute top of the stack.
While this assumption was fairly safe in the original nommu days of yore
where the only file format was FLAT (which defaults to a 4KiB stack --
exactly 1 page), and memory was fairly tight, we can see that this falls
apart pretty quickly as soon as the initial stack is larger than a page.

The issue that crops up now is simple to hit: start an application with
an 8KiB stack, execute some functions that put pressure on the stack so
that it exceeds 4KiB, then start up some threads.  The initial tos will
be rounded up by a page, but this is actually the middle of the stack.
Now when the initial thread returns from its functions (thus unwinding
the stack) and tries to call something which calls back into libpthread,
the thread_self() func fails to detect itself as the initial thread as
the current stack is now above the tos.  The __pthread_find_self() func
kicks in, walks all the thread arrays, fails to find a hit, and then
walks into uninitialized memory for the thread descriptor.  Use of this
garbage memory has obvious results -- things fall down & go boom.

To address this, I extend the current algorithm to automatically scale
back both the bottom and the top stack limits of the initial thread.
We use the current stack pointer at "thread boot time" only as a single
known point.  The initial thread stack bottom is set to the bottom of
memory and the initial thread stack top is set to the top of memory.
Then as we create new stack threads, we figure out whether the new stack
is above or below the single known good address, and then scale back
either the tos or the bos accordingly.

Reviewed-by: Steven J. Magnani <steve@digidescorp.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agounify stub logic
Mike Frysinger [Thu, 23 Jul 2009 05:11:38 +0000 (01:11 -0400)]
unify stub logic

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agobfin: fix fp reference in _JMPBUF_UNWINDS
Mike Frysinger [Tue, 22 Feb 2011 21:23:23 +0000 (16:23 -0500)]
bfin: fix fp reference in _JMPBUF_UNWINDS

We want to access the frame pointer, so do so directly rather than
"overflowing" the pregs array and ending up at the fp member.

This fixes the Blackfin build warnings:
libpthread/linuxthreads.old/ptlongjmp.c: In function 'pthread_cleanup_upto':
libpthread/linuxthreads.old/ptlongjmp.c:35: warning: array subscript is above array bounds
libpthread/linuxthreads.old/ptlongjmp.c:56: warning: array subscript is above array bounds

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agotempname: fix int precision warnings
Mike Frysinger [Tue, 22 Feb 2011 02:29:58 +0000 (21:29 -0500)]
tempname: fix int precision warnings

The printf precision takes an integer, not a size_t.  Otherwise we get:

libc/misc/internals/tempname.c: In function '___path_search':
libc/misc/internals/tempname.c:116: warning:
field precision should have type 'int', but argument 3 has type 'size_t'
field precision should have type 'int', but argument 5 has type 'size_t'

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agonptl: imit waitpid just for MIPS O32
Bernhard Reutner-Fischer [Tue, 22 Feb 2011 17:12:26 +0000 (18:12 +0100)]
nptl: imit waitpid just for MIPS O32

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agoldso: fix fdpic builds
Mike Frysinger [Tue, 22 Feb 2011 01:25:29 +0000 (20:25 -0500)]
ldso: fix fdpic builds

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>
13 years agobfin: add support for new cacheflush syscall
Steve Kilbane [Tue, 22 Feb 2011 00:44:42 +0000 (19:44 -0500)]
bfin: add support for new cacheflush syscall

Newer gcc's will generate a call to cacheflush when updating jump tables,
and that has to be done in kernel space (to avoid hardware anomalies).  So
make sure uClibc provides that symbol.

Signed-off-by: Steve Kilbane <steve@whitecrow.demon.co.uk>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agobfin: fix sram/dma syscall definitions
Steve Kilbane [Tue, 22 Feb 2011 00:43:32 +0000 (19:43 -0500)]
bfin: fix sram/dma syscall definitions

Once we pull in the header, we're forced to declare the syscall with
all the right types.

Signed-off-by: Steve Kilbane <steve@whitecrow.demon.co.uk>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agobfin: add missing GNU-stack markings to __longjmp
Mike Frysinger [Tue, 22 Feb 2011 00:38:39 +0000 (19:38 -0500)]
bfin: add missing GNU-stack markings to __longjmp

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agobuildsys: fix inverted logic with thread impls
Bernhard Reutner-Fischer [Wed, 16 Feb 2011 18:31:06 +0000 (19:31 +0100)]
buildsys: fix inverted logic with thread impls

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agobuildsys: use kbuild style
Bernhard Reutner-Fischer [Mon, 14 Feb 2011 19:54:57 +0000 (20:54 +0100)]
buildsys: use kbuild style

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agobuildsys: remove wrong file
Bernhard Reutner-Fischer [Sun, 13 Feb 2011 17:31:27 +0000 (18:31 +0100)]
buildsys: remove wrong file

Somehow Makefile.in ended in there, remove it.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agoarm: use EABI per default
Bernhard Reutner-Fischer [Sun, 13 Feb 2011 15:45:43 +0000 (16:45 +0100)]
arm: use EABI per default

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agoregex: remove set but not used variable
Bernhard Reutner-Fischer [Sun, 13 Feb 2011 15:19:12 +0000 (16:19 +0100)]
regex: remove set but not used variable

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agoldso: remove now unused variable
Bernhard Reutner-Fischer [Sun, 13 Feb 2011 15:09:00 +0000 (16:09 +0100)]
ldso: remove now unused variable

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agonptl: fix typo in buildsys
Bernhard Reutner-Fischer [Sun, 13 Feb 2011 14:56:30 +0000 (15:56 +0100)]
nptl: fix typo in buildsys

0f85b228 used 'filter-pout' instead of 'filter-out'. Fix that.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agoFORMAT_FDPIC_ELF: only for FRV and BFIN
Bernhard Reutner-Fischer [Sun, 13 Feb 2011 14:50:48 +0000 (15:50 +0100)]
FORMAT_FDPIC_ELF: only for FRV and BFIN

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agoFix memory leak in dlopen()/dlclose().
Philip Craig [Tue, 8 Feb 2011 06:11:38 +0000 (16:11 +1000)]
Fix memory leak in dlopen()/dlclose().

The linked list of library dependencies created by dlopen() was not
being freed by dlclose().

Signed-off-by: Philip Craig <philipjcraig@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agoFix GNU make v3.80 compatibility
Kevin Cernekee [Thu, 10 Feb 2011 22:30:55 +0000 (14:30 -0800)]
Fix GNU make v3.80 compatibility

Commits 1f6601a and 094d82d introduced the "else ifeq" construct, which
requires GNU make v3.81 or higher.  This breaks the build on RHEL4 hosts.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agoarm: use CAS gcc builtin if SI-mode pattern is available
Bernhard Reutner-Fischer [Fri, 11 Feb 2011 16:26:19 +0000 (17:26 +0100)]
arm: use CAS gcc builtin if SI-mode pattern is available

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agoTODO: update
Bernhard Reutner-Fischer [Wed, 9 Feb 2011 19:47:27 +0000 (20:47 +0100)]
TODO: update

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agoi386: extend IMA guards to also cover LTO
Bernhard Reutner-Fischer [Wed, 9 Feb 2011 19:21:12 +0000 (20:21 +0100)]
i386: extend IMA guards to also cover LTO

See GCC PR47577; TODO: Remove them.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years ago*printf: Violation of precision with null string
Jones Desougi [Thu, 10 Jun 2010 13:04:51 +0000 (15:04 +0200)]
*printf: Violation of precision with null string

When a string format is processed and the argument is NULL, this yields
"(null)" regardless of precision. This does not make sense, precision
should not be exceeded. A simple test shows that glibc outputs nothing
if precision is smaller than six and the attached patch implements this
same behaviour.

Consider the not uncommon case of strings implemented like this:
struct string { int len; char *ptr; };
There is often no nultermination and they may be printed like this:
printf("%.*s", string.len, string.ptr);
If len is 0 then ptr may be anything, but NULL is a common value.
Obviously the empty string would be expected, not "(null)".

Signed-off-by: Jones Desougi <jones.desougi@27m.se>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agosync bits/socket.h PF_* / AF_* values with 2.6.38-rc3
Peter Korsgaard [Wed, 2 Feb 2011 16:58:38 +0000 (17:58 +0100)]
sync bits/socket.h PF_* / AF_* values with 2.6.38-rc3

A number of new address / protocol families have been added over the
years, so sync with Linux 2.6.38-rc3, adding CAN, ISDN, Phonet, Zigbee, ..
which are starting to be used by applications.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agoarm: mv nptl specific atomic impl to common place
Bernhard Reutner-Fischer [Wed, 9 Feb 2011 19:08:20 +0000 (20:08 +0100)]
arm: mv nptl specific atomic impl to common place

Thanks to Nitin Garg for notincing!

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agofix a problem with hidden getutent in non-threaded builds
Denys Vlasenko [Sun, 6 Feb 2011 22:51:23 +0000 (23:51 +0100)]
fix a problem with hidden getutent in non-threaded builds

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years agoarm: fix the static link problem for ARM due to undefined __tls_get_addr
Nitin Garg [Wed, 2 Feb 2011 01:30:23 +0000 (19:30 -0600)]
arm: fix the static link problem for ARM due to undefined __tls_get_addr

Signed-off-by: Nitin Garg <nitingarg98@gmail.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agonios2: Name architecture correctly in endian.h header
Tobias Klauser [Tue, 1 Feb 2011 16:38:07 +0000 (17:38 +0100)]
nios2: Name architecture correctly in endian.h header

Nios II is not i386 :-)

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agonptl/mips64: Fix build when using mips64 and ABIs other than o32
Khem Raj [Sat, 29 Jan 2011 17:14:53 +0000 (09:14 -0800)]
nptl/mips64: Fix build when using mips64 and ABIs other than o32

Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 years agomips: avoid segmentation fault when RLD_MAP is 0
Richard Braun [Fri, 28 Jan 2011 17:18:54 +0000 (18:18 +0100)]
mips: avoid segmentation fault when RLD_MAP is 0

Signed-off-by: Richard Braun <rbraun@sceen.net>
Acked-by: Joakim Tjernlund <joakim.tjernlund@transmode.se>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 years agolibc: fix linker script generation for libubacktrace.so
Filippo Arcidiacono [Tue, 25 Jan 2011 11:50:23 +0000 (12:50 +0100)]
libc: fix linker script generation for libubacktrace.so

Fix libc.so linker script generation to add libubacktrace AS_NEEDED entry
using MULTILIB_DIR instead of hard-coded "lib".

Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agostdio: fix diagnostic message
Bernhard Reutner-Fischer [Thu, 20 Jan 2011 08:15:21 +0000 (09:15 +0100)]
stdio: fix diagnostic message

harmless copy'n paste error in #error

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agobump version to 0.9.32-rc2-git
Carmelo Amoroso [Fri, 21 Jan 2011 07:22:32 +0000 (08:22 +0100)]
bump version to 0.9.32-rc2-git

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agorelease 0.9.32-rc2
Carmelo Amoroso [Thu, 20 Jan 2011 14:49:47 +0000 (15:49 +0100)]
release 0.9.32-rc2

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agonptl: Fix __USER_LABEL_PREFIX__ concatenatio
Will Newton [Thu, 20 Jan 2011 14:31:14 +0000 (15:31 +0100)]
nptl: Fix __USER_LABEL_PREFIX__ concatenatio

The current C macro magic does not correctly concatenate the
__USER_LABEL_PREFIX__ string on architectures where it has a
non-empty value. We need to use __stringify to get the desired
behaviour.

Signed-off-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agonptl: fix start_thread() for _STACK_GROWS_UP
Will Newton [Thu, 20 Jan 2011 14:26:14 +0000 (15:26 +0100)]
nptl: fix start_thread() for _STACK_GROWS_UP

This patch adds a working implementation of pthread_create for architectures
where STACK_GROWS_UP.

Signed-off-by: Matt Fleming <matthew.fleming@imgtec.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agoldso: get rid of _dl_lookup_hash
Carmelo Amoroso [Wed, 12 Jan 2011 11:07:39 +0000 (12:07 +0100)]
ldso: get rid of _dl_lookup_hash

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>
13 years agoAdd protected symbols support for all architectures
Salvatore Cro [Wed, 12 Jan 2011 09:27:16 +0000 (10:27 +0100)]
Add protected symbols support for all architectures

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>
13 years agoRevert "ldso/arm: Correct protected symbol resolution"
Carmelo Amoroso [Thu, 20 Jan 2011 13:47:46 +0000 (14:47 +0100)]
Revert "ldso/arm: Correct protected symbol resolution"

This reverts commit 48fb264beaac8114e5ac3e80e70dda473fbce96d.
The generic implementation will cover all the architectures handling
the protected symbols in _dl_lookup_hash [ldso/ldso/dl-hash.c]

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agoRevert "ldso_sh: add support for protected symbols to SH"
Carmelo Amoroso [Thu, 20 Jan 2011 13:47:14 +0000 (14:47 +0100)]
Revert "ldso_sh: add support for protected symbols to SH"

This reverts commit 74407db52d3953c7f3c6b8a53661cfc96cb07e22.
The generic implementation will cover all the architectures handling
the protected symbols in _dl_lookup_hash [ldso/ldso/dl-hash.c]

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>