From: Robert Pengelly Date: Thu, 5 Sep 2024 12:52:29 +0000 (+0100) Subject: Add a character or characters to the start of a symbol name when .model has a languag... X-Git-Url: https://git.candlhat.org/?a=commitdiff_plain;h=81420e85265843a1958e5fea97636413307ae307;p=sasm.git Add a character or characters to the start of a symbol name when .model has a language argument --- diff --git a/obj.c b/obj.c index 9eda912..e9eae02 100644 --- a/obj.c +++ b/obj.c @@ -233,6 +233,10 @@ void output_obj (FILE *fp) { write_to_byte_array (symbol_entry.n_strx, string_table_pos, 4); string_table_pos += strlen (symbol->name) + 1; + if (state->ext) { + string_table_pos += strlen (state->ext); + } + if (symbol->section == undefined_section) { symbol_entry.n_type = N_UNDF; } else if (symbol->section == text_section) { @@ -279,6 +283,17 @@ void output_obj (FILE *fp) { if (symbol_is_external (symbol) || symbol_is_undefined (symbol)) { + if (state->ext) { + + if (fwrite (state->ext, strlen (state->ext), 1, fp) != 1) { + + report_at (program_name, 0, REPORT_ERROR, "failed to write string table"); + return; + + } + + } + if (fwrite (symbol->name, strlen (symbol->name) + 1, 1, fp) != 1) { report_at (program_name, 0, REPORT_ERROR, "failed to write string table");