]> Git Repo - uclibc-ng.git/log
uclibc-ng.git
6 years agortld: Add lazy binding support
Christophe Lyon [Thu, 28 Mar 2013 09:46:55 +0000 (10:46 +0100)]
rtld: Add lazy binding support

Add support for R_ARM_FUNCDESC_VALUE and implement _dl_linux_resolver
for FDPIC on ARM.

* ldso/ldso/arm/elfinterp.c (_dl_linux_resolver): Support __FDPIC__.
(_dl_do_lazy_reloc): Likewise.
* ldso/ldso/arm/resolve.S (_dl_linux_resolve): Likewise.

Signed-off-by: Mickaël Guêné <[email protected]>
Signed-off-by: Christophe Lyon <[email protected]>
6 years agoTLS: fix relocation computation
Christophe Lyon [Wed, 4 Jul 2018 15:55:25 +0000 (17:55 +0200)]
TLS: fix relocation computation

* ldso/ldso/dl-elf.c (_dl_load_elf_shared_library): Fix
l_tls_initimage computation.
* ldso/ldso/ldso.c (_dl_get_ready_to_run): Likewise.

Signed-off-by: Mickaël Guêné <[email protected]>
Signed-off-by: Christophe Lyon <[email protected]>
6 years agoAllow to generate PIE 'static' binary
Christophe Lyon [Wed, 4 Jul 2018 15:55:23 +0000 (17:55 +0200)]
Allow to generate PIE 'static' binary

* libc/misc/internals/__uClibc_main.c (funcdesc_value): New.
(fdpic_init_array_jump): New.
(__uClibc_fini): Support __FDPIC__.
(__uClibc_main): Likewise.

Signed-off-by: Mickaël Guêné <[email protected]>
Signed-off-by: Christophe Lyon <[email protected]>
6 years agoAdd runtime support needed for C++ exceptions
Christophe Lyon [Wed, 4 Jul 2018 15:55:22 +0000 (17:55 +0200)]
Add runtime support needed for C++ exceptions

Implements __gnu_Unwind_Find_got(), which is called from libgcc while
unwinding.

* libc/sysdeps/linux/arm/Makefile.arch (CSRC): Add find._got.c.
* libc/sysdeps/linux/arm/find_got.c: New file.

Signed-off-by: Mickaël Guêné <[email protected]>
Signed-off-by: Christophe Lyon <[email protected]>
6 years agoAdd application startup code for FDPIC
Christophe Lyon [Mon, 21 Jan 2013 08:37:43 +0000 (09:37 +0100)]
Add application startup code for FDPIC

* libc/sysdeps/linux/arm/crt1.S: Define _start for __FDPIC__.

Signed-off-by: Mickaël Guêné <[email protected]>
Signed-off-by: Christophe Lyon <[email protected]>
6 years agoFix bug in _dl_pread when using pread64 syscall
Christophe Lyon [Wed, 4 Jul 2018 15:55:20 +0000 (17:55 +0200)]
Fix bug in _dl_pread when using pread64 syscall

In ARM_EABI mode, the pread64 syscall parameters are aligned on
64-bits. This syscall is used in rtld when processing FDPIC
relocations.

* ldso/include/dl-syscall.h (__syscall_pread): Fix definition.
(__dl_pread): Fix syscall invocation.
* ldso/ldso/fdpic/dl-sysdep.h (__DL_PREAD): Handle __NR_pread64.

Signed-off-by: Mickaël Guêné <[email protected]>
Signed-off-by: Christophe Lyon <[email protected]>
6 years agortld: Add startup code
Christophe Lyon [Wed, 4 Jul 2018 15:55:19 +0000 (17:55 +0200)]
rtld: Add startup code

Implement _start: compute parameters for __self_reloc, and give
control to the user program.

* ldso/ldso/arm/dl-startup.h: Implement _start for __FDPIC__.

Signed-off-by: Mickaël Guêné <[email protected]>
Signed-off-by: Christophe Lyon <[email protected]>
6 years agortld: Avoid FUNCDESC relocation on _start
Christophe Lyon [Wed, 4 Jul 2018 15:55:18 +0000 (17:55 +0200)]
rtld: Avoid FUNCDESC relocation on _start

* ldso/ldso/ldso.c (_start): Fix definition for __FDPIC__.

Signed-off-by: Mickaël Guêné <[email protected]>
Signed-off-by: Christophe Lyon <[email protected]>
6 years agortld: Add FDPIC code for arm
Christophe Lyon [Fri, 18 Jan 2013 14:08:04 +0000 (15:08 +0100)]
rtld: Add FDPIC code for arm

Add FDPIC dynamic relocations support, similar to what other FDPIC
targets do.

Lazy binding is implemented in a folllow-up patch.

Disable the SEND* macros because they involve relocations to
access constant strings that are unsupported by the existing
arm version.

Define DL_START, START, ARCH_NEEDS_BOOTSTRAP_RELOCS,
DL_CHECK_LIB_TYPE similarly to what other FDPIC targets do.

Define raise() because _dl_find_hash references __aeabi_uidivmod,
which uses __aeabi_idiv0 which in turn references raise.

