[libc] Fix set_thread_ptr call in rv32 start up code

This patch changes the instruction in set_thread_ptr from ld to mv,
as rv32 doesn't have the ld instruction, and mv is supported by both
rv32 and rv64.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D159110
This commit is contained in:
Mikhail R. Gadelha 2023-08-30 11:27:00 -03:00
parent 36c9afc7a8
commit b0272d8ec3

View File

@ -80,7 +80,7 @@ void cleanup_tls(uintptr_t addr, uintptr_t size) {
}
static void set_thread_ptr(uintptr_t val) {
LIBC_INLINE_ASM("ld tp, %0\n\t" : : "m"(val));
LIBC_INLINE_ASM("mv tp, %0\n\t" : : "r"(val));
}
using InitCallback = void(int, char **, char **);