Parcourir la source

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.
Andrew Kaster il y a 5 ans
Parent
commit
f23dc4ea69
1 fichiers modifiés avec 2 ajouts et 8 suppressions
  1. 2 8
      Libraries/LibELF/ELFDynamicObject.cpp

+ 2 - 8
Libraries/LibELF/ELFDynamicObject.cpp

@@ -290,14 +290,8 @@ bool ELFDynamicObject::load(unsigned flags)
 #ifdef DYNAMIC_LOAD_DEBUG
 #ifdef DYNAMIC_LOAD_DEBUG
     dbgprintf("Calling DT_INIT at %p\n", init_function);
     dbgprintf("Calling DT_INIT at %p\n", init_function);
 #endif
 #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);
     InitFunc* init_begin = (InitFunc*)(load_addr + m_init_array_offset);
     u32 init_end = (u32)((u8*)init_begin + m_init_array_size);
     u32 init_end = (u32)((u8*)init_begin + m_init_array_size);