@@ -86,19 +86,24 @@ struct Dee_dex_symbol {
8686 __UINTPTR_HALF_TYPE__ _ds_index ; /* Used internally during initialization */
8787};
8888
89+ union Dee_module_buildid ;
8990struct Dee_module_dexinfo ;
9091struct Dee_module_dexdata {
91- struct Dee_module_object * mdx_module ; /* [1..1][const] Associated dex module descriptor */
92- struct Dee_dex_symbol const * mdx_export ; /* [1..mdx_module->mo_globalc][const] Raw export table of this dex module */
93- void * mdx_handle ; /* [?..?][const][owned] System-specific library handle (filled in during loading) */
94- struct Dee_module_dexinfo * mdx_info ; /* [0..1][const] Used internally. Initialize to "NULL" in dex modules */
92+ struct Dee_module_object * mdx_module ; /* [1..1][const] Associated DEX module descriptor */
93+ struct Dee_dex_symbol const * mdx_export ; /* [1..mdx_module->mo_globalc][const] Raw export table of this DEX module */
94+ union Dee_module_buildid const * mdx_buildid ; /* [0..1][const] 16-byte Build ID of the DEX module (if available) -- set to
95+ * "ADDR(.note.gnu.build-id) + 16" if available, or to 16 random bytes if
96+ * that is possible */
9597
9698 /* [0..1][const] Optional initializer/finalizer/clear callbacks. */
9799 WUNUSED_T int (DCALL * mdx_init )(void );
98100 void (DCALL * mdx_fini )(void );
99101 bool (DCALL * mdx_clear )(void );
100102
101- void * _mdx_pad [9 ]; /* For future expansion (must be 0-initialized by dex modules) */
103+ /* Internal fields... */
104+ void * mdx_handle ; /* [?..?][const][owned] System-specific library handle (filled in during loading) */
105+ struct Dee_module_dexinfo * mdx_info ; /* [0..1][const] Used internally. Initialize to "NULL" in DEX modules */
106+ void * _mdx_pad [8 ]; /* For future expansion (must be 0-initialized by DEX modules) */
102107};
103108
104109#if defined(CONFIG_BUILDING_DEEMON ) || defined(CONFIG_BUILDING_DEX )
@@ -146,7 +151,7 @@ INTDEF __BYTE_TYPE__ _end[];
146151#define Dee_DEX_END (init , fini , clear ) \
147152 }; \
148153 STATIC_ASSERT_MSG(COMPILER_LENOF(_dex_symbols) > 0, \
149- "A dex module must have at least 1 export"); \
154+ "A DEX module must have at least 1 export"); \
150155 enum { _DEX_BUCKETM = __Dee_NEXT_POWER_OF_2_16(COMPILER_LENOF(_dex_symbols) + 1) - 1 }; \
151156 PRIVATE struct Dee_module_symbol _dex_bucketv[_DEX_BUCKETM + 1] = {}; \
152157 Dee_MODULE_STRUCT(_dex_object_raw, COMPILER_LENOF(_dex_symbols)); \
@@ -156,15 +161,15 @@ INTDEF __BYTE_TYPE__ _end[];
156161 }; \
157162 EXPDEF struct _dex_object DEX; \
158163 PRIVATE struct Dee_module_dexdata _dex_data = { \
159- /* .mdx_module = */ (struct Dee_module_object * )& DEX .m_dex , \
160- /* .mdx_export = */ _dex_symbols , \
161- /* .mdx_handle = */ NULL , /* Init doesn't matter */ \
162- /* .mdx_info = */ NULL , \
163- /* .mdx_init = */ init , \
164- /* .mdx_fini = */ fini , \
165- /* .mdx_clear = */ clear , \
166- /* ._mdx_pad = */ { NULL , NULL , NULL , NULL , NULL , \
167- NULL , NULL , NULL , NULL } \
164+ /* .mdx_module = */ (struct Dee_module_object * )& DEX .m_dex , \
165+ /* .mdx_export = */ _dex_symbols , \
166+ /* .mdx_buildid = */ NULL , \
167+ /* .mdx_init = */ init , \
168+ /* .mdx_fini = */ fini , \
169+ /* .mdx_clear = */ clear , \
170+ /* .mdx_handle = */ NULL , /* Init doesn't matter */ \
171+ /* .mdx_info = */ NULL , \
172+ /* ._mdx_pad = */ { NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL } \
168173 }; \
169174 PUBLIC struct _dex_object DEX = {{ _Dee_GC_HEAD_UNTRACKED_INIT }, { \
170175 __Dee_DEX_OBJECT_HEAD_INIT , \
@@ -190,7 +195,7 @@ INTDEF __BYTE_TYPE__ _end[];
190195
191196
192197#ifdef CONFIG_BUILDING_DEEMON
193- /* Open loaded system "dex_handle" as a module object. The dex module will have
198+ /* Open loaded system "dex_handle" as a module object. The DEX module will have
194199 * already been hooked into "module_abstree_root", as well as having had its
195200 * "mo_dexdata" fully initialized.
196201 * If the system indicates that "dex_handle" had already been loaded under some
@@ -200,19 +205,19 @@ INTDEF __BYTE_TYPE__ _end[];
200205 *
201206 * @param: absname: The absolute, normalized filesystem name where "dex_handle"
202207 * was loaded from, with its trailing .dll/.so removed (as such,
203- * this is the name under which a new dex module should appear
208+ * this is the name under which a new DEX module should appear
204209 * within `module_abstree_root')
205210 * @param: dex_handle: The system library handle, as returned by `DeeSystem_DlOpenString()'
206- * @return: * : The newly loaded dex module.
207- * @return: NULL: An error was thrown (e.g. "dex_handle" does not refer to a dex module) */
211+ * @return: * : The newly loaded DEX module.
212+ * @return: NULL: An error was thrown (e.g. "dex_handle" does not refer to a DEX module) */
208213INTDEF WUNUSED NONNULL ((1 )) DREF DeeModuleObject * DCALL
209214DeeModule_OpenDex (/*inherit(always)*/ /*utf-8*/ char * __restrict absname ,
210215 /*inherit(always)*/ void * dex_handle );
211216
212- /* Invoke the "mdx_clear" operator on every loaded dex module. */
217+ /* Invoke the "mdx_clear" operator on every loaded DEX module. */
213218INTDEF bool DCALL DeeModule_ClearDexModuleCaches (void );
214219
215- /* Unload all loaded dex modules. */
220+ /* Unload all loaded DEX modules. */
216221INTDEF void DCALL DeeModule_UnloadAllDexModules (void );
217222#endif /* CONFIG_BUILDING_DEEMON */
218223
0 commit comments