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
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;
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.
* 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.
* 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
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
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
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é
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
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
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:
* 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
* 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
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
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
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
* 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
---
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
---
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
23 matches
Mail list logo