But you need to use a home-built compiler - because debugging symbols are required (and by the way, I highly recommend that you figure this out because it makes it easier to understand the inner workings of the compiler and RTL in many places). You just need to stand the debugger on the function of module initialization and see the order.
Here, for example, is the order of module initialization for a simple GUI application created by default:
|
| INITPROC | FINALPROC |
pt^.TABLECOUNT = 87 |
|
|
|
pt^.PROCS[1] |
| SYSTEM__init | SYSTEM__finalize |
pt^.PROCS[2] |
| nil | OBJPAS__finalize |
pt^.PROCS[3] |
| LNFODWRF__init | LNFODWRF__finalize |
pt^.PROCS[4] |
| FPINTRES__init | nil |
pt^.PROCS[5] |
| nil | WINDIRS__finalize |
pt^.PROCS[6] |
| SYSUTILS__init | SYSUTILS__finalize |
pt^.PROCS[7] |
| TYPINFO__init_implicit | TYPINFO__finalize_implicit |
pt^.PROCS[8] |
| CLASSES__init | CLASSES__finalize |
pt^.PROCS[9] |
| FPCADDS__init | nil |
pt^.PROCS[10] |
| JSONSCANNER__init_implicit | JSONSCANNER__finalize_implicit |
pt^.PROCS[11] |
| VARIANTS__init | VARIANTS__finalize |
pt^.PROCS[12] |
| FPJSON__init | FPJSON__finalize_implicit |
pt^.PROCS[13] |
| JSONPARSER__init | JSONPARSER__finalize |
pt^.PROCS[14] |
| COMMCTRL__init | COMMCTRL__finalize |
pt^.PROCS[15] |
| LAZFILEUTILS__init | LAZFILEUTILS__finalize |
pt^.PROCS[16] |
| FILEUTIL__init_implicit | FILEUTIL__finalize_implicit |
pt^.PROCS[17] |
| DOS__init | nil |
pt^.PROCS[18] |
| LCONVENCODING__init_implicit | LCONVENCODING__finalize_implicit |
pt^.PROCS[19] |
| nil | LAZLOGGERBASE__finalize |
pt^.PROCS[20] |
| AVL_TREE__init | AVL_TREE__finalize |
pt^.PROCS[21] |
| STRINGHASHLIST__init | nil |
pt^.PROCS[22] |
| TRANSLATIONS__init_implicit | TRANSLATIONS__finalize_implicit |
pt^.PROCS[23] |
| LAZUTF8__init | LAZUTF8__finalize |
pt^.PROCS[24] |
| FPIMAGE__init | FPIMAGE__finalize |
pt^.PROCS[25] |
| nil | LAZTRACER__finalize |
pt^.PROCS[26] |
| SYSTEM.UITYPES__init | nil |
pt^.PROCS[27] |
| GRAPHTYPE__init | nil |
pt^.PROCS[28] |
| LCLTYPE__init_implicit | LCLTYPE__finalize_implicit |
pt^.PROCS[29] |
| LCLPROC__init | LCLPROC__finalize |
pt^.PROCS[30] |
| LCLPLATFORMDEF__init_implicit | LCLPLATFORMDEF__finalize_implicit |
pt^.PROCS[31] |
| FPIMGCMN__init | nil |
pt^.PROCS[32] |
| FPREADBMP__init | nil |
pt^.PROCS[33] |
| FPWRITEBMP__init | nil |
pt^.PROCS[34] |
| FPREADPNG__init | nil |
pt^.PROCS[35] |
| FPWRITEPNG__init | nil |
pt^.PROCS[36] |
| FPCOLORSPACE__init | FPCOLORSPACE__finalize_implicit |
pt^.PROCS[37] |
| FPREADTIFF__init | nil |
pt^.PROCS[38] |
| FPWRITETIFF__init | nil |
pt^.PROCS[39] |
| LCLVERSION__init | nil |
pt^.PROCS[40] |
| FPCANVAS__init_implicit | FPCANVAS__finalize_implicit |
pt^.PROCS[41] |
| FPREADPNM__init | nil |
pt^.PROCS[42] |
| FPWRITEPNM__init | nil |
pt^.PROCS[43] |
| FPREADJPEG__init | nil |
pt^.PROCS[44] |
| FPWRITEJPEG__init | nil |
pt^.PROCS[45] |
| FPREADGIF__init | nil |
pt^.PROCS[46] |
| LRESOURCES__init | LRESOURCES__finalize |
pt^.PROCS[47] |
| SYSTEM.TIMESPAN__init_implicit | SYSTEM.TIMESPAN__finalize_implicit |
pt^.PROCS[48] |
| LCLINTF__init | LCLINTF__finalize |
pt^.PROCS[49] |
| GRAPHICS__init | GRAPHICS__finalize |
pt^.PROCS[50] |
| INTFGRAPHICS__init | nil |
pt^.PROCS[51] |
| THEMES__init_implicit | THEMES__finalize_implicit |
pt^.PROCS[52] |
| INTERFACEBASE__init | nil |
pt^.PROCS[53] |
| MULTIMON__init | nil |
pt^.PROCS[54] |
| UXTHEME__init | UXTHEME__finalize |
pt^.PROCS[55] |
| DWMAPI__init | DWMAPI__finalize |
pt^.PROCS[56] |
| UNICODEDATA__init_implicit | UNICODEDATA__finalize_implicit |
pt^.PROCS[57] |
| FPPIXLCANV__init_implicit | FPPIXLCANV__finalize_implicit |
pt^.PROCS[58] |
| nil | WSLCLCLASSES__finalize |
pt^.PROCS[59] |
| ACTNLIST__init | nil |
pt^.PROCS[60] |
| nil | WSMENUS__finalize |
pt^.PROCS[61] |
| CLIPBRD__init | CLIPBRD__finalize |
pt^.PROCS[62] |
| FORMS__init | FORMS__finalize |
pt^.PROCS[63] |
| MENUS__init_implicit | MENUS__finalize_implicit |
pt^.PROCS[64] |
| IMGLIST__init | nil |
pt^.PROCS[65] |
| RTTIUTILS__init_implicit | RTTIUTILS__finalize_implicit |
pt^.PROCS[66] |
| CONTROLS__init | CONTROLS__finalize |
pt^.PROCS[67] |
| BUTTONS__init_implicit | BUTTONS__finalize_implicit |
pt^.PROCS[68] |
| EXTCTRLS__init | EXTCTRLS__finalize_implicit |
pt^.PROCS[69] |
| DIALOGRES__init | DIALOGRES__finalize_implicit |
pt^.PROCS[70] |
| COMCTRLS__init_implicit | COMCTRLS__finalize_implicit |
pt^.PROCS[71] |
| DATEUTILS__init_implicit | DATEUTILS__finalize_implicit |
pt^.PROCS[72] |
| nil | TASKDLGEMULATION__finalize |
pt^.PROCS[73] |
| DIALOGS__init | DIALOGS__finalize |
pt^.PROCS[74] |
| WIN32EXTRA__init | WIN32EXTRA__finalize |
pt^.PROCS[75] |
| WIN32PROC__init | WIN32PROC__finalize |
pt^.PROCS[76] |
| CALCFORM__init_implicit | CALCFORM__finalize_implicit |
pt^.PROCS[77] |
| HTMLDEFS__init_implicit | HTMLDEFS__finalize_implicit |
pt^.PROCS[78] |
| MASKEDIT__init | nil |
pt^.PROCS[79] |
| LAZFILECACHE__init | nil |
pt^.PROCS[80] |
| nil | LAZ2_XMLUTILS__finalize |
pt^.PROCS[81] |
| LAZ2_DOM__init_implicit | LAZ2_DOM__finalize_implicit |
pt^.PROCS[82] |
| URIPARSER__init_implicit | URIPARSER__finalize_implicit |
pt^.PROCS[83] |
| LAZ2_XMLREAD__init | LAZ2_XMLREAD__finalize_implicit |
pt^.PROCS[84] |
| SHELLCTRLS__init_implicit | SHELLCTRLS__finalize_implicit |
pt^.PROCS[85] |
| WIN32WSDIALOGS__init | WIN32WSDIALOGS__finalize_implicit |
pt^.PROCS[86] |
| WIN32INT__init | WIN32INT__finalize |
pt^.PROCS[87] |
| INTERFACES__init | INTERFACES__finalize |