strip postfix when searching for section

This commit is contained in:
Nikita Smith
2025-06-25 10:53:22 -07:00
committed by Ryan Fleury
parent a2bef106a1
commit 6fd9ab7388
2 changed files with 7 additions and 8 deletions
+6 -6
View File
@@ -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(); ProfEnd();
} }
internal LNK_Section * 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); Temp scratch = scratch_begin(0,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); String8 name_with_flags = lnk_make_name_with_flags(scratch.arena, name, flags);
LNK_Section *section = 0; LNK_Section *section= 0;
hash_table_search_string_raw(sectab->sect_ht, name_with_flags, &section); hash_table_search_string_raw(sectab->sect_ht, name_with_flags, &section);
scratch_end(scratch); scratch_end(scratch);
-1
View File
@@ -67,7 +67,6 @@ typedef struct LNK_Section
B32 is_merged; B32 is_merged;
LNK_SectionContribChunkList contribs; LNK_SectionContribChunkList contribs;
LNK_SectionContrib *first_contrib_chunk;
U64 voff; U64 voff;
U64 vsize; U64 vsize;