as: Set type of symbols associated to sections - scc - simple c99 compiler
 (HTM) git clone git://git.simple-cc.org/scc
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) Submodules
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 1d8b58777ed0e762dd3e79218ed951e05c5e2dff
 (DIR) parent fb3572d08e0fdc42b6432203085d3c84889159e2
 (HTM) Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
       Date:   Fri, 22 Mar 2024 05:09:37 +0100
       
       as: Set type of symbols associated to sections
       
       The type associated to a symbol related to a section is the same than
       the type of the section itself, we only have to care about making the
       symbol local to avoid collision with symbols from other objects.
       
       Diffstat:
         M src/cmd/as/symbol.c                 |       4 +++-
         M src/libmach/coff32/coff32setsym.c   |       3 ---
       
       2 files changed, 3 insertions(+), 4 deletions(-)
       ---
 (DIR) diff --git a/src/cmd/as/symbol.c b/src/cmd/as/symbol.c
       @@ -303,7 +303,9 @@ newsec(Symbol *sym, char *attr)
                sec->flags |= secflags(attr);
                sec->type = sectype(sec->flags);
        
       -        sym->type = sec->type;
       +        /* sym->flags = ? */
       +        sym->section = sec->index;
       +        sym->type = tolower(sec->type);
                sym->index = symindex;
                lsym = (struct lsymbol *) sym;
                lsym->sec = sec;
 (DIR) diff --git a/src/libmach/coff32/coff32setsym.c b/src/libmach/coff32/coff32setsym.c
       @@ -101,11 +101,8 @@ coff32setsym(Obj *obj, int *idx, Symbol *sym)
        
                /*
                 * TODO: 
       -         *         sym->type
                 *      sym->stype
                 */
       -        ent->n_type = 0;  /* TODO: debug information */
       -        ent->n_sclass = 0; /* TODO: debug information */
                ent->n_numaux = 0; /* TODO: debug information */
        
                *idx += ent->n_numaux;