* include/elf.h (R_ARM_FUNCDESC): Define.
(R_ARM_FUNCDESC_VALUE): Define.
* ldso/include/dl-string.h (SEND_STDERR, SEND_ADDRESS_STDERR)
(SEND_NUMBER_STDERR): Define empty for __FDPIC__.
* ldso/ldso/arm/dl-inlines.h: New file.
* ldso/ldso/arm/dl-startup.h (PERFORM_BOOTSTRAP_RELOC): Fix type
of load_addr. Fix handling of R_ARM_RELATIVE, add support for
R_ARM_FUNCDESC_VALUE.
(DL_START, START): Define for __FDPIC__.
(raise): Define.
* ldso/ldso/arm/dl-sysdep.h (ARCH_NEEDS_BOOTSTRAP_RELOCS): Define.
(DL_CHECK_LIB_TYPE): Define.
(elf_machine_type_class): Take into account FDPIC related
relocations.
(elf_machine_load_address): Support __FDPIC__.
(elf_machine_relative): Likewise.
* ldso/ldso/arm/elfinterp.c (_dl_linux_resolver): Dummy support
for __FDPIC__, implemented in a later patch.
(_dl_do_reloc): Fix reloc_adr computation for __FDPIC__, fix
handling of local symbols. Fix handling of R_ARM_RELATIVE, add
support for R_ARM_FUNCDESC_VALUE, R_ARM_FUNCDESC.
* ldso/ldso/arm/resolve.S: Make _dl_linux_resolve hidden.
* ldso/ldso/fdpic/dl-inlines.h (htab_delete): Declare.
* libc/sysdeps/linux/arm/bits/elf-fdpic.h: New file, similar to bfin's.
* libc/sysdeps/linux/arm/crtreloc.c: Likewise.
* libc/sysdeps/linux/arm/find_exidx.c (__dl_addr_in_loadaddr) Define.
(find_exidx_callback): Support __FDPIC__.

Signed-off-by: Mickaël Guêné <[email protected]>
Signed-off-by: Christophe Lyon <[email protected]>
6 years agortld: Add #if defined (__FDPIC__)
Christophe Lyon [Wed, 4 Jul 2018 15:55:16 +0000 (17:55 +0200)]
rtld: Add #if defined (__FDPIC__)

Like for other FDPIC targets, add defined(__FDPIC__) where needed.

* include/link.h: Include bits/elf-fdpic.h if __FDPIC__ is defined.
(link_map): Use elf32_fdpic_loadaddr if __FDPIC__ is defined.
(dl_phdr_info): Likewise.
* ldso/include/dl-elf.h (__dl_parse_dynamic_info): Support
__FDPIC__.
* ldso/include/dl-hash.h (elf_resolve): Add funcdesc_ht field if
__FDPIC__ is defined.
* ldso/ldso/dl-hash.c (_dl_find_hash): Support __FDPIC__.
* libc/misc/elf/dl-iterate-phdr.c (dl_iterate_phdr): Support __FDPIC__.

Signed-off-by: Mickaël Guêné <[email protected]>
Signed-off-by: Christophe Lyon <[email protected]>
6 years agortld: Do not protect RELRO segments when we don't use an MMU.
Christophe Lyon [Wed, 4 Jul 2018 15:55:15 +0000 (17:55 +0200)]
rtld: Do not protect RELRO segments when we don't use an MMU.

Without MMU, we cannot mark memory regions as read-only.

* ldso/ldso/dl-elf.c (_dl_protect_relro): Do nothing if
__ARCH_USE_MMU__ is defined.

Signed-off-by: Christophe Lyon <[email protected]>
6 years agoAllow to select FDPIC ELF for arm architecture
Christophe Lyon [Wed, 4 Jul 2018 15:55:14 +0000 (17:55 +0200)]
Allow to select FDPIC ELF for arm architecture

* extra/Configs/Config.in.arch: Add TARGET_arm to the target list
for UCLIBC_FORMAT_FDPIC_ELF.

Signed-off-by: Mickaël Guêné <[email protected]>
Signed-off-by: Christophe Lyon <[email protected]>
6 years agoelf.h: add some missing defines
Waldemar Brodkorb [Fri, 29 Jun 2018 17:35:32 +0000 (19:35 +0200)]
elf.h: add some missing defines

6 years agoldso/arc: fix LD_DEBUG segv when printing R_ARC_NONE
Vineet Gupta [Wed, 27 Jun 2018 01:26:24 +0000 (18:26 -0700)]
ldso/arc: fix LD_DEBUG segv when printing R_ARC_NONE

Signed-off-by: Vineet Gupta <[email protected]>
6 years agoFix prototypes for preadv pwritev.
Vlad Starodubtsev [Thu, 26 Oct 2017 14:22:33 +0000 (17:22 +0300)]
Fix prototypes for preadv pwritev.

6 years agorisc-v: initial 64 bit port, static only (no TLS/NPTL)
Waldemar Brodkorb [Wed, 30 May 2018 23:04:17 +0000 (01:04 +0200)]
risc-v: initial 64 bit port, static only (no TLS/NPTL)

Only a simple hello world is tested in qemu system emulation.

6 years agoremove unused assembler functions for arm
Florian La Roche [Tue, 5 Jun 2018 05:11:08 +0000 (07:11 +0200)]
remove unused assembler functions for arm

These assembler functions seem to be unused/referenced, so we can remove
them completely.

Signed-off-by: Florian La Roche <[email protected]>
6 years agolibiconv: add missing header files from previuos commit
Waldemar Brodkorb [Tue, 29 May 2018 21:13:28 +0000 (23:13 +0200)]
libiconv: add missing header files from previuos commit

