2021-11-01 21:41:44 +01:00
|
|
|
diff -uNr llvm-project/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp llvm-project.mod/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
|
2022-02-26 12:53:42 +01:00
|
|
|
--- llvm-project/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp 2022-02-24 01:38:33.000000000 +0800
|
|
|
|
+++ llvm-project.mod/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp 2022-02-26 20:36:55.959542847 +0800
|
2021-11-01 21:41:44 +01:00
|
|
|
@@ -286,7 +286,7 @@
|
|
|
|
uintptr_t SlabSize = 0;
|
|
|
|
uintptr_t CurrentSlabOffset = 0;
|
|
|
|
SectionIDMap *SecIDMap = nullptr;
|
2022-02-26 12:53:42 +01:00
|
|
|
-#if defined(__x86_64__) && defined(__ELF__) && defined(__linux__)
|
|
|
|
+#if defined(__x86_64__) && defined(__ELF__) && defined(__linux__) && !defined(__TERMUX__)
|
2021-11-01 21:41:44 +01:00
|
|
|
unsigned UsedTLSStorage = 0;
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
@@ -350,7 +350,7 @@
|
|
|
|
|
|
|
|
// In case the execution needs TLS storage, we define a very small TLS memory
|
|
|
|
// area here that will be used in allocateTLSSection().
|
2022-02-26 12:53:42 +01:00
|
|
|
-#if defined(__x86_64__) && defined(__ELF__) && defined(__linux__)
|
|
|
|
+#if defined(__x86_64__) && defined(__ELF__) && defined(__linux__) && !defined(__TERMUX__)
|
2021-11-01 21:41:44 +01:00
|
|
|
extern "C" {
|
|
|
|
alignas(16) __attribute__((visibility("hidden"), tls_model("initial-exec"),
|
|
|
|
used)) thread_local char LLVMRTDyldTLSSpace[16];
|
|
|
|
@@ -361,7 +361,7 @@
|
|
|
|
TrivialMemoryManager::allocateTLSSection(uintptr_t Size, unsigned Alignment,
|
|
|
|
unsigned SectionID,
|
|
|
|
StringRef SectionName) {
|
2022-02-26 12:53:42 +01:00
|
|
|
-#if defined(__x86_64__) && defined(__ELF__) && defined(__linux__)
|
|
|
|
+#if defined(__x86_64__) && defined(__ELF__) && defined(__linux__) && !defined(__TERMUX__)
|
2021-11-01 21:41:44 +01:00
|
|
|
if (Size + UsedTLSStorage > sizeof(LLVMRTDyldTLSSpace)) {
|
|
|
|
return {};
|
|
|
|
}
|