Remove support for _init and _fini in statically linked executables

These are legacy predecessors of .init_array/.fini_array. They were
already not supported by the dynamic linker.
This commit is contained in:
bjorn3
2026-04-28 17:34:38 +02:00
parent e34b259822
commit 79b469f29d
7 changed files with 7 additions and 186 deletions
-7
View File
@@ -355,8 +355,6 @@ pub unsafe extern "C" fn exit(status: c_int) -> ! {
unsafe extern "C" {
static __fini_array_start: extern "C" fn();
static __fini_array_end: extern "C" fn();
fn _fini();
}
for i in (0..unsafe { ATEXIT_FUNCS.unsafe_ref().len() }).rev() {
@@ -373,11 +371,6 @@ pub unsafe extern "C" fn exit(status: c_int) -> ! {
(unsafe { *f })();
}
#[cfg(not(target_arch = "riscv64"))] // risc-v uses arrays exclusively
{
unsafe { _fini() };
}
unsafe { ld_so::fini() };
unsafe { crate::pthread::terminate_from_main_thread() };