Missed in 5fdd379d9dbf8be74f2f1a0d33e62958e817ae7d.

6 years agolibiconv: port over simplified iconv from musl
Waldemar Brodkorb [Sat, 26 May 2018 19:47:00 +0000 (21:47 +0200)]
libiconv: port over simplified iconv from musl

6 years agolibrt: clock_nanosleep could be even used without threads
Waldemar Brodkorb [Sat, 5 May 2018 14:39:13 +0000 (16:39 +0200)]
librt: clock_nanosleep could be even used without threads

6 years agolibrt: declare clock_nanosleep not only for NPTL
Waldemar Brodkorb [Tue, 1 May 2018 17:35:20 +0000 (19:35 +0200)]
librt: declare clock_nanosleep not only for NPTL

Reported-by: Baruch Siach <[email protected]>
Signed-off-by: Waldemar Brodkorb <[email protected]>
6 years agoRevert "ldconfig: add glibc compatibility fix"
Waldemar Brodkorb [Sun, 29 Apr 2018 17:34:11 +0000 (19:34 +0200)]
Revert "ldconfig: add glibc compatibility fix"

This reverts commit 2a3bb4daf5778c5875674cd26a3c75b3d460a042.

This is breaking ld.so.cache usage. Seen on Gentoo/amd64.

Reported-by: "Anthony G. Basile" <[email protected]>
6 years agobump for release 1.0.30
Waldemar Brodkorb [Sat, 28 Apr 2018 18:50:38 +0000 (19:50 +0100)]
bump for release 1.0.30

6 years agomention Tile architecture
Waldemar Brodkorb [Sat, 28 Apr 2018 18:49:43 +0000 (19:49 +0100)]
mention Tile architecture

6 years agolibdl: first execute all destructors, then munmap library
Waldemar Brodkorb [Fri, 27 Apr 2018 05:00:54 +0000 (06:00 +0100)]
libdl: first execute all destructors, then munmap library

Fix problem which might exist since 2011. We need to execute
the destructors for all dependant libraries, before munmap the
shared libraries, otherwise running destructor of a dependent library
might cause a segfault, trying to access an already unmapped memory.

This fixes for example segfaults while running php -m with ldap
module.

Reported-By: Dave Flogeras <[email protected]>
Tested-By: Dave Flogeras <[email protected]>
6 years agolibdl: calculate the length for second parameter of munmap.
Dave Flogeras [Fri, 27 Apr 2018 12:21:28 +0000 (09:21 -0300)]
libdl: calculate the length for second parameter of munmap.

Revert 35105679b9a900d58dadd0852e679c235f8176ba and add some debug
code.

6 years agolinuxthreads: implement pthread_condattr_{s,g}etclock()
Waldemar Brodkorb [Sun, 22 Apr 2018 17:59:13 +0000 (18:59 +0100)]
linuxthreads: implement pthread_condattr_{s,g}etclock()

More applications are using pthread_condattr_setclock()/
pthread_condattr_getclock() in their code. Port these two
functions from NPTL over to be more compatible.

6 years agolibdl: end must be bigger than start
Waldemar Brodkorb [Sun, 22 Apr 2018 10:55:36 +0000 (11:55 +0100)]
libdl: end must be bigger than start

6 years agolibdl: remove gcc warnings
Waldemar Brodkorb [Sun, 22 Apr 2018 08:10:13 +0000 (09:10 +0100)]
libdl: remove gcc warnings

6 years agolibiconv: remove function, which is not available w/o libiconv a4 macros
Waldemar Brodkorb [Sun, 22 Apr 2018 07:40:55 +0000 (08:40 +0100)]
libiconv: remove function, which is not available w/o libiconv a4 macros

6 years agolibdl: fix problem with unmapping
Waldemar Brodkorb [Tue, 17 Apr 2018 19:19:06 +0000 (20:19 +0100)]
libdl: fix problem with unmapping

The munmap was still called with broken length, as sometimes
start was empty. This finally solves segfaults when running
php -m with ldap module activated.

6 years agolibdl: better checking and logging for ctors/dtors
Waldemar Brodkorb [Sun, 15 Apr 2018 20:05:26 +0000 (21:05 +0100)]
libdl: better checking and logging for ctors/dtors

6 years agolibdl: remove dead code
Waldemar Brodkorb [Sun, 15 Apr 2018 12:46:13 +0000 (13:46 +0100)]
libdl: remove dead code

6 years agolibdl: remove LDSO_NO_CLEANUP
Waldemar Brodkorb [Sat, 14 Apr 2018 17:32:18 +0000 (18:32 +0100)]
libdl: remove LDSO_NO_CLEANUP

6 years agolibdl: cleanup old inline changelog
Waldemar Brodkorb [Sat, 14 Apr 2018 17:22:33 +0000 (18:22 +0100)]
libdl: cleanup old inline changelog

6 years agoRevert "libdl: fix dlclose() issue"
Waldemar Brodkorb [Mon, 9 Apr 2018 01:23:07 +0000 (02:23 +0100)]
Revert "libdl: fix dlclose() issue"

This reverts commit bf4c2d242f587700e3eb2ffd5721ddaf3cdbc7e5.

