[uclibc-ng-devel] write is not weak?

2018-06-22 Thread Christophe Lyon
Hi, While working on FDPIC support for ARM in uclibc-ng, I've noticed that the write() function if defined as a strong global symbol, while the __GI_write alias is weak. 0034 wF .text 005c .hidden __GI_write 0034 g F .text 005c write my pre-processed write.i

Re: [uclibc-ng-devel] write is not weak?

2018-06-25 Thread Christophe Lyon
On Sun, 24 Jun 2018 at 18:37, Waldemar Brodkorb wrote: > > Hi Christophe, > Christophe Lyon wrote, > > > Hi, > > > > While working on FDPIC support for ARM in uclibc-ng, I've noticed that > > the write() function if defined as a strong global symbol, wh

Re: [uclibc-ng-devel] [PATCH 00/32] FDPIC ABI for ARM

2018-07-31 Thread Christophe Lyon
On Tue, 31 Jul 2018 at 14:58, Waldemar Brodkorb wrote: > Hi, > > > Am 30.07.2018 um 15:50 schrieb Christophe Lyon < > christophe.l...@linaro.org>: > > > >> On Wed, 25 Jul 2018 at 07:20, Waldemar Brodkorb > wrote: > >> > >> Hi

Re: [uclibc-ng-devel] [PATCH 04/32] [ARM][FDPIC] rtld: Add FDPIC code for arm

2018-08-06 Thread Christophe Lyon
On 04/07/2018 17:55, Christophe Lyon wrote: Add FDPIC dynamic relocations support, similar to what other FDPIC targets do. Here is version 2 of this patch. >From 01c34002c0033f7027b0505a3ffb7e2c0ebf423a Mon Sep 17 00:00:00 2001 From: Christophe Lyon Date: Fri, 18 Jan 2013

Re: [uclibc-ng-devel] [PATCH 11/32] [ARM][FDPIC] rtld: Add lazy binding support

2018-08-06 Thread Christophe Lyon
On 04/07/2018 17:55, Christophe Lyon wrote: Add support for R_ARM_FUNCDESC_VALUE and implement _dl_linux_resolver for FDPIC on ARM. Here is v2 of this patch. >From 060a6ac2e81f9aa739d2eaf31b151f9e7e7d468f Mon Sep 17 00:00:00 2001 From: Christophe Lyon Date: Thu, 28 Mar 2013 10:46:55 +0

Re: [uclibc-ng-devel] [PATCH 00/32] FDPIC ABI for ARM

2018-07-18 Thread Christophe Lyon
On Wed, 18 Jul 2018 at 18:37, Waldemar Brodkorb wrote: > > Hi, > Christophe Lyon wrote, > > > On Wed, 18 Jul 2018 at 09:37, Waldemar Brodkorb wrote: > > > > > > Hi Christophe, > > > Waldemar Brodkorb wrote, > > > > > > > Hi Chr

Re: [uclibc-ng-devel] [PATCH 00/32] FDPIC ABI for ARM

2018-07-20 Thread Christophe Lyon
s to be squashed with patch 4/32 "rtld: Add FDPIC code for arm" What the practice on this list? Shall I send v2 of patch 4/32 asap, on rather wait for feedback on other patches and then send a v2 of the whole series? Thanks, Christophe > best regards > > Waldemar > > &g

Re: [uclibc-ng-devel] [PATCH 00/32] FDPIC ABI for ARM

2018-07-19 Thread Christophe Lyon
On Thu, 19 Jul 2018 at 14:33, Waldemar Brodkorb wrote: > > Hi, > Christophe Lyon wrote, > > > On Wed, 18 Jul 2018 at 18:37, Waldemar Brodkorb wrote: > > > > > > Hi, > > > Christophe Lyon wrote, > > > > > > > On Wed, 18 Jul 2018 a

Re: [uclibc-ng-devel] [PATCH 00/32] FDPIC ABI for ARM

2018-07-18 Thread Christophe Lyon
On Wed, 18 Jul 2018 at 09:37, Waldemar Brodkorb wrote: > > Hi Christophe, > Waldemar Brodkorb wrote, > > > Hi Christophe, > > > > i am doing a large testrun for the global changes and hopefully push on > > monday or at least have some news. i am afk atm with just little access to > > a

Re: [uclibc-ng-devel] [PATCH 06/32] [ARM][FDPIC] rtld: Add startup code

