• R/O
  • HTTP
  • SSH
  • HTTPS

Liste der Commits

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

RSS
Rev. Zeit Autor
30b85d4 2019-05-13 16:11:01 Max Filippov

docs/defines.txt: clarify LFS-related macros

Add description for _LARGEFILE_SOURCE, _LARGEFILE64_SOURCE,
_FILE_OFFSET_BITS and __USE_LARGEFILE, __USE_LARGEFILE64 and
__USE_FILE_OFFSET64 macros.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>

8987338 2019-04-14 17:02:57 Konstantin Vasin

Fix build with SUPPORT_LD_DEBUG_EARLY enabled

df82d65 2019-04-14 17:02:19 Yann Sionneau

Fix _dl_deallocate_tls in !SHARED case

This patch seems needed in builds where
- SHARED is not defined (no shared lib support)
- and USE_TLS is set

Without this patch, static_dtv is free'ed.
See the following backtrace:
0 __do_check_chunk (p=0x52638 <fork_handler_pool+2296>) at libc/stdlib/malloc-standard/malloc.c:80
1 0x0000000000017fa0 in __do_check_inuse_chunk (p=0x52638 <fork_handler_pool+2296>) at libc/stdlib/malloc-standard/malloc.c:143
2 0x0000000000017354 in free (mem=0x52648 <static_dtv>) at libc/stdlib/malloc-standard/free.c:293
3 0x000000000002d5b0 in _dl_deallocate_tls (tcb=0x58690, dealloc_tcb=false) at libpthread/nptl/sysdeps/generic/dl-tls.c:588
4 0x0000000000021c0c in __deallocate_stack (pd=0x58000) at libpthread/nptl/allocatestack.c:717
5 0x0000000000024408 in __free_tcb (pd=0x58000) at libpthread/nptl/pthread_create.c:217
6 0x00000000000200ac in pthread_join (threadid=360448, thread_return=0x0 <k1c_start>) at libpthread/nptl/pthread_join.c:109
7 0x0000000000010354 in tf (a=0x58000) at tst-basic3.c:42
8 0x00000000000247c8 in start_thread (arg=0x4000200960) at libpthread/nptl/pthread_create.c:285
9 0x0000000000026560 in ?? ()

This backtrace is obtained while debugging tst-basic3 from the uclibc-ng nptl testsuite.
It aborts because of the assert in malloc:
https://elixir.bootlin.com/uclibc-ng/v1.0.31/source/libc/stdlib/malloc-standard/malloc.c#L80

Signed-off-by: Yann Sionneau <ysionneau@kalray.eu>

018ef9e 2019-04-14 17:02:18 Yann Sionneau

Fix TLS allocation and loading in !SHARED case

For ARCH where shared lib are not supported:
- SHARED is not set (!SHARED is true)
- __ARCH_HAS_NO_LDSO__ is set

so code inside #if !defined __ARCH_HAS_NO_LDSO__ && !defined SHARED
is compiled-out.

But without a call do _dl_aux_init(), _dl_phdr stays NULL and
__libc_setup_tls won't be able to allocate memory for the in-executable TLS
and also won't be able to load the initimage from ELF TLS segment.

This results in segfault when doing things like "errno = 0" like
in tst-cancel15.c for instance in uClibc-ng testsuite.

Signed-off-by: Yann Sionneau <ysionneau@kalray.eu>

5efc10d 2019-03-02 18:49:39 Eugene Yudin

Fix NULL pointer dereference in open_memstream()

--000000000000cb1b1305827e5ae0
Content-Type: text/plain; charset="UTF-8"

Hi,

Current version of uClibc-ng has issue in open_memstream() function.
If the cookie variable is NULL (due malloc() fail) then null pointer is
dereferenced after if block.

The attached patch fixes this issue.
--
Best regards,
Eugene

<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi,<div><br></div><div>Current version of uClibc-ng has issue in open_memstream() function.</div><div>If the cookie variable is NULL (due malloc() fail) then null pointer is dereferenced after if block.</div><div><br></div><div>The attached patch fixes this issue.<br clear="all"><div>-- <br></div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div><span><div>Best regards,<br></div>Eugene</span></div></div></div></div></div></div></div></div></div>

ac48ce2 2018-12-31 19:12:44 Guo Ren