6 years agocommon/sendfile.c: bugfix can't support offset is NULL
Guo Ren [Mon, 16 Apr 2018 07:35:20 +0000 (15:35 +0800)]
common/sendfile.c: bugfix can't support offset is NULL

In ltp testcase sendfile08.c, it use offset=NULL to test the api.

PATCH V2:
fixup the stupid missing check in the end. Sorry for lose test.

See "man sendfile" and it really support offset is NULL.

Signed-off-by: Guo Ren <[email protected]>
6 years agoRevert "common/sendfile.c: bugfix can't support offset is NULL"
Waldemar Brodkorb [Tue, 17 Apr 2018 17:13:53 +0000 (18:13 +0100)]
Revert "common/sendfile.c: bugfix can't support offset is NULL"

This reverts commit b00fd230ed0b49b9f23d829ad5d09859f34bb754.

6 years agolseek.c: bugfix ltp lseek01.c
Guo Ren [Fri, 13 Apr 2018 08:24:41 +0000 (16:24 +0800)]
lseek.c: bugfix ltp lseek01.c

Ref the implement from the glibc and high=0 seems so bad.

Signed-off-by: Guo Ren <[email protected]>
6 years agocommon/sendfile.c: bugfix can't support offset is NULL
Guo Ren [Fri, 13 Apr 2018 07:48:02 +0000 (15:48 +0800)]
common/sendfile.c: bugfix can't support offset is NULL

In ltp testcase sendfile08.c, it use offset=NULL to test the api.

See "man sendfile" and it really support offset is NULL.

Signed-off-by: Guo Ren <[email protected]>
6 years agoor1k: add F_{DUPFD_CLOEXEC, SETPIPE_SZ, GETPIPE_SZ}
Thomas Petazzoni [Thu, 12 Apr 2018 21:24:59 +0000 (23:24 +0200)]
or1k: add F_{DUPFD_CLOEXEC, SETPIPE_SZ, GETPIPE_SZ}

Those definitions exist on all other architectures, but were not
present in or1k specific headers when or1k support was merged.

On the kernel side, their support is completely architecture
independent, so we just need those definitions to make those fcntl()
calls available on or1k.

Signed-off-by: Thomas Petazzoni <[email protected]>
6 years agouse __NR_newfstatat only for modern Linux architectures
Waldemar Brodkorb [Mon, 2 Apr 2018 13:41:25 +0000 (14:41 +0100)]
use __NR_newfstatat only for modern Linux architectures

Otherwise it breaks mips64 n64.
Should be used for aarch64/tilegx only.

6 years agohppa: fix runtime issues
Waldemar Brodkorb [Mon, 19 Mar 2018 18:23:33 +0000 (19:23 +0100)]
hppa: fix runtime issues

Sync clone()/vfork() with GNU C Library.
Allow CFI and fix strsignal() / tcsetattr().

6 years agocsky: support bsd-setjmp and bsd-_setjmp.
Guo Ren [Thu, 15 Mar 2018 02:40:27 +0000 (10:40 +0800)]
csky: support bsd-setjmp and bsd-_setjmp.

Signed-off-by: Guo Ren <[email protected]>
6 years agolibdl: fix dlclose() issue
Waldemar Brodkorb [Thu, 15 Mar 2018 19:35:05 +0000 (20:35 +0100)]
libdl: fix dlclose() issue

There is a patch included in https://bugs.busybox.net/show_bug.cgi?id=6158
from 2013, which was never applied.
This really fixes the php -m segfaults.

6 years agoRevert "Revert "libdl: fix size parameter when unmap library in dlclose""
Waldemar Brodkorb [Wed, 14 Mar 2018 04:30:55 +0000 (05:30 +0100)]
Revert "Revert "libdl: fix size parameter when unmap library in dlclose""

This reverts commit 952bb00f0b2eb576b0bf48c4f87018429a42e28d.

And adds this fix for 64 Bit systems.
http://lists.busybox.net/pipermail/uclibc/2014-December/048737.html

6 years agotile: add basic support for tilegx
Waldemar Brodkorb [Sun, 4 Feb 2018 15:34:18 +0000 (15:34 +0000)]
tile: add basic support for tilegx

This adds basic support for tile architecture.
Only static binaries, no ld.so or threading support.
Tested with qemu-tilegx only.

7 years agosparc32: Add nop before __startcontext to stop unwinding
Waldemar Brodkorb [Fri, 9 Mar 2018 18:14:40 +0000 (19:14 +0100)]
sparc32: Add nop before __startcontext to stop unwinding