2018-07-05 Thread Christophe Lyon
On Thu, 5 Jul 2018 at 10:59, Thomas Petazzoni wrote: > > Hello, > > On Thu, 5 Jul 2018 10:55:26 +0200, Christophe Lyon wrote: > > > > /tmp/cceTVltl.s: Assembler messages: > > > /tmp/cceTVltl.s:14: Error: selected processor does not support ARM opcodes > &g

[uclibc-ng-devel] [PATCH 01/32] [ARM][FDPIC] Allow to select FDPIC ELF for arm architecture

2018-07-04 Thread Christophe 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é Signed-off-by: Christophe Lyon diff --git a/extra/Configs/Config.in.arch b/extra/Configs/Config.in.arch index b51ed81..91b6394 100644 --- a/extra/Configs

[uclibc-ng-devel] [PATCH 02/32] [FDPIC] rtld: Do not protect RELRO segments when we don't use an MMU.

2018-07-04 Thread 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 diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c index d264e6a..1768b5b 100644 --- a/ldso

[uclibc-ng-devel] [PATCH 03/32] [ARM][FDPIC] rtld: Add #if defined (__FDPIC__)

2018-07-04 Thread Christophe Lyon
-by: Mickaël Guêné Signed-off-by: Christophe Lyon diff --git a/include/link.h b/include/link.h index 711777b..ef4a016 100644 --- a/include/link.h +++ b/include/link.h @@ -79,7 +79,7 @@ extern struct r_debug _r_debug; */ extern ElfW(Dyn) _DYNAMIC[]; -#if defined(__FRV_FDPIC__) || defined

[uclibc-ng-devel] [PATCH 00/32] FDPIC ABI for ARM

2018-07-04 Thread Christophe Lyon
ps://git.qemu.org/?p=qemu.git;a=commit;h=e8fa72957419c11984608062c7dcb204a6003a06 [6] https://gcc.gnu.org/ml/gcc-patches/2018-05/msg01439.html Christophe Lyon (32): [ARM][FDPIC] Allow to select FDPIC ELF for arm architecture [FDPIC] rtld: Do not protect RELRO segments when we don't use an MMU.

[uclibc-ng-devel] [PATCH 18/32] [FDPIC] nptl: disable mprotect usage in stack protection

