diff options
| author | bellard <bellard> | 2005-06-15 22:32:10 +0000 |
|---|---|---|
| committer | bellard <bellard> | 2005-06-15 22:32:10 +0000 |
| commit | 0c7f0ed312d51afe2e1e2a736d41bcc257e15e38 (patch) | |
| tree | d863f1cc778d61163672b5952c2dc09c466d21af /tcccoff.c | |
| parent | fe9b1f60ce2ff21c248799ad0ea73fb7c70ef0d1 (diff) | |
| download | tinycc-0c7f0ed312d51afe2e1e2a736d41bcc257e15e38.tar.gz tinycc-0c7f0ed312d51afe2e1e2a736d41bcc257e15e38.tar.bz2 | |
added -f[no-]leading-underscore
Diffstat (limited to 'tcccoff.c')
| -rw-r--r-- | tcccoff.c | 26 |
1 files changed, 7 insertions, 19 deletions
@@ -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++; } |
