mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:47:44 +00:00
LibC+LibELF: Correctly call destructors on exit()
We currently don't call any DT_FINI_ARRAY functions, so change that. The call to `_fini` in `exit` is unnecessary, as we now call the function referenced by DT_FINI in `__call_fini_functions`.
This commit is contained in:
parent
dcff48356f
commit
0bff1f61b6
5 changed files with 58 additions and 9 deletions
|
@ -803,7 +803,7 @@ void DynamicLoader::call_object_init_functions()
|
|||
typedef void (*InitFunc)();
|
||||
|
||||
if (m_dynamic_object->has_init_section()) {
|
||||
auto init_function = (InitFunc)(m_dynamic_object->init_section().address().as_ptr());
|
||||
auto init_function = m_dynamic_object->init_section_function();
|
||||
(init_function)();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue