@@ -3826,6 +3826,12 @@ static int cus__process_dwflmod(Dwfl_Module *dwflmod,
Dwarf *dw = dwfl_module_getdwarf(dwflmod, &dwbias);
int err = DWARF_CB_OK;
+ if (parms->conf->pre_load_module) {
+ err = parms->conf->pre_load_module(dwflmod, elf);
+ if (err)
+ return DWARF_CB_ABORT;
+ }
+
if (dw != NULL) {
++parms->nr_dwarf_sections_found;
err = cus__load_module(cus, parms->conf, dwflmod, dw, elf,
@@ -107,6 +107,7 @@ struct conf_load {
struct conf_fprintf *conf_fprintf;
int (*threads_prepare)(struct conf_load *conf, int nr_threads, void **thr_data);
int (*threads_collect)(struct conf_load *conf, int nr_threads, void **thr_data, int error);
+ int (*pre_load_module)(Dwfl_Module *mod, Elf *elf);
};
/** struct conf_fprintf - hints to the __fprintf routines
Add a function pointer to conf_load, which is called immediately after Elf is extracted from Dwfl_Module in cus__proces_dwflmod. This is a preparation for making elf_functions table shared between encoders. Shared table can be built as soon as the relevant Elf is available. Signed-off-by: Ihor Solodrai <ihor.solodrai@pm.me> Link: https://lore.kernel.org/dwarves/20241128012341.4081072-5-ihor.solodrai@pm.me/ --- dwarf_loader.c | 6 ++++++ dwarves.h | 1 + 2 files changed, 7 insertions(+)