2018-07-04 Thread Christophe Lyon
-by: Christophe Lyon diff --git a/libpthread/nptl/allocatestack.c b/libpthread/nptl/allocatestack.c index 2900517..1379795 100644 --- a/libpthread/nptl/allocatestack.c +++ b/libpthread/nptl/allocatestack.c @@ -328,8 +328,10 @@ change_stack_perm (struct pthread *pd #else # error "Define e

[uclibc-ng-devel] [PATCH 16/32] [ARM][FDPIC] rtld: Use ELF_RTYPE_CLASS_DLSYM

2018-07-04 Thread Christophe Lyon
rtld must call _dl_find_hash() with ELF_RTYPE_CLASS_DLSYM since we want a function descriptor. * ldso/ldso/ldso.c (_dl_get_ready_to_run): Support __FDPIC__. Signed-off-by: Mickaël Guêné Signed-off-by: Christophe Lyon diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c index 06b0ac8

[uclibc-ng-devel] [PATCH 19/32] [FDPIC] nptl: Disable fork and atfork on MMU-less systems.

2018-07-04 Thread Christophe Lyon
(__libc_pthread_init): Handle __ARCH_USE_MMU__. * libpthread/nptl/sysdeps/unix/sysv/linux/register-atfork.c: Likewise. * libpthread/nptl/sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise. Signed-off-by: Mickaël Guêné Signed-off-by: Christophe Lyon diff --git a/libpthread/nptl

[uclibc-ng-devel] [PATCH 26/32] [FDPIC] nptl: Replace sbrk with mmap

2018-07-04 Thread Christophe Lyon
* libpthread/nptl/sysdeps/generic/libc-tls.c (__libc_setup_tls): Handle __FDPIC__. Signed-off-by: Mickaël Guêné Signed-off-by: Christophe Lyon diff --git a/libpthread/nptl/sysdeps/generic/libc-tls.c b/libpthread/nptl/sysdeps/generic/libc-tls.c index 5f89c91..a6df4cd 100644

[uclibc-ng-devel] [PATCH 27/32] nptl threads: Fix bug in using a weak variable.

2018-07-04 Thread Christophe Lyon
null. Signed-off-by: Mickaël Guêné Signed-off-by: Christophe Lyon diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c index d8286f2..849bca8 100644 --- a/libc/misc/internals/__uClibc_main.c +++ b/libc/misc/internals/__uClibc_main.c @@ -544,7 +544,7 @@ void __uClibc_

[uclibc-ng-devel] [PATCH 29/32] isnan: Add isnan weak alias to __isnan

2018-07-04 Thread Christophe Lyon
* libm/s_isnan.c: Add isnan weak alias. Signed-off-by: Mickaël Guêné Signed-off-by: Christophe Lyon diff --git a/libm/s_isnan.c b/libm/s_isnan.c index 1bc49cb..1aabb74 100644 --- a/libm/s_isnan.c +++ b/libm/s_isnan.c @@ -26,4 +26,5 @@ int __isnan(double x) hx = 0x7ff0 - hx

[uclibc-ng-devel] [PATCH 32/32] [ARM] rtld: Avoid crash on R_ARM_NONE relocation

2018-07-04 Thread Christophe Lyon
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é Signed-off-by: Christophe Lyon diff --git a/ldso/ldso/arm/elfinterp.c b/ldso

[uclibc-ng-devel] [PATCH 30/32] mbtowc: Fix non compliant behavior for end of string

2018-07-04 Thread Christophe Lyon
Match glibc behavior. * libc/stdlib/stdlib.c (mbtowc): Fix end of string behavior. Signed-off-by: Mickaël Guêné Signed-off-by: Christophe Lyon diff --git a/libc/stdlib/stdlib.c b/libc/stdlib/stdlib.c index 075e6e5..f593663 100644 --- a/libc/stdlib/stdlib.c +++ b/libc/stdlib/stdlib.c

[uclibc-ng-devel] [PATCH 07/32] [ARM] Fix bug in _dl_pread when using pread64 syscall

2018-07-04 Thread Christophe Lyon
(__DL_PREAD): Handle __NR_pread64. Signed-off-by: Mickaël Guêné Signed-off-by: Christophe Lyon diff --git a/ldso/include/dl-syscall.h b/ldso/include/dl-syscall.h index 5ba8c87..9d80c6a 100644 --- a/ldso/include/dl-syscall.h +++ b/ldso/include/dl-syscall.h @@ -159,14 +159,25 @@ static __always_inline

[uclibc-ng-devel] [PATCH 09/32] [ARM][FDPIC] Add runtime support needed for C++ exceptions

2018-07-04 Thread Christophe 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é Signed-off-by: Christophe Lyon diff --git a/libc/sysdeps

[uclibc-ng-devel] [PATCH 12/32] [ARM][FDPIC] TLS: fix relocation computation

2018-07-04 Thread Christophe Lyon
* 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é Signed-off-by: Christophe Lyon diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c index 1768b5b

[uclibc-ng-devel] [PATCH 10/32] [ARM][FDPIC] Allow to generate PIE 'static' binary

2018-07-04 Thread Christophe 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é Signed-off-by: Christophe Lyon diff --git a/libc/misc/internals/__uClibc_main.c

[uclibc-ng-devel] [PATCH 11/32] [ARM][FDPIC] rtld: Add lazy binding support

2018-07-04 Thread Christophe Lyon
Guêné Signed-off-by: Christophe Lyon diff --git a/ldso/ldso/arm/elfinterp.c b/ldso/ldso/arm/elfinterp.c index 1435c2c..3bcd675 100644 --- a/ldso/ldso/arm/elfinterp.c +++ b/ldso/ldso/arm/elfinterp.c @@ -34,13 +34,69 @@ extern int _dl_linux_resolve(void); -unsigned long _dl_linux_resolver(struct

[uclibc-ng-devel] [PATCH 13/32] [ARM][FDPIC] rtld: Compile with -fno-unwind-tables -fno-asynchronous-unwind-tables

2018-07-04 Thread Christophe Lyon
/libgcc.a(unwind-arm.o): in function `unwind_phase2_forced': /libgcc/unwind-arm-common.inc:511: undefined reference to `memcpy' * ldso/ldso/Makefile.in (CFLAGS-rtld): Always use -fno-unwind-tables -fno-asynchronous-unwind-tables on arm Signed-off-by: Christophe Lyon diff --git a/ldso

[uclibc-ng-devel] [PATCH 14/32] [ARM][FDPIC] arm/clone.S: Fix threading support

2018-07-04 Thread Christophe Lyon
Change clone.S so that in FDPIC case we take into account the fact that we are given a function descriptor. * libc/sysdeps/linux/arm/clone.S (__clone): Support __FDPIC__. Signed-off-by: Mickaël Guêné Signed-off-by: Christophe Lyon diff --git a/libc/sysdeps/linux/arm/clone.S b/libc

[uclibc-ng-devel] [PATCH 22/32] [FDPIC] nptl: Allow sem_open to work on MMU-less systems

2018-07-04 Thread Christophe Lyon
-by: Mickaël Guêné Signed-off-by: Christophe Lyon diff --git a/libpthread/nptl/linux_fsinfo.h b/libpthread/nptl/linux_fsinfo.h index 8537581..4abe792 100644 --- a/libpthread/nptl/linux_fsinfo.h +++ b/libpthread/nptl/linux_fsinfo.h @@ -126,7 +126,10 @@ #define XENIX_SUPER_MAGIC 0x012ff7b4

[uclibc-ng-devel] [PATCH 24/32] [FDPIC] nptl: Use vfork on MMU-less for system()

2018-07-04 Thread Christophe Lyon
* libc/stdlib/system.c (FORK): Map to vfork if __ARCH_USE_MMU__ is defined. Signed-off-by: Mickaël Guêné Signed-off-by: Christophe Lyon diff --git a/libc/stdlib/system.c b/libc/stdlib/system.c index 771c30e..4c010bb 100644 --- a/libc/stdlib/system.c +++ b/libc/stdlib/system.c

[uclibc-ng-devel] [PATCH 23/32] [FDPIC] nptl: Add pthread_mutex_getprioceiling and pthread_mutex_setprioceiling support

2018-07-04 Thread Christophe Lyon
* libpthread/nptl/Makefile.in (libpthread-routines-): Remove pthread_mutex_getprioceiling.c and pthread_mutex_setprioceiling.c. Signed-off-by: Mickaël Guêné Signed-off-by: Christophe Lyon diff --git a/libpthread/nptl/Makefile.in b/libpthread/nptl/Makefile.in index a2f30ac

[uclibc-ng-devel] [PATCH 20/32] [FDPIC] nptl: Do not use madvise

2018-07-04 Thread Christophe Lyon
start_thread() uses it, but it is not supported on MMU-less systems. * libpthread/nptl/pthread_create.c (start_thread): Call madvise only if __ARCH_USE_MMU__ is defined. Signed-off-by: Mickaël Guêné Signed-off-by: Christophe Lyon diff --git a/libpthread/nptl/pthread_create.c b

Re: [uclibc-ng-devel] [ARM][FDPIC]: Add support for Thumb-only processors.

2018-10-24 Thread Christophe Lyon
On Wed, 24 Oct 2018 at 14:39, Waldemar Brodkorb wrote: > > Hi, > > are the gcc patches upstream now? > They are still under discussion with the maintainers. > Christophe Lyon wrote, > > > Hi, > > > > This patch enables to compile uClibc-ng in FDPIC mode

[uclibc-ng-devel] [ARM][FDPIC]: Add support for Thumb-only processors.

2018-10-23 Thread Christophe Lyon
encoding, adjust for Thumb. Signed-off-by: Mickaël Guêné Signed-off-by: Christophe Lyon diff --git a/ldso/ldso/arm/aeabi_read_tp.S b/ldso/ldso/arm/aeabi_read_tp.S index 77e0d6e..5ab5125 100644 --- a/ldso/ldso/arm/aeabi_read_tp.S +++ b/ldso/ldso/arm/aeabi_read_tp.S @@ -53,9 +53,23 @@ #else

Re: [uclibc-ng-devel] [ARM][FDPIC]: Add support for Thumb-only processors.

2018-10-29 Thread Christophe Lyon
t am --skip" instead. > To restore the original branch and stop patching, run "git am > --abort". > > best regards > Waldemar > > > On Wed, 24 Oct 2018 at 14:39, Waldemar Brodkorb wrote: > > > > > > Hi, > > > > > >

Re: [uclibc-ng-devel] uClibc-ng 1.0.31 allowed ARM/FDPIC

2019-02-20 Thread Christophe Lyon
On Wed, 20 Feb 2019 at 09:20, Alexey Neyman wrote: > > Hi, > > I've noticed that uClibc-ng now allows the FDPIC ELF for ARM: one of the > crosstool-NG samples that configures a toolchain for ARM with no MMU now > defaults to FDPIC rather than flat format. The problem is, though, it > then fails -

[uclibc-ng-devel] -static-pie and FDPIC

2019-05-20 Thread Christophe Lyon
Hi, My recent attempt at submitting the GCC patch series to add FDPIC support for arm triggered a discussion about -static-pie support [1], which continued on IRC. The patch currently supports -static but the resulting binary still needs the dynamic linker to prepare the parameters for