remove the symbol-table walking

it wasn't feasible without knowledge of the size which I couldn't find without reading the elf file. Moreover, it wasn't really required and was halting progress
This commit is contained in:
2025-03-23 01:39:34 +02:00
parent 36ca3a2155
commit 564d2490e5
4 changed files with 13 additions and 121 deletions

View File

@@ -43,7 +43,8 @@ static inline int if_load_symbols_for_module(struct dl_phdr_info *info) {
}
// Callback function for dl_iterate_phdr
static int gather_module_infos_callback(struct dl_phdr_info *info, size_t size,
static
int gather_module_infos_callback(struct dl_phdr_info *info, size_t size,
void *data) {
ModuleInfos *infos = (ModuleInfos *)data;
@@ -68,20 +69,11 @@ static int gather_module_infos_callback(struct dl_phdr_info *info, size_t size,
SymbolInfos symbol_info = {0};
sc_array_add(&infos->symbols, symbol_info);
if (!if_load_symbols_for_module(info)) {
sc_log_info("Skipping symbol preload for: %s\n", info->dlpi_name);
return 0;
}
if (hi_create_symbol_info(&(sc_array_last(&infos->symbols)),
&context.memory_regions, info) != HILOAD_OK) {
sc_log_error("Failed to create symbol info for %s\n", info->dlpi_name);
}
return 0; // Continue iteration
}
static void free_module_infos(ModuleInfos *modules) {
static
void free_module_infos(ModuleInfos *modules) {
if (!modules)
return;
@@ -101,7 +93,8 @@ static void free_module_infos(ModuleInfos *modules) {
free(modules);
}
static ModuleInfos *gather_module_infos(void) {
static
ModuleInfos *gather_module_infos(void) {
ModuleInfos *result = NULL;
// Allocate the result structure
@@ -120,7 +113,8 @@ static ModuleInfos *gather_module_infos(void) {
return result;
}
static ReloadResult reload_module(ModuleInfos *modules, const char *filename,
static
ReloadResult reload_module(ModuleInfos *modules, const char *filename,
void **updated_handle) {
if (!modules || !filename) {
return HI_RELOAD_NOT_FOUND;