summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-08-10Allow to generate PIE 'static' binaryChristophe Lyon
* 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é <mickael.guene@st.com> Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
2018-08-10Add runtime support needed for C++ exceptionsChristophe Lyon
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é <mickael.guene@st.com> Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
2018-08-10Add application startup code for FDPICChristophe Lyon
* libc/sysdeps/linux/arm/crt1.S: Define _start for __FDPIC__. Signed-off-by: Mickaël Guêné <mickael.guene@st.com> Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
2018-08-10Fix bug in _dl_pread when using pread64 syscallChristophe Lyon
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é <mickael.guene@st.com> Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
2018-08-10rtld: Add startup codeChristophe Lyon
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é <mickael.guene@st.com> Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
2018-08-10rtld: Avoid FUNCDESC relocation on _startChristophe Lyon
* ldso/ldso/ldso.c (_start): Fix definition for __FDPIC__. Signed-off-by: Mickaël Guêné <mickael.guene@st.com> Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
2018-08-10rtld: Add FDPIC code for armChristophe Lyon
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é <mickael.guene@st.com> Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
2018-08-10rtld: Add #if defined (__FDPIC__)Christophe Lyon
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é <mickael.guene@st.com> Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
2018-08-10rtld: Do not protect RELRO segments when we don't use an MMU.Christophe Lyon
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 <christophe.lyon@st.com>
2018-08-10Allow to select FDPIC ELF for arm architectureChristophe Lyon
* extra/Configs/Config.in.arch: Add TARGET_arm to the target list for UCLIBC_FORMAT_FDPIC_ELF. Signed-off-by: Mickaël Guêné <mickael.guene@st.com> Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
2018-06-29elf.h: add some missing definesWaldemar Brodkorb
2018-06-29ldso/arc: fix LD_DEBUG segv when printing R_ARC_NONEVineet Gupta
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2018-06-15Fix prototypes for preadv pwritev.Vlad Starodubtsev
2018-06-10risc-v: initial 64 bit port, static only (no TLS/NPTL)Waldemar Brodkorb
Only a simple hello world is tested in qemu system emulation.
2018-06-06remove unused assembler functions for armFlorian La Roche
These assembler functions seem to be unused/referenced, so we can remove them completely. Signed-off-by: Florian La Roche <Florian.LaRoche@googlemail.com>
2018-05-29libiconv: add missing header files from previuos commitWaldemar Brodkorb
Missed in 5fdd379d9dbf8be74f2f1a0d33e62958e817ae7d.
2018-05-27libiconv: port over simplified iconv from muslWaldemar Brodkorb
2018-05-05librt: clock_nanosleep could be even used without threadsWaldemar Brodkorb
2018-05-01librt: declare clock_nanosleep not only for NPTLWaldemar Brodkorb
Reported-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
2018-04-29Revert "ldconfig: add glibc compatibility fix"Waldemar Brodkorb
This reverts commit 2a3bb4daf5778c5875674cd26a3c75b3d460a042. This is breaking ld.so.cache usage. Seen on Gentoo/amd64. Reported-by: "Anthony G. Basile" <basile@freeharbor.net>
2018-04-28bump for release 1.0.30v1.0.30Waldemar Brodkorb
2018-04-28mention Tile architectureWaldemar Brodkorb
2018-04-27libdl: first execute all destructors, then munmap libraryWaldemar Brodkorb
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 <dflogeras2@gmail.com> Tested-By: Dave Flogeras <dflogeras2@gmail.com>
2018-04-27libdl: calculate the length for second parameter of munmap.Dave Flogeras
Revert 35105679b9a900d58dadd0852e679c235f8176ba and add some debug code.
2018-04-22linuxthreads: implement pthread_condattr_{s,g}etclock()Waldemar Brodkorb
More applications are using pthread_condattr_setclock()/ pthread_condattr_getclock() in their code. Port these two functions from NPTL over to be more compatible.
2018-04-22libdl: end must be bigger than startWaldemar Brodkorb
2018-04-22libdl: remove gcc warningsWaldemar Brodkorb
2018-04-22libiconv: remove function, which is not available w/o libiconv a4 macrosWaldemar Brodkorb
2018-04-17libdl: fix problem with unmappingWaldemar Brodkorb
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.
2018-04-17libdl: better checking and logging for ctors/dtorsWaldemar Brodkorb
2018-04-17libdl: remove dead codeWaldemar Brodkorb
2018-04-17libdl: remove LDSO_NO_CLEANUPWaldemar Brodkorb
2018-04-17libdl: cleanup old inline changelogWaldemar Brodkorb
2018-04-17Revert "libdl: fix dlclose() issue"Waldemar Brodkorb
This reverts commit bf4c2d242f587700e3eb2ffd5721ddaf3cdbc7e5.
2018-04-17common/sendfile.c: bugfix can't support offset is NULLGuo Ren
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 <ren_guo@c-sky.com>
2018-04-17Revert "common/sendfile.c: bugfix can't support offset is NULL"Waldemar Brodkorb
This reverts commit b00fd230ed0b49b9f23d829ad5d09859f34bb754.
2018-04-13lseek.c: bugfix ltp lseek01.cGuo Ren
Ref the implement from the glibc and high=0 seems so bad. Signed-off-by: Guo Ren <ren_guo@c-sky.com>
2018-04-13common/sendfile.c: bugfix can't support offset is NULLGuo Ren
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 <ren_guo@c-sky.com>
2018-04-13or1k: add F_{DUPFD_CLOEXEC, SETPIPE_SZ, GETPIPE_SZ}Thomas Petazzoni
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 <thomas.petazzoni@bootlin.com>
2018-04-02use __NR_newfstatat only for modern Linux architecturesWaldemar Brodkorb
Otherwise it breaks mips64 n64. Should be used for aarch64/tilegx only.
2018-03-22hppa: fix runtime issuesWaldemar Brodkorb
Sync clone()/vfork() with GNU C Library. Allow CFI and fix strsignal() / tcsetattr().
2018-03-15csky: support bsd-setjmp and bsd-_setjmp.Guo Ren
Signed-off-by: Guo Ren <ren_guo@c-sky.com>
2018-03-15libdl: fix dlclose() issueWaldemar Brodkorb
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.
2018-03-14Revert "Revert "libdl: fix size parameter when unmap library in dlclose""Waldemar Brodkorb
This reverts commit 952bb00f0b2eb576b0bf48c4f87018429a42e28d. And adds this fix for 64 Bit systems. http://lists.busybox.net/pipermail/uclibc/2014-December/048737.html
2018-03-12tile: add basic support for tilegxWaldemar Brodkorb
This adds basic support for tile architecture. Only static binaries, no ld.so or threading support. Tested with qemu-tilegx only.
2018-03-09sparc32: Add nop before __startcontext to stop unwindingWaldemar Brodkorb
From glibc commit 9aa5c222b9e0409143410a02b6364a3b25dbf028 [BZ #22919]
2018-03-05utils: fix compile of msgfmt/msgmergeWaldemar Brodkorb
The host utils are missing the dependencies, the target utils need libiconv enabled.
2018-03-04fenv: only allow for ppc e500Waldemar Brodkorb
2018-03-03bump for release 1.0.29v1.0.29Waldemar Brodkorb
2018-03-01add missing include to quieten compilerWaldemar Brodkorb