From d5c2e50e9a9d36523fbd70c86cb6551040539e51 Mon Sep 17 00:00:00 2001 From: Nikita Smith Date: Sat, 19 Oct 2024 14:52:38 -0700 Subject: [PATCH] rename import table regular -> static --- src/linker/lnk.c | 14 +++++++------- src/linker/lnk_import_table.c | 10 +++++----- src/linker/lnk_import_table.h | 6 +++--- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/linker/lnk.c b/src/linker/lnk.c index 756003c1..b101dd40 100644 --- a/src/linker/lnk.c +++ b/src/linker/lnk.c @@ -3257,7 +3257,7 @@ l.count += 1; \ // state LNK_SymbolTable *symtab = lnk_symbol_table_alloc_ex(config->symbol_table_cap_defined, config->symbol_table_cap_internal, config->symbol_table_cap_weak, config->symbol_table_cap_lib); LNK_SectionTable *st = lnk_init_section_table(symtab, config->section_virt_off, config->sect_align, config->file_align); - LNK_ImportTable *imptab_regular = 0; + LNK_ImportTable *imptab_static = 0; LNK_ImportTable *imptab_delayed = 0; LNK_ExportTable *exptab = lnk_export_table_alloc(); HashTable *disallow_lib_ht = hash_table_init(scratch.arena, 0x100); @@ -3560,17 +3560,17 @@ l.count += 1; \ func = lnk_import_table_push_func_delayed(imptab_delayed, symtab, dll, import_header); } } else { - if (!imptab_regular) { + if (!imptab_static) { Assert(config->machine != COFF_MachineType_UNKNOWN); - imptab_regular = lnk_import_table_alloc_regular(st, symtab, config->machine); + imptab_static = lnk_import_table_alloc_static(st, symtab, config->machine); } - LNK_ImportDLL *dll = lnk_import_table_search_dll(imptab_regular, import_header->dll_name); + LNK_ImportDLL *dll = lnk_import_table_search_dll(imptab_static, import_header->dll_name); if (!dll) { - dll = lnk_import_table_push_dll_regular(imptab_regular, symtab, import_header->dll_name, import_header->machine); + dll = lnk_import_table_push_dll_static(imptab_static, symtab, import_header->dll_name, import_header->machine); } LNK_ImportFunc *func = lnk_import_table_search_func(dll, import_header->func_name); if (!func) { - func = lnk_import_table_push_func_regular(imptab_regular, symtab, dll, import_header); + func = lnk_import_table_push_func_static(imptab_static, symtab, dll, import_header); } } } @@ -4394,7 +4394,7 @@ l.count += 1; \ //lnk_section_table_release(&st); //lnk_symbol_table_release(&symtab); //lnk_export_table_release(&export_table); - //lnk_import_table_release(&imptab_regular); + //lnk_import_table_release(&imptab_static); //lnk_import_table_release(&imptab_delayed); //tp_arena_release(&tp_arena); diff --git a/src/linker/lnk_import_table.c b/src/linker/lnk_import_table.c index 61535579..df6cc351 100644 --- a/src/linker/lnk_import_table.c +++ b/src/linker/lnk_import_table.c @@ -2,7 +2,7 @@ // Licensed under the MIT license (https://opensource.org/license/mit/) internal LNK_ImportTable * -lnk_import_table_alloc_regular(LNK_SectionTable *st, LNK_SymbolTable *symtab, COFF_MachineType machine) +lnk_import_table_alloc_static(LNK_SectionTable *st, LNK_SymbolTable *symtab, COFF_MachineType machine) { ProfBeginFunction(); @@ -178,7 +178,7 @@ lnk_import_table_search_func(LNK_ImportDLL *dll, String8 name) } internal LNK_ImportDLL * -lnk_import_table_push_dll_regular(LNK_ImportTable *imptab, LNK_SymbolTable *symtab, String8 dll_name, COFF_MachineType machine) +lnk_import_table_push_dll_static(LNK_ImportTable *imptab, LNK_SymbolTable *symtab, String8 dll_name, COFF_MachineType machine) { ProfBeginFunction(); @@ -401,7 +401,7 @@ lnk_import_table_push_dll_delayed(LNK_ImportTable *imptab, LNK_SymbolTable *symt } internal LNK_ImportFunc * -lnk_import_table_push_func_regular(LNK_ImportTable *imptab, LNK_SymbolTable *symtab, LNK_ImportDLL *dll, COFF_ImportHeader *header) +lnk_import_table_push_func_static(LNK_ImportTable *imptab, LNK_SymbolTable *symtab, LNK_ImportDLL *dll, COFF_ImportHeader *header) { ProfBeginFunction(); @@ -438,7 +438,7 @@ lnk_import_table_push_func_regular(LNK_ImportTable *imptab, LNK_SymbolTable *sym LNK_Chunk *int_chunk = lnk_section_push_chunk_data(data_sect, int_table_chunk, int_data, str8_zero()); // create symbol for lookup chunk - String8 int_symbol_name = push_str8f(symtab->arena, "regular.%S.%S.name", dll->name, header->func_name); + String8 int_symbol_name = push_str8f(symtab->arena, "static.%S.%S.name", dll->name, header->func_name); LNK_Symbol *int_symbol = lnk_make_defined_symbol_chunk(symtab->arena, int_symbol_name, LNK_DefinedSymbolVisibility_Internal, 0, int_chunk, 0, 0, 0); lnk_symbol_table_push(symtab, int_symbol); @@ -464,7 +464,7 @@ lnk_import_table_push_func_regular(LNK_ImportTable *imptab, LNK_SymbolTable *sym } break; } - String8 ilt_symbol_name = push_str8f(symtab->arena, "regular.%S.%S.ilt", dll->name, header->func_name); + String8 ilt_symbol_name = push_str8f(symtab->arena, "static.%S.%S.ilt", dll->name, header->func_name); String8 iat_symbol_name = push_str8f(symtab->arena, "__imp_%S", header->func_name); LNK_Symbol *ilt_symbol = lnk_make_defined_symbol_chunk(symtab->arena, ilt_symbol_name, LNK_DefinedSymbolVisibility_Internal, 0, ilt_chunk, 0, 0, 0); LNK_Symbol *iat_symbol = lnk_make_defined_symbol_chunk(symtab->arena, iat_symbol_name, LNK_DefinedSymbolVisibility_Extern, 0, iat_chunk, 0, 0, 0); diff --git a/src/linker/lnk_import_table.h b/src/linker/lnk_import_table.h index ea28a0ac..0299c911 100644 --- a/src/linker/lnk_import_table.h +++ b/src/linker/lnk_import_table.h @@ -59,12 +59,12 @@ typedef struct LNK_ImportTable HashTable *dll_ht; } LNK_ImportTable; -internal LNK_ImportTable * lnk_import_table_alloc_regular(LNK_SectionTable *st, LNK_SymbolTable *symtab, COFF_MachineType machine); +internal LNK_ImportTable * lnk_import_table_alloc_static(LNK_SectionTable *st, LNK_SymbolTable *symtab, COFF_MachineType machine); internal LNK_ImportTable * lnk_import_table_alloc_delayed(LNK_SectionTable *st, LNK_SymbolTable *symtab, COFF_MachineType machine, B32 is_unloadable, B32 is_bindable); internal void lnk_import_table_release(LNK_ImportTable **imptab); -internal LNK_ImportDLL * lnk_import_table_push_dll_regular(LNK_ImportTable *imptab, LNK_SymbolTable *symtab, String8 dll_name, COFF_MachineType machine); +internal LNK_ImportDLL * lnk_import_table_push_dll_static(LNK_ImportTable *imptab, LNK_SymbolTable *symtab, String8 dll_name, COFF_MachineType machine); internal LNK_ImportDLL * lnk_import_table_push_dll_delayed(LNK_ImportTable *imptab, LNK_SymbolTable *symtab, String8 dll_name, COFF_MachineType machine); -internal LNK_ImportFunc * lnk_import_table_push_func_regular(LNK_ImportTable *imptab, LNK_SymbolTable *symtab, LNK_ImportDLL *dll, COFF_ImportHeader *header); +internal LNK_ImportFunc * lnk_import_table_push_func_static(LNK_ImportTable *imptab, LNK_SymbolTable *symtab, LNK_ImportDLL *dll, COFF_ImportHeader *header); internal LNK_ImportFunc * lnk_import_table_push_func_delayed(LNK_ImportTable *imptab, LNK_SymbolTable *symtab, LNK_ImportDLL *dll, COFF_ImportHeader *header); internal LNK_ImportDLL * lnk_import_table_search_dll(LNK_ImportTable *imptab, String8 name); internal LNK_ImportFunc * lnk_import_table_search_func(LNK_ImportDLL *dll, String8 name);