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/ldso
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é
Signed-off-by: Christophe Lyon
diff --git a/librt/shm.c b/librt/shm.c
index 40e69fa..79c98a3 100644
--- a/librt/shm.c
+++ b/librt/shm.c
@@ -84,6 +84,9
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
@@
* 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;
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
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
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.
Signe
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 p
* 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
@@
Allow both tmpfs and ramfs for shm devices.
* libpthread/nptl/linux_fsinfo.h (SHMFS_SUPER_MAGIC_WITH_MMU): Define.
(SHMFS_SUPER_MAGIC_WITHOUT_MMU): Define.
* libpthread/nptl/sem_open.c (__where_is_shmfs): Add support for
SHMFS_SUPER_MAGIC_WITHOUT_MMU.
Signed-off-by
* 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..bd220
phdr->p_vaddr of TLS segment is not a valid value for FDPIC so we can
either translate phdr->p_vaddr using loadmap (not easy here) or use a
new linker script defined symbol, whih this patch does.
* libpthread/nptl/sysdeps/generic/libc-tls.c (__tdata_start): Declare.
(__libc_setup_t
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/
They do not work on MMU-less systems.
For atfork, implement a hidden function that always returns EPERM.
* libpthread/nptl/sysdeps/unix/sysv/linux/fork.c: Disable if
__ARCH_USE_MMU__ is not defined.
* libpthread/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c
(__l
Since mprotect does not work on MMU-less systems, disable it if
__ARCH_USE_MMU__ is not defined.
* libpthread/nptl/allocatestack.c (change_stack_perm): Call
mprotect only if __ARCH_USE_MMU__ is defined.
(allocate_stack): Likewise.
Signed-off-by: Mickaël Guêné
Signed-off-b
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..b3354
Make _dl_initial_error_catch_tsd hidden, such that we do not need a
FUNCDESC relocation when initializing _dl_error_catch_tsd.
* ldso/ldso/dl-tls.c (_dl_initial_error_catch_tsd): Declare hidden.
Signed-off-by: Mickaël Guêné
Signed-off-by: Christophe Lyon
diff --git a/ldso/ldso/dl-tls.c
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/sysd
* extra/Configs/Config.in: enable UCLIBC_HAS_THREADS_NATIVE on
TARGET_arm.
Signed-off-by: Christophe Lyon
diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in
index 7443903..f96511f 100644
--- a/extra/Configs/Config.in
+++ b/extra/Configs/Config.in
@@ -541,7 +541,7 @@ c
Otherwise we have link errors because of unresolved refs in libgcc.a:
ld: /lib/gcc/arm-none-uclinuxfdpiceabi/9.0.0/libgcc.a(pr-support.o): in
function `_Unwind_GetDataRelBase':
/libgcc/config/arm/pr-support.c:378: undefined reference to `abort'
ld: /lib/gcc/arm-none-uclinuxfdpiceabi/9.0.0/libgcc.
* 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..9cb46
* 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
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é
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/
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_
* libc/sysdeps/linux/arm/crt1.S: Define _start for __FDPIC__.
Signed-off-by: Mickaël Guêné
Signed-off-by: Christophe Lyon
diff --git a/libc/sysdeps/linux/arm/crt1.S b/libc/sysdeps/linux/arm/crt1.S
index ab3b0d2..f74cf3b 100644
--- a/libc/sysdeps/linux/arm/crt1.S
+++ b/libc/sysdeps/linux
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é
Signed-off-by: Christophe Lyon
diff --git a/ldso/ldso/arm/dl-startup.h b/ldso/ldso/arm/dl-startup.h
in
* ldso/ldso/ldso.c (_start): Fix definition for __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 17818b5..c625757 100644
--- a/ldso/ldso/ldso.c
+++ b/ldso/ldso/ldso.c
@@ -109,7 +109,13 @@ static unsigned char *
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
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
* 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/C
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/ldso
Hello,
This patch series implements the uClibc-ng contribution of the FDPIC
ABI for ARM targets.
This ABI enables to run Linux on ARM MMU-less cores and supports
shared libraries to reduce the memory footprint.
Without MMU, text and data segments relative distances are different
from one process
33 matches
Mail list logo