diff options
Diffstat (limited to 'tcccoff.c')
| -rw-r--r-- | tcccoff.c | 38 |
1 files changed, 14 insertions, 24 deletions
@@ -533,7 +533,7 @@ ST_FUNC int tcc_output_coff(TCCState *s1, FILE *f) } else { if (pCoff_str_table - Coff_str_table + strlen(name) > MAX_STR_TABLE - 1) - error("String table too large"); + tcc_error("String table too large"); csym._n._n_n._n_zeroes = 0; csym._n._n_n._n_offset = @@ -563,11 +563,7 @@ ST_FUNC int tcc_output_coff(TCCState *s1, FILE *f) } if (k >= nFuncs) { - char s[256]; - - sprintf(s, "debug info can't find function: %s", name); - - error(s); + tcc_error("debug info can't find function: %s", name); } // put a Function Name @@ -734,13 +730,7 @@ void SortSymbolTable(void) } if (k >= nFuncs) { - char s[256]; - - sprintf(s, - "debug (sort) info can't find function: %s", - name2); - - error(s); + tcc_error("debug (sort) info can't find function: %s", name2); } if (strcmp(AssociatedFile[k], name) == 0) { @@ -767,7 +757,7 @@ void SortSymbolTable(void) } if (n != nb_syms) - error("Internal Compiler error, debug info"); + tcc_error("Internal Compiler error, debug info"); // copy it all back @@ -864,7 +854,7 @@ Section *FindSection(TCCState * s1, const char *sname) return s; } - error("could not find section %s", sname); + tcc_error("could not find section %s", sname); return 0; } @@ -882,39 +872,39 @@ ST_FUNC int tcc_load_coff(TCCState * s1, int fd) f = fdopen(fd, "rb"); if (!f) { - error("Unable to open .out file for input"); + tcc_error("Unable to open .out file for input"); } if (fread(&file_hdr, FILHSZ, 1, f) != 1) - error("error reading .out file for input"); + tcc_error("error reading .out file for input"); if (fread(&o_filehdr, sizeof(o_filehdr), 1, f) != 1) - error("error reading .out file for input"); + tcc_error("error reading .out file for input"); // first read the string table if (fseek(f, file_hdr.f_symptr + file_hdr.f_nsyms * SYMESZ, SEEK_SET)) - error("error reading .out file for input"); + tcc_error("error reading .out file for input"); if (fread(&str_size, sizeof(int), 1, f) != 1) - error("error reading .out file for input"); + tcc_error("error reading .out file for input"); Coff_str_table = (char *) tcc_malloc(str_size); if (fread(Coff_str_table, str_size - 4, 1, f) != 1) - error("error reading .out file for input"); + tcc_error("error reading .out file for input"); // read/process all the symbols // seek back to symbols if (fseek(f, file_hdr.f_symptr, SEEK_SET)) - error("error reading .out file for input"); + tcc_error("error reading .out file for input"); for (i = 0; i < file_hdr.f_nsyms; i++) { if (fread(&csym, SYMESZ, 1, f) != 1) - error("error reading .out file for input"); + tcc_error("error reading .out file for input"); if (csym._n._n_n._n_zeroes == 0) { name = Coff_str_table + csym._n._n_n._n_offset - 4; @@ -949,7 +939,7 @@ ST_FUNC int tcc_load_coff(TCCState * s1, int fd) if (csym.n_numaux == 1) { if (fread(&csym, SYMESZ, 1, f) != 1) - error("error reading .out file for input"); + tcc_error("error reading .out file for input"); i++; } } |
