From f23dc4ea6987240ebb0d91acba58a4d8d1327b4b Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Wed, 1 Jan 2020 14:26:39 -0500 Subject: [PATCH] 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. --- Libraries/LibELF/ELFDynamicObject.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Libraries/LibELF/ELFDynamicObject.cpp b/Libraries/LibELF/ELFDynamicObject.cpp index 1cf238ac88..833ef54979 100644 --- a/Libraries/LibELF/ELFDynamicObject.cpp +++ b/Libraries/LibELF/ELFDynamicObject.cpp @@ -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);