![iunit arrey elements modflow iunit arrey elements modflow](https://images.ctfassets.net/i12m233ixdxi/5QPIOf9TCowIEU46e2Eekq/da4f6c60f1bf1b9d4f8e87e0f09b3a1d/KK52_4.jpg)
Note that there seems to be a cut-and-paste bug in this code when it calculates the count of functions to call at teardown. fini_array to be called, before finally calling _fini(). After main() is complete the teardown call to _libc_fini_array() causes all the functions in. Lastly it calls all the function pointers in section. Then it calls the _init() function in the. preinit_array by referring to the start and end labels. You can see that on startup, _libc_init_array() is called and this first calls all the function pointers in section. Presumably the start and end labels are used to walk these lists.Ī good example of code that uses these symbols is to be found here libc source for initfini.c. fini_array is an array of functions that will be called on destruction. init_array sections contain arrays of pointers to functions that will be called on initialization. The start and end symbols define the beginning and end of code sections related to such operations and might be referenced from other parts of the runtime support code. init_array are to do with initialization of C/C++ objects, and sections. These symbols are related to the C / C++ constructor and destructor startup and tear down code that is called before / after main(). Where can I find the specification of these symbols? ) Īnd then I searched with the key "init_array" in the docs of ELF-v1.1, gcc 4.7.2, ld, and codesourcery(I'm using codesourcery g++ lite) only to get nothing. */Įxtern void (*_preinit_array_start ) (void) _attribute_((weak)) Įxtern void (*_preinit_array_end ) (void) _attribute_((weak)) Įxtern void (*_init_array_start ) (void) _attribute_((weak)) Įxtern void (*_init_array_end ) (void) _attribute_((weak)) Įxtern void (*_fini_array_start ) (void) _attribute_((weak)) Įxtern void (*_fini_array_end ) (void) _attribute_((weak)) I know that these symbols /* These magic symbols are provided by the linker. īut I don't quite understand what this function does. I viewed the source code of _libc_init_array from.