Kernel: Remove __dso_handle and __cxa_atexit()

Defining __cxa_atexit() and declaring __dso_handle doesn't seem to be
necessary anymore. Nothing in the kernel should use static destructors.

Previously, causing a static destructor to be called failed to link with
"hidden symbol `__dso_handle' isn't defined".
Now you additionally get this error:
"undefined reference to `__cxa_atexit".
This commit is contained in:
Sönke Holz
2026-02-04 02:20:31 +01:00
committed by Sönke Holz
parent 249159bbdc
commit ac8d2c2af8
3 changed files with 0 additions and 15 deletions

View File

@@ -452,8 +452,4 @@ UNMAP_AFTER_INIT void setup_serial_debug()
}
}
// Define some Itanium C++ ABI methods to stop the linker from complaining.
// If we actually call these something has gone horribly wrong
void* __dso_handle __attribute__((visibility("hidden")));
}

View File

@@ -229,7 +229,6 @@ void const* memmem(void const* haystack, size_t haystack_length, void const* nee
// Declare them first, to tell the silly compiler that they are indeed being used.
[[noreturn]] void __stack_chk_fail() __attribute__((used));
[[noreturn]] void __stack_chk_fail_local() __attribute__((used));
extern "C" int __cxa_atexit(void (*)(void*), void*, void*);
[[noreturn]] void __cxa_pure_virtual();
[[noreturn]] void __stack_chk_fail()
@@ -242,12 +241,6 @@ extern "C" int __cxa_atexit(void (*)(void*), void*, void*);
VERIFY_NOT_REACHED();
}
extern "C" int __cxa_atexit(void (*)(void*), void*, void*)
{
VERIFY_NOT_REACHED();
return 0;
}
[[noreturn]] void __cxa_pure_virtual()
{
VERIFY_NOT_REACHED();

View File

@@ -256,8 +256,4 @@ extern "C" [[noreturn]] void init()
__builtin_unreachable();
}
// Define some Itanium C++ ABI methods to stop the linker from complaining.
// If we actually call these something has gone horribly wrong
void* __dso_handle __attribute__((visibility("hidden")));
}