csky: Add EM_CSKY for ldso

Support EM_CSKY 252 elf format.

Changelog:
Increase EM_NUM to 253

Signed-off-by: Guo Ren <ren_guo@c-sky.com>
Signed-off-by: Mao Han <han_mao@c-sky.com>

365d19d 2018-12-14 18:53:22 Waldemar Brodkorb

fix issues in ethers.c

Old version manages strings the regular way (i.e. counting on zero-ended
sequences). In fact strings captured from the /etc/ethers file are
'\n'-ended. So, for example, using strchr function could lead to buffer
overflow.

Reported-by: "Andrey V. Zhmurin" <zhmurin_a@mcst.ru

51e75b3 2018-12-14 18:51:53 Max Filippov

xtensa: add custom bits/poll.h

Definitions of POLLWRNORM, POLLWRBAND and POLLREMOVE in xtensa linux
kernel are non-standard. Provide bits/poll.h with correct values for
these constants.

This fixes the following strace build errors:

In file included from xlat/pollflags.h:4:0,
from poll.c:34:
./static_assert.h:40:24: error: static assertion failed: "POLLWRBAND != 0x0100"
# define static_assert _Static_assert
^
xlat/pollflags.h:75:1: note: in expansion of macro ‘static_assert’
static_assert((POLLWRBAND) == (0x0100), "POLLWRBAND != 0x0100");
^~~~~~~~~~~~~
./static_assert.h:40:24: error: static assertion failed: "POLLREMOVE != 0x0800"
# define static_assert _Static_assert
^
xlat/pollflags.h:117:1: note: in expansion of macro ‘static_assert’
static_assert((POLLREMOVE) == (0x0800), "POLLREMOVE != 0x0800");
^~~~~~~~~~~~~

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>

7b1c4fa 2018-12-14 18:50:50 han_mao@c-sky.com

several patches for uclibc ng

I've got several patches to fix ltp/openmp/uclibc-ng-test testcase fail on
c-sky.
- fix a ltp testcase.
- fix the problem that pthread creat will fail when libomp is linked before
libc, the variable pagesize is not init.
- fix tst-cancel4 and tst-cancel16. tst-cancelx4 and tst-cancelx16 still fail
with this patch applied, cleanup handler is not called for open/creat/fcntl,
seems some thing wrong with unwind, I haven't check the rootcause yet.

358b780 2018-12-14 18:50:20 Guo Ren

MAINTAINERS: add Mao Han for CSKY

Signed-off-by: Guo Ren <ren_guo@c-sky.com>
Signed-off-by: Mao Han <han_mao@c-sky.com>

8a73a96 2018-11-27 23:42:48 Waldemar Brodkorb

statfs.h: sync generic header with glibc

Fix issues with aarch64 and df with mismatching header between kernel
and libc.

fa9cfbf 2018-11-23 22:24:29 Volodymyr Boyko

Defined INLINE_SYSCALL_NOERR_NCS in mips/bits/syscalls.h

