LibELF: Call DT_INIT method now that startfiles are correct for DSOs

We weren't calling the method here before because it was ill-formed.
No start files meant that we got the front half of the init section but
not the back half (no 'ret' in _init!). Now that we have the proper
crtbeginS and crtendS files from libgcc to help us out, we can assume
that DSOs will have the proper _init method defined.
This commit is contained in:
Andrew Kaster 2020-01-01 14:26:39 -05:00 committed by Andreas Kling
parent a755b80057
commit f23dc4ea69
Notes: sideshowbarker 2024-07-19 10:27:34 +09:00

View File

@ -290,14 +290,8 @@ bool ELFDynamicObject::load(unsigned flags)
#ifdef DYNAMIC_LOAD_DEBUG
dbgprintf("Calling DT_INIT at %p\n", init_function);
#endif
// FIXME:
// Disassembly of section .init:
//
// 00007e98 <_init>:
// 7e98: 55 push ebp
//
// Where da ret at? related to -nostartfiles for sure...
//(init_function)();
(init_function)();
InitFunc* init_begin = (InitFunc*)(load_addr + m_init_array_offset);
u32 init_end = (u32)((u8*)init_begin + m_init_array_size);