From glibc commit 9aa5c222b9e0409143410a02b6364a3b25dbf028
[BZ #22919]

7 years agoutils: fix compile of msgfmt/msgmerge
Waldemar Brodkorb [Mon, 5 Mar 2018 19:29:56 +0000 (20:29 +0100)]
utils: fix compile of msgfmt/msgmerge

The host utils are missing the dependencies, the target
utils need libiconv enabled.

7 years agofenv: only allow for ppc e500
Waldemar Brodkorb [Sun, 4 Mar 2018 12:07:27 +0000 (13:07 +0100)]
fenv: only allow for ppc e500

7 years agobump for release 1.0.29
Waldemar Brodkorb [Sat, 3 Mar 2018 17:22:30 +0000 (18:22 +0100)]
bump for release 1.0.29

7 years agoadd missing include to quieten compiler
Waldemar Brodkorb [Thu, 1 Mar 2018 19:17:57 +0000 (19:17 +0000)]
add missing include to quieten compiler

7 years agoquieten some warnings when EXTRA_WARNINGS not set
Waldemar Brodkorb [Thu, 1 Mar 2018 18:56:42 +0000 (18:56 +0000)]
quieten some warnings when EXTRA_WARNINGS not set

7 years agofix issue with LDSO_GNU_HASH_SUPPORT
Waldemar Brodkorb [Thu, 1 Mar 2018 18:52:19 +0000 (18:52 +0000)]
fix issue with LDSO_GNU_HASH_SUPPORT

Under Fedora 27 there is a problem with the existing ld check.
Binutils ld segfaults. Add a glibc compat macro to complete
the build on Fedora.

Signed-off-by: Sven Anders <[email protected]>
7 years agostat.h: fix issue with aarch64
Waldemar Brodkorb [Mon, 26 Feb 2018 00:42:14 +0000 (01:42 +0100)]
stat.h: fix issue with aarch64

7 years agoutils: fix install error
Waldemar Brodkorb [Sun, 18 Feb 2018 17:47:23 +0000 (17:47 +0000)]
utils: fix install error

Regression introduced with 748b5e3d2d70e47ab72ed44a371bd0db9a3a0c20

7 years agobits/socket.h: add missing defines
Waldemar Brodkorb [Sat, 17 Feb 2018 18:36:16 +0000 (18:36 +0000)]
bits/socket.h: add missing defines

Newer iproute2 package make use of some of defines.
Sync missing defines with GNU C library.

7 years agolibm: fix compile error
Waldemar Brodkorb [Sat, 17 Feb 2018 18:27:25 +0000 (18:27 +0000)]
libm: fix compile error

Fix a compile error when __UCLIBC_SUSV3_LEGACY__ is disabled.

Reported-by: Paolo Mantegazza <[email protected]>
7 years agoadd gettext-tiny tools
Waldemar Brodkorb [Sat, 17 Feb 2018 18:17:08 +0000 (18:17 +0000)]
add gettext-tiny tools

For libintl stub users tiny gettext tools might be useful.
Tested with x86_64 on Gentoo/uClibc-ng system.

7 years agouClibc-ng does not implement name_to_handle_at
Alexey Neyman [Sun, 11 Feb 2018 19:59:22 +0000 (11:59 -0800)]
uClibc-ng does not implement name_to_handle_at

... so don't declare it. Otherwise, eudev finds it declared and tries
to link with it - and fails.

Signed-off-by: Alexey Neyman <[email protected]>
7 years agomman: disable memfd_create declaration
Waldemar Brodkorb [Sun, 4 Feb 2018 15:33:08 +0000 (15:33 +0000)]
mman: disable memfd_create declaration

7 years agocsky: bugfix ltp open12 failed.
Guo Ren [Thu, 1 Feb 2018 10:58:17 +0000 (18:58 +0800)]
csky: bugfix ltp open12 failed.

Signed-off-by: Guo Ren <[email protected]>
7 years agoadd libc version compatibility
Waldemar Brodkorb [Fri, 2 Feb 2018 02:25:10 +0000 (02:25 +0000)]
add libc version compatibility

7 years agobits/mman.h: consolidate header file
Waldemar Brodkorb [Sun, 28 Jan 2018 04:30:35 +0000 (04:30 +0000)]
bits/mman.h: consolidate header file

Sync with GNU C library and consolidate duplicate non
architecture specific defines.
MAP_UNINITIALIZED is only defined to 0x4000000 and used by
the Linux kernel when CONFIG_MMAP_ALLOW_UNINITIALIZED is enabled.
CONFIG_MMAP_ALLOW_UNINITIALIZED is only available for nommu.
See Documentation/nommu-mmap.txt.

7 years agomalloc: add glibc compat symbols
Waldemar Brodkorb [Wed, 31 Jan 2018 06:18:06 +0000 (06:18 +0000)]
malloc: add glibc compat symbols

7 years agomalloc: add malloc_usable_size()
Waldemar Brodkorb [Wed, 31 Jan 2018 05:27:54 +0000 (05:27 +0000)]
malloc: add malloc_usable_size()

7 years agoremove arc4random (rc4 based)
Waldemar Brodkorb [Tue, 30 Jan 2018 04:01:56 +0000 (04:01 +0000)]
remove arc4random (rc4 based)

OpenBSD arc4random is using chacha20 cipher algorithm for
a long time. This copy is still based on deprecated rc4
cipher algorithm. We could either update the arc4random.c
or drop it. Drop it. Users should better use libbsd when
using arc4random interface. Musl/glibc does not have arc4random
either.

7 years agoaarch64/sys/ucontext.h: include bits/sigcontext.h
Bernd Kuhls [Sun, 28 Jan 2018 15:18:29 +0000 (16:18 +0100)]
aarch64/sys/ucontext.h: include bits/sigcontext.h

Fixes a buildroot build error with ffmpeg

In file included from /home/bernd/buildroot/output/host/aarch64-buildroot-linux-uclibc/sysroot/usr/include/signal.h:329:0,
                 from fftools/ffmpeg.h:26,
                 from fftools/ffmpeg_opt.c:23:
/home/bernd/buildroot/output/host/aarch64-buildroot-linux-uclibc/sysroot/usr/include/sys/ucontext.h:52:16:
 error: field 'uc_mcontext' has incomplete type
     mcontext_t uc_mcontext;
                ^~~~~~~~~~~

using this defconfig:

BR2_aarch64=y
BR2_PACKAGE_FFMPEG=y

sys/ucontext.h for other archs already include bits/sigcontext.h,
on aarch64 this is needed as well.

Signed-off-by: Bernd Kuhls <[email protected]>
7 years agolibiconv: fake EUC_JP support
Waldemar Brodkorb [Sun, 28 Jan 2018 18:47:12 +0000 (18:47 +0000)]
libiconv: fake EUC_JP support

A lot of packages use the same autoconf macro, fake EUC_JP to
succeed. Tested with wget,libcdio and gnupg.

7 years agobump version to 1.0.28
Waldemar Brodkorb [Sun, 21 Jan 2018 11:55:44 +0000 (12:55 +0100)]
bump version to 1.0.28

7 years agosupress some gcc warnings
Waldemar Brodkorb [Sun, 21 Jan 2018 11:43:36 +0000 (11:43 +0000)]
supress some gcc warnings

7 years agoxtensa: fix R_XTENSA_TLSDESC_ARG handling in _dl_do_reloc
Max Filippov [Wed, 17 Jan 2018 13:52:54 +0000 (05:52 -0800)]
xtensa: fix R_XTENSA_TLSDESC_ARG handling in _dl_do_reloc

R_XTENSA_TLSDESC_ARG is a true RELA relocation, the addend is in the
relocation record itself, not in place.

Signed-off-by: Max Filippov <[email protected]>
7 years agoxtensa: fix _dl_tlsdesc_dynamic
Max Filippov [Tue, 16 Jan 2018 18:43:31 +0000 (10:43 -0800)]
xtensa: fix _dl_tlsdesc_dynamic

There are multiple errors in _dl_tlsdesc_dynamic:

- the reference C implementation should return pointer to the
  thread-local variable, not offset from the thread pointer, because the
  xtensa ABI expects TLSDESC_FN to return pointer to the TLS variable;
- addx8 used for indexing into dtv has its second and third registers in
  wrong order, the index must be multiplied by 8, not the base;
- the same addx8 uses wrong base: instead of dtv it adds the offset to
  the threadptr;
- the return value in the fast path is calculated as
  td->tlsinfo.ti_offset - __builtin_thread_pointer, not what was
  intended;
- both fast and slow paths should not subtract __builtin_thread_pointer
  from the result.

Signed-off-by: Max Filippov <[email protected]>
7 years agosimplify and fix getcwd
Waldemar Brodkorb [Sat, 20 Jan 2018 20:10:56 +0000 (21:10 +0100)]
simplify and fix getcwd

The fallback code is not used as all supported kernels have the
syscall. Check if a absolute path is returned from syscall.

7 years agoinclude/elf.h: sync with GNU C library
Waldemar Brodkorb [Sat, 20 Jan 2018 20:13:28 +0000 (20:13 +0000)]
include/elf.h: sync with GNU C library

Add NT_GNU_BUILD_ID and other defines to allow applications
using it to successfully compile. (f.e. firefox)

7 years agoxtensa: fix strcmp
Max Filippov [Tue, 9 Jan 2018 08:48:31 +0000 (00:48 -0800)]
xtensa: fix strcmp

Loops with 'loop forever' annotation inside strcmp are actually meant to
loop forever. Falling through the end of the first loop may result in
equal strings being compared unequal, e.g.:

#include <string.h>

int main(void)
{
char a[4096] __attribute__((aligned(4)));
char b[4096] __attribute__((aligned(4)));

memset(a, ' ', 258 * 8);
memset(b, ' ', 258 * 8);
a[255 * 8] = 0;
a[256 * 8] = 'a';
b[255 * 8] = 0;
b[256 * 8] = 'b';
return !(strcmp(a, b) == 0);
}

Falling through the end of the second loop may result in unequal strings
being compared as equal, e.g.:

#include <string.h>

int main(void)
{
char a[4096] __attribute__((aligned(4)));
char b[4096] __attribute__((aligned(4)));

memset(a, ' ', 514 * 6);
memset(b, ' ', 514 * 6);
a[514 * 6 + 0] = 'a';
a[514 * 6 + 1] = 0;
b[514 * 6 + 0] = 'b';
b[514 * 6 + 1] = 0;
return !(strcmp(a, b) != 0);
}

Use 0 as a loop counter to make 2^32 - 1 iterations which is enough to
cover all addressable memory. While at it drop useless nop at the end of
the first loop and use a11 for all loop counters.

Signed-off-by: Max Filippov <[email protected]>
7 years agolibpthread/nptl: bugfix malloc segfault in race conditions.
Guo Ren [Thu, 11 Jan 2018 05:57:32 +0000 (13:57 +0800)]
libpthread/nptl: bugfix malloc segfault in race conditions.

In libc/sysdeps/linux/common/bits/uClibc_pthread.h:
extern void weak_function _pthread_cleanup_push_defer(...)

This *weak_function* declaration will cause nptl/cleanup_defer_compat.c:
strong_alias (...) !!!FAIL!!!, because it include pthreadP.h->pthread.h
->uClibc_pthread.h

That means:
Readelf -s libpthread/nptl/cleanup_defer_compat.o you will get:
18: 00000000   198 FUNC    WEAK   DEFAULT    1 _pthread_cleanup_push_def
Readelf -s libc/misc/internals/__uClibc_main.o you will also get:
32: 00000038    58 FUNC    WEAK   DEFAULT    1 _pthread_cleanup_push_def

Final: gcc malloc_pthread_test.c -lpthread
The libc/stdlib/malloc-standard/malloc.c:839 (__MALLOC_LOCK->
_pthread_cleanup_push_def) will use the one in __uClibc_main.o
!!!not in cleanup_defer_compat.o!!!, becasue two cleanup_defer_compat in
libc.a with the same weak declarations and the __uClibc_main.o is close
to front.

====

All of malloc/free will failed in muti-threads' race conditions
probabilistic.

As it happens, uClibc-0.9.33.2 is OK, Becasue:
It's seperated in libpthread.a and libc.a, and the libc.a is the
last lib for ld internal-cmd, and malloc will get right cleanup_defer_compat
from libpthread.a.

This BUG is from 2016-09-24 to now:
>>>
commit 29ff9055c80efe77a7130767a9fcb3ab8c67e8ce
Author: Waldemar Brodkorb <[email protected]>
Date:   Sat Sep 24 02:55:31 2016 +0200

    use a single libc and deduplicate threading code

    Similar to musl libc a single libc has many benefits and solves
    some open issues with uClibc-ng.

    - no pthread_mutex_* weak symbols exported anymore
    - applications no longer failing to link when either
      -lrt or -lpthread are missing for dynamic and static linking mode
    - smaller C library
    - slightly better runtime performance
<<<

Perharps we need carefully check all of the impact about that commit.

Signed-off-by: Guo Ren <[email protected]>
7 years agort: cleanup and allow to build for linuxthreads
Waldemar Brodkorb [Sat, 6 Jan 2018 22:31:14 +0000 (23:31 +0100)]
rt: cleanup and allow to build for linuxthreads

It seems there is no real dependency to NPTL for these clock_*
functions when UCLIBC_ADVANCED_REALTIME is enabled.

No regressions found.

Reported-by: Baruch Siach <[email protected]>
7 years agonptl: use generic lowlevellock.h for most architectures
Waldemar Brodkorb [Mon, 1 Jan 2018 12:39:41 +0000 (13:39 +0100)]
nptl: use generic lowlevellock.h for most architectures

Only mips/x86/x86_64 needs a special version of lowlevellock.h.
No regressions found.

7 years agonds32: Add syscall macros for 5 and 6 parameters
Stafford Horne [Thu, 4 Jan 2018 13:57:02 +0000 (22:57 +0900)]
nds32: Add syscall macros for 5 and 6 parameters

This is to fix an error after switching to use generic syscalls.

  libc/sysdeps/linux/common/syscall.c: In function 'syscall':
  libc/sysdeps/linux/common/syscall.c:27:2: warning: implicit
  declaration of function 'internal_syscall_ncs6'
  [-Wimplicit-function-declaration]
    return INLINE_SYSCALL_NCS(sysnum, 6, arg1, arg2, arg3, arg4, arg5,
  arg6);
     ^

Defining these functions as described by Vincent Ren-Wei Chen
<[email protected]>

Signed-off-by: Stafford Horne <[email protected]>
7 years agonds32: Use new common syscall() implementation
Stafford Horne [Thu, 14 Dec 2017 06:29:08 +0000 (15:29 +0900)]
nds32: Use new common syscall() implementation

Traditionally nds32 has had a generic syscall implementation supporting
varargs.

During an audit it was found that this implementation seems to duplicate
the new common implementation and is no longer needed.

Signed-off-by: Stafford Horne <[email protected]>
7 years agoor1k: Use new common syscall() implementation
Stafford Horne [Thu, 14 Dec 2017 06:29:07 +0000 (15:29 +0900)]
or1k: Use new common syscall() implementation

Now that the common syscall implementation supports vararg calling
conventions we can safely use it on OpenRISC.

This saves a bit of code in the openrisc implementation.

Signed-off-by: Stafford Horne <[email protected]>
7 years agosyscall: Make common implementation match unistd.h
Stafford Horne [Thu, 14 Dec 2017 06:29:06 +0000 (15:29 +0900)]
syscall: Make common implementation match unistd.h

The definition of syscall() in unistd.h is with varargs.  Traditionally
the common implementation in uclibc has been with regular arguments.
This patch updates that by using varargs.

This has caused issues on architectures like or1k which have different
calling conventions for varargs and regular arg parameters.

The implementation here is based on an implementation from Joel Stanley
<[email protected]>.  There is a difference that I do not initialize the
stack args with 0 as they are immediately overwritten by va_args.

Signed-off-by: Stafford Horne <[email protected]>
7 years agocsky: bugfix libc sync_file_range.c for csky.
Guo Ren [Mon, 8 Jan 2018 08:07:45 +0000 (16:07 +0800)]
csky: bugfix libc sync_file_range.c for csky.

Use __NR_sync_file_range2 for csky sync_file_range function.

Signed-off-by: Guo Ren <[email protected]>
7 years agold.so: Rewrite elf_machine_load_address using _DYNAMIC symbol
Waldemar Brodkorb [Sat, 6 Jan 2018 22:25:25 +0000 (23:25 +0100)]
ld.so: Rewrite elf_machine_load_address using _DYNAMIC symbol

Sync with GNU C library commit:
commit a68ba2f3cd3cbe32c1f31e13c20ed13487727b32
Author: Szabolcs Nagy <[email protected]>
Date:   Wed Oct 18 17:26:23 2017 +0100

Fixes issues with binutils version > 2.29.1.

7 years agofdpic: fix ld.so crashing
Waldemar Brodkorb [Wed, 3 Jan 2018 18:57:08 +0000 (19:57 +0100)]
fdpic: fix ld.so crashing

Newer binutils is creating a section INIT_ARRAY from any .init_array
and .ctors in the code. When ld.so runs initialization functions for
loaded objects with _dl_run_init_array() it crashes on Bfin FDPIC
system. It is trying to execute the function in pthread.c, which is
no longer useful with the combined C library approach.
Gcc -Wl,-M debugging output was very useful to find the reason for
the INIT_ARRAY section.

7 years agoquieten compiler warnings when __UCLIBC_HAS_FENV__ isn't defined
Waldemar Brodkorb [Tue, 2 Jan 2018 16:50:31 +0000 (17:50 +0100)]
quieten compiler warnings when __UCLIBC_HAS_FENV__ isn't defined

7 years agoremove COMPAT_ATEXIT
Waldemar Brodkorb [Tue, 2 Jan 2018 02:07:47 +0000 (03:07 +0100)]
remove COMPAT_ATEXIT

7 years agom68k: add NPTL/TLS support
Waldemar Brodkorb [Sat, 16 Dec 2017 20:01:39 +0000 (21:01 +0100)]
m68k: add NPTL/TLS support

Port over NPTL/TLS support from GNU C Library.
In the first step only the slower syscall is used for TLS
access. The uClibc-ng testsuite shows 79 errors, so their
is room for bugfixes and improvements.

7 years agocsky: add Copyright.
Guo Ren [Tue, 26 Dec 2017 13:52:35 +0000 (21:52 +0800)]
csky: add Copyright.

Signed-off-by: Guo Ren <[email protected]>
7 years agoadd Stafford as OpenRisc Maintainer, agreed on IRC
Waldemar Brodkorb [Wed, 27 Dec 2017 08:36:41 +0000 (09:36 +0100)]
add Stafford as OpenRisc Maintainer, agreed on IRC

7 years agocsky: remove -mcpu and -mhard-float from config
Guo Ren [Tue, 26 Dec 2017 10:56:00 +0000 (18:56 +0800)]
csky: remove -mcpu and -mhard-float from config

Pass the -mcpu and -mhard-float from UCLIBC_EXTRA_CFLAGS instead.

Signed-off-by: Guo Ren <[email protected]>
7 years agosh: remove assembly code from NPTL
Waldemar Brodkorb [Fri, 15 Dec 2017 20:34:23 +0000 (21:34 +0100)]
sh: remove assembly code from NPTL

7 years agoor1k: syscall: Pass arguments on the stack
Joel Stanley [Wed, 6 Dec 2017 01:56:21 +0000 (12:26 +1030)]
or1k: syscall: Pass arguments on the stack

Busybox internally calls syscall(2).

 - in unistd.h defined something like
   int syscall(nr, ....)

 - in syscall.c (common) implemented as
   int syscall(nr, arg1, arg3, arg3, arg4, arg5, arg6)

This will not work, busybox thinks syscall should have varargs calling
conventions.  But it doesnt in the uclibc implementation so no args go through.

Most architectures this will work.  But on openrisc varargs are all sent on the
stack.  Regular args are passed in registers.

Commit message and idea from Stafford Horne <[email protected]>.

Signed-off-by: Joel Stanley <[email protected]>
7 years agolibrt: fix gcc warning
Waldemar Brodkorb [Sun, 10 Dec 2017 18:06:31 +0000 (19:06 +0100)]
librt: fix gcc warning

7 years agoINSTALL: add some notes how to create Linux headers directory
Waldemar Brodkorb [Sun, 10 Dec 2017 17:58:00 +0000 (18:58 +0100)]
INSTALL: add some notes how to create Linux headers directory

7 years agofenv: only allow to enable for supported architectures
Waldemar Brodkorb [Sun, 3 Dec 2017 20:13:01 +0000 (21:13 +0100)]
fenv: only allow to enable for supported architectures

7 years agox86_64: add fenv support from glibc
Waldemar Brodkorb [Sun, 3 Dec 2017 20:12:34 +0000 (21:12 +0100)]
x86_64: add fenv support from glibc

7 years agoFix build regression with DO_XSI_MATH disabled
Ronald Wahl [Tue, 28 Nov 2017 18:20:45 +0000 (19:20 +0100)]
Fix build regression with DO_XSI_MATH disabled

Commit ea38f4d89 (math: add exception handling functionality) adds a
regression so that build configurations that have DO_C99_MATH enabled
and DO_XSI_MATH disabled will not link. This commit moves the files with
the bessel functions from DO_C99_MATH to DO_XSI_MATH. It looks like they
are not even contained in C99.

Signed-off-by: Ronald Wahl <[email protected]>
7 years agobump for release
Waldemar Brodkorb [Mon, 27 Nov 2017 20:07:08 +0000 (21:07 +0100)]
bump for release

This page took 0.073022 seconds and 4 git commands to generate.