On Linux/MIPS (O32 ABI) for system call we have two result registers - v0 and a3.
v0 contains actual syscall result on success or error number on fail, a3 set to 0/1
for indicating syscall success/fail. (if a3 == 1, v0 contains errno).
Now as we can see from definition of handle_sys (arch/mips/kernel/scall32-o32.S),
handler treats returned by syscall function (let's call "original") values in
range [-EMAXERRNO; 0[ as -errno, a3 is set to 1 and final returned (to userspace)
value is (-original).

INLINE_SYSCALL_NOERR_NCS defined in mips/bits/syscalls.h will handle
this behaviour.

Signed-off-by: Volodymyr Boyko <boyko.cxx@gmail.com>

cbfdb7a 2018-11-14 12:05:39 Waldemar Brodkorb

bump for release 1.0.31

b2db04d 2018-11-01 12:43:45 Christophe Lyon

Add support for Thumb-only processors.

* ldso/ldso/arm/aeabi_read_tp.S: Add Thumb version.
* ldso/ldso/arm/dl-startup.h: Do not force ARM encoding, adjust
for Thumb.
* ldso/ldso/arm/resolve.S: Force Thumb encoding on Thumb-only
processors.
* libc/sysdeps/linux/arm/crt1.S: Do not force ARM encoding, adjust
for Thumb.

Signed-off-by: Mickaël Guêné <mickael.guene@st.com>
Signed-off-by: Christophe Lyon <christophe.lyon@st.com>

1b41063 2018-11-01 12:43:35 Petr Vorel

time.h: Add CLOCK_TAI

Added in kernel in kernel 3.10 in
1ff3c9677bff ("timekeeping: Add CLOCK_TAI clockid")

NOTE: CLOCK_SGI_CYCLE was not added, as it has been lately removed.

Signed-off-by: Petr Vorel <petr.vorel@gmail.com>

89addcb 2018-11-01 12:43:32 Carlos Santos

mkostemp64: clear flags, as mkostemp does

This should have been made in commit 9649721950 but was forgotten.

Signed-off-by: Carlos Santos <casantos@datacom.com.br>

447f72b 2018-10-27 17:54:43 Evgeniy Didin

ARC: Accommodate TLS fix in Binutils

[1] fixes clash of TLS variables on ARC and since LD now calculates relocations
a bit different now we need to update dynamic loader as well otherwise relocs
will be calculated improperly.

Note this is an ABI change and should go in-line with corresponding ARC tools.
That said either arc-2018.09 (to be released in few weeks) or the next version of upstream
Binutils (2.32) are required for normal TLS work on ARC.

Testcase:
----------------------------------8<-------------------------------
#include <stdio.h>
int foo3(void);
int foo1(void);

#ifdef _SHARED
int foo1(){
static __thread int val3=1;
val3 += 2;
return val3;
}

#elif _SHARED2
int foo3(){
static __thread int val2=0;
val2 += 2;
return val2;
}
#else
int main(){
printf("foo1 = %d \n", foo1());
printf("foo3 = %d \n", foo3());
return 0;
}
#endif
--------------------------------->8---------------------------------------

The result shoud be:
----8<----
foo1 = 3
foo3 = 2
---->8----

Commands to build artefacts:
----------------------------------------8<-------------------------------
arc-linux-gcc -fPIE -ffunction-sections -fdata-sections -pthread -Os \
-fPIC -o testtls.o -D_SHARED -c tst.c
arc-linux-gcc -fPIE -ffunction-sections -fdata-sections -pthread -Os \
-fPIC -o testtls2.o -D_SHARED2 -c tst.c
arc-linux-gcc -shared -o libtesttls.so testtls.o testtls2.o -lm -Os
arc-linux-gcc tst.c -o tst.out -L./ -ltesttls -Os -fPIE
--------------------------------->8---------------------------------------

Add path to libtesttls.so file to LD_LIBRARY_PATH before runnig
tst.out application.

[1] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=714e9a954a2e4123dcb26bb8da850e1344de4f5f

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Evgeniy Didin <didin@synopsys.com>
CC: Cupertino Miranda <cmiranda@synopsys.com>
CC: Vineet Gupta <vgupta@synopsys.com>
CC: Waldemar Brodkorb <wbx@uclibc-ng.org>

f2aac99 2018-10-20 23:25:49 Waldemar Brodkorb

do not expose recvmmsg/sendmmsg for unsupported kernels

e550b5c 2018-09-21 10:42:11 Guo Ren

bugfix renameat2 wrong implement.

Signed-off-by: Guo Ren <ren_guo@c-sky.com>

f664078 2018-09-21 10:42:08 Segev Finer

wordexp: Fix the usage of the internal _itoa function

The original from glibc received the end of the buffer and worked
backwards. Ours needs the beginning of the buffer.

Signed-off-by: Segev Finer <segev208@gmail.com>

85baf42 2018-08-17 04:42:42 Guo Ren

sched_setaffinity: use the same style with glibc's

Call getpid() in INTERNAL_SYSCALL will break the argument regs,
because gcc couldn't save destoryed regs for system call asm.

Ref to glibc, we could just remove all the check code.

Signed-off-by: Guo Ren <ren_guo@c-sky.com>

13c46fb 2018-08-10 23:02:45 Christophe Lyon

rtld: Avoid crash on R_ARM_NONE relocation

R_ARM_NONE contains no data, so avoid dereferencing it.

* ldso/ldso/arm/elfinterp.c (_dl_do_reloc): Handle R_ARM_NONE
relocation
(_dl_do_reloc_lazy): Likewise.

Signed-off-by: Mickaël Guêné <mickael.guene@st.com>
Signed-off-by: Christophe Lyon <christophe.lyon@st.com>

1a2cdf2 2018-08-10 23:02:45 Christophe Lyon

Fix shm_open posix compliance error code

Handle EISDIR in shm_open like glibc does, and set EINVAL.

* librt/shm.c (shm_open): Handle EISDIR error.

Signed-off-by: Mickaël Guêné <mickael.guene@st.com>
Signed-off-by: Christophe Lyon <christophe.lyon@st.com>

e54692f 2018-08-10 23:02:45 Christophe Lyon

mbtowc: Fix non compliant behavior for end of string

Match glibc behavior.

* libc/stdlib/stdlib.c (mbtowc): Fix end of string behavior.

Signed-off-by: Mickaël Guêné <mickael.guene@st.com>
Signed-off-by: Christophe Lyon <christophe.lyon@st.com>

d53bc34 2018-08-10 23:02:45 Christophe Lyon

isnan: Add isnan weak alias to __isnan

* libm/s_isnan.c: Add isnan weak alias.

Signed-off-by: Mickaël Guêné <mickael.guene@st.com>
Signed-off-by: Christophe Lyon <christophe.lyon@st.com>

b5ec02b 2018-08-10 23:02:45 Christophe Lyon

Fix htab_delete loop counter

dlclose can crash or stuck the system:

When calling dlclose() then system can crash or freeze, because
htab_delete() in ldso/ldso/fdpic/dl-inlines.h uses size_t for i which
is a typedef to unsigned int. We exit the loop on negative value of i
which can never occur since i is an unsigned int. This leads to random
free of various pointers that kill the system.

* ldso/include/inline-hashtab.h (htab_delete): Change type of 'i' to int.

Signed-off-by: Mickaël Guêné <mickael.guene@st.com>
Signed-off-by: Christophe Lyon <christophe.lyon@st.com>

a7d538f 2018-08-10 23:02:45 Christophe Lyon

nptl threads: Fix bug in using a weak variable.

In case __nptl_nthreads is not defined in the final binary then avoid
dereferencing the address since it's null. Anyway this means there is
no other thread and so we must exit.

* libc/misc/internals/__uClibc_main.c (__uClibc_main): Handle case
where &__nptl_nthreads is null.

Signed-off-by: Mickaël Guêné <mickael.guene@st.com>
Signed-off-by: Christophe Lyon <christophe.lyon@st.com>

0f4ddec 2018-08-10 23:02:45 Christophe Lyon

nptl: Replace sbrk with mmap

Replace sbrk with mmap since this commit disables sbrk area
for FDPIC MMU-less platform:
fs/binfmt_elf_fdpic.c: fix brk area overlap with stack on NOMMU
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/fs/binfmt_elf_fdpic.c?id=4ac313111018cb44ecc250445de5ccb93026a980

* libpthread/nptl/sysdeps/generic/libc-tls.c (__libc_setup_tls):
Handle __FDPIC__.

Signed-off-by: Mickaël Guêné <mickael.guene@st.com>
Signed-off-by: Christophe Lyon <christophe.lyon@st.com>

13fcd46 2018-08-10 23:02:45 Christophe Lyon

nptl: Clear TLS area for static binaries.

busybox init checks it has pid 1, but getpid() returns another value
when building busybox statically. This is because the corresponding
area is not cleared when allocated (it is allocated with
MAP_UNINITIALIZED, whose behavior depends on the Linux kernel's
CONFIG_MMAP_ALLOW_UNINITIALIZED).

This patch fixes the problem by explicitly clearing the memory area.

* libpthread/nptl/sysdeps/generic/libc-tls.c (__libc_tls_setup):
Clear tlsblock.

Signed-off-by: Mickaël Guêné <mickael.guene@st.com>
Signed-off-by: Christophe Lyon <christophe.lyon@st.com>

606a8b2 2018-08-10 23:02:45 Christophe Lyon

nptl: Use vfork on MMU-less for system()

* libc/stdlib/system.c (FORK): Map to vfork if __ARCH_USE_MMU__
is defined.

Signed-off-by: Mickaël Guêné <mickael.guene@st.com>
Signed-off-by: Christophe Lyon <christophe.lyon@st.com>