From 0c7f0ed312d51afe2e1e2a736d41bcc257e15e38 Mon Sep 17 00:00:00 2001 From: bellard Date: Wed, 15 Jun 2005 22:32:10 +0000 Subject: added -f[no-]leading-underscore --- tcccoff.c | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'tcccoff.c') diff --git a/tcccoff.c b/tcccoff.c index 6739797..de7d87c 100644 --- a/tcccoff.c +++ b/tcccoff.c @@ -507,8 +507,7 @@ int tcc_output_coff(TCCState *s1, FILE *f) AUXEF auxef; int i; Elf32_Sym *p; - char *name; - char _name[MAX_FUNCS]; + const char *name; int nstr; int n = 0; @@ -521,26 +520,15 @@ int tcc_output_coff(TCCState *s1, FILE *f) for (i = 0; i < nb_syms; i++) { - /* don't add underscores for Code Composer Version 2.xx */ - -#define ADD_UNDERSCORE 0 - - name = (char *) symtab_section->link->data + p->st_name; - -#if ADD_UNDERSCORE - _name[0] = '_'; - strcpy(_name + 1, name); -#else - strcpy(_name, name); -#endif + name = symtab_section->link->data + p->st_name; for (k = 0; k < 8; k++) csym._n._n_name[k] = 0; - if (strlen(_name) <= 8) { - strcpy(csym._n._n_name, _name); + if (strlen(name) <= 8) { + strcpy(csym._n._n_name, name); } else { - if (pCoff_str_table - Coff_str_table + strlen(_name) > + if (pCoff_str_table - Coff_str_table + strlen(name) > MAX_STR_TABLE - 1) error("String table too large"); @@ -548,8 +536,8 @@ int tcc_output_coff(TCCState *s1, FILE *f) csym._n._n_n._n_offset = pCoff_str_table - Coff_str_table + 4; - strcpy(pCoff_str_table, _name); - pCoff_str_table += strlen(_name) + 1; // skip over null + strcpy(pCoff_str_table, name); + pCoff_str_table += strlen(name) + 1; // skip over null nstr++; } -- cgit v1.3.1