* libs/libc/misc/lib_getrandom.c, in function getrandom():
We were assigning the return value of _NX_READ() to nbytes, a
variable of the unsigned type size_t. Note that _NX_READ() resolves
to either read() or nx_read(), both of which return the signed type
ssize_t to indicate either the number of bytes read successfully
(>= 0) or an error (< 0). Then we were testing for a negative
size_t value, a condition that can never occur. The end result is
that if an error occured in _NX_READ(), it would never be detected
and getrandom() would return some large positive value. This bug is
corrected by assigning the return value of _NX_READ() to a new local
variable, ret, of size ssize_t.
The "p" format specifier already prepends the pointer address with
"0x" when printing.
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
Make use of XCHG/BSWAP on x86, REV16 and REV on ARMv6-m and above,
and whatever other optimized instructions on other platforms.
Defines extra CONFIG variables, and removes the unused functions for
endian-swapping. Fixes some oversights in using the macros.
For CONFIG_BUILD_KERNEL using the sched/task/task_exithook implementation
will just not work. It calls user code with kernel privileges which is
a bit of a security issue.
Targets build during the kernel phase did not have their dependencies
specified and thus they were not rebuilt after their dependencies have
changed, for example by changing options in menuconfig.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
Summary:
- This commit adds R_RISCV_JAL support to arch_elf.c
- The code only checks the immediate value but does not relocate it
because it is done by the compiler.
Impact:
- None
Testing:
- Tested with rv-virt:knsh64 (not merged yet)
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
Do not call strlen() here. Old implementation iterated
over string twice, if searched for position was at the
beginning. This commit changes strrchr() to scan string
only once, regardless of input.
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
to fix the gcov link error:
arm-none-eabi-ld: /home/xiaoxiang/vela/prebuilts/gcc/linux/arm/bin/../lib/gcc/arm-none-eabi/10.3.1/thumb/v7e-m/nofp/libgcov.a(_gcov.o): in function `gcov_error_exit':
libgcov-driver.c:(.text+0x7c): undefined reference to `_impure_ptr'
arm-none-eabi-ld: /home/xiaoxiang/vela/prebuilts/gcc/linux/arm/bin/../lib/gcc/arm-none-eabi/10.3.1/thumb/v7e-m/nofp/libgcov.a(_gcov.o): in function `get_gcov_error_file':
libgcov-driver.c:(.text+0x1e0): undefined reference to `_impure_ptr'
arm-none-eabi-ld: /home/xiaoxiang/vela/prebuilts/gcc/linux/arm/bin/../lib/gcc/arm-none-eabi/10.3.1/thumb/v7e-m/nofp/libgcov.a(_gcov.o): in function `gcov_exit_open_gcda_file.isra.0':
libgcov-driver.c:(.text+0x660): undefined reference to `_impure_ptr'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
1.Remove CXX_INITIALIZE_MACHO and CXX_INITIALIZE_SINIT
2.Merge cxx_initialize_sinit.c and cxx_initialize_macho.c into cxx_initialize.c
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>