[libc-commits] [PATCH] D151539: [libc] Initiliaze the global pointer in riscv startup code.
Siva Chandra via Phabricator via libc-commits
libc-commits at lists.llvm.org
Wed Jul 5 00:32:52 PDT 2023
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG3db36d6a9b57: [libc] Initiliaze the global pointer in riscv startup code. (authored by sivachandra).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D151539/new/
https://reviews.llvm.org/D151539
Files:
libc/startup/linux/riscv64/start.cpp
libc/test/src/stdio/CMakeLists.txt
Index: libc/test/src/stdio/CMakeLists.txt
===================================================================
--- libc/test/src/stdio/CMakeLists.txt
+++ libc/test/src/stdio/CMakeLists.txt
@@ -114,6 +114,7 @@
add_fp_unittest(
sprintf_test
+ UNIT_TEST_ONLY
SUITE
libc_stdio_unittests
SRCS
Index: libc/startup/linux/riscv64/start.cpp
===================================================================
--- libc/startup/linux/riscv64/start.cpp
+++ libc/startup/linux/riscv64/start.cpp
@@ -123,6 +123,10 @@
};
__attribute__((noinline)) static void do_start() {
+ LIBC_INLINE_ASM(".option push\n\t"
+ ".option norelax\n\t"
+ "lla gp, __global_pointer$\n\t"
+ ".option pop\n\t");
auto tid = __llvm_libc::syscall_impl(SYS_gettid);
if (tid <= 0)
__llvm_libc::syscall_impl(SYS_exit, 1);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151539.537241.patch
Type: text/x-patch
Size: 862 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230705/bd6cab25/attachment.bin>
More information about the libc-commits
mailing list