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:
@@ -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() };
|
||||
|
||||
Reference in New Issue
Block a user