Skip to content

Commit 902b3d7

Browse files
author
jiayifeng
committed
use __cxxabiv1::__cxa_thread_atexit instead of __cxa_thread_atexit_impl
1 parent 5562304 commit 902b3d7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

multipy/runtime/loader.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#include <climits>
5151
#include <cstdint>
5252
#include <cstring>
53+
#include <cxxabi.h>
5354
#include <functional>
5455
#include <iostream>
5556
#include <sstream>
@@ -244,9 +245,6 @@ struct EH_Frame_HDR {
244245
// with the module_id and offset.
245246
extern "C" void* __tls_get_addr(void*);
246247

247-
extern "C" int
248-
__cxa_thread_atexit_impl(void (*dtor)(void*), void* obj, void* dso_symbol);
249-
250248
// This object performs TLS emulation for modules not loaded by dlopen.
251249
// Normally modules have a module_id that is used as a key in libc for the
252250
// thread local data for that module. However, there is no public API for
@@ -987,7 +985,7 @@ struct __attribute__((visibility("hidden"))) CustomLibraryImpl
987985
return (Elf64_Addr)local__tls_get_addr;
988986
}
989987
if (strcmp(sym_name, "__cxa_thread_atexit") == 0) {
990-
return (Elf64_Addr)__cxa_thread_atexit_impl;
988+
return (Elf64_Addr)__cxxabiv1::__cxa_thread_atexit;
991989
}
992990
}
993991

@@ -1242,7 +1240,7 @@ struct __attribute__((visibility("hidden"))) CustomLibraryImpl
12421240
void* start = pthread_getspecific(tls_key_);
12431241
if (!start) {
12441242
start = malloc(tls_mem_size_);
1245-
__cxa_thread_atexit_impl(free, start, &__dso_handle);
1243+
__cxxabiv1::__cxa_thread_atexit(free, start, &__dso_handle);
12461244
memcpy(start, tls_initalization_image_, tls_file_size_);
12471245
memset(
12481246
(void*)((const char*)start + tls_file_size_),

0 commit comments

Comments
 (0)