From 6fd9ab73889e6a5a6a8306d9c52567117a8bfb30 Mon Sep 17 00:00:00 2001 From: Nikita Smith Date: Thu, 15 May 2025 17:21:33 -0700 Subject: [PATCH] strip postfix when searching for section --- src/linker/lnk_section_table.c | 14 +++++++------- src/linker/lnk_section_table.h | 1 - 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/linker/lnk_section_table.c b/src/linker/lnk_section_table.c index 6cce1613..de6ed91b 100644 --- a/src/linker/lnk_section_table.c +++ b/src/linker/lnk_section_table.c @@ -189,20 +189,20 @@ lnk_section_table_remove(LNK_SectionTable *sectab, String8 name) } } - // push to free list - SLLQueuePush(sectab->free_list.first, sectab->free_list.last, node); - sectab->free_list.count += 1; - ProfEnd(); } internal LNK_Section * -lnk_section_table_search(LNK_SectionTable *sectab, String8 name, COFF_SectionFlags flags) +lnk_section_table_search(LNK_SectionTable *sectab, String8 full_or_partial_name, COFF_SectionFlags flags) { Temp scratch = scratch_begin(0,0); - String8 name_with_flags = lnk_make_name_with_flags(scratch.arena, name, flags); - LNK_Section *section = 0; + String8 name = {0}; + String8 postfix = {0}; + coff_parse_section_name(full_or_partial_name, &name, &postfix); + + String8 name_with_flags = lnk_make_name_with_flags(scratch.arena, name, flags); + LNK_Section *section= 0; hash_table_search_string_raw(sectab->sect_ht, name_with_flags, §ion); scratch_end(scratch); diff --git a/src/linker/lnk_section_table.h b/src/linker/lnk_section_table.h index 3d0c2f8f..d44bcb81 100644 --- a/src/linker/lnk_section_table.h +++ b/src/linker/lnk_section_table.h @@ -67,7 +67,6 @@ typedef struct LNK_Section B32 is_merged; LNK_SectionContribChunkList contribs; - LNK_SectionContrib *first_contrib_chunk; U64 voff; U64 vsize;