X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=symbol.c;fp=symbol.c;h=be9282634f6cace0f44082555dbee8ce142168b3;hp=50d8379a0963ddae5dde642b68e360edfa63a13e;hb=7c93fb2f08a84ed7b85a63531e62d97cc709ee7c;hpb=c0ef609f7380636c088226f0586b769d28294262 diff --git a/symbol.c b/symbol.c index 50d8379..be92826 100644 --- a/symbol.c +++ b/symbol.c @@ -282,14 +282,10 @@ uint32_t sy_assign_ELF(uint8_t * buf, uint8_t *(* construct)()) { uint16_t scount = 0; -// if (construct == (uint8_t *(*)())constr_elfsymtab) -// if (buf == NULL) - { - // Append all symbols not appearing on the .sdecl list to the end of - // the .sdecl list - for(SYM * sy=sorder; sy!=NULL; sy=sy->sorder) - AddToSymbolDeclarationList(sy); - } + // Append all symbols not appearing on the .sdecl list to the end of + // the .sdecl list + for(SYM * sy=sorder; sy!=NULL; sy=sy->sorder) + AddToSymbolDeclarationList(sy); // Run through all symbols (now on the .sdecl list) and assign numbers to // them. We also pick which symbols should be global or not here. @@ -300,7 +296,8 @@ uint32_t sy_assign_ELF(uint8_t * buf, uint8_t *(* construct)()) if (sy->stype == LABEL && lsym_flag && (sy->sattr & (DEFINED | REFERENCED)) != 0 && (*sy->sname != '.') - && (sy->sattr & GLOBAL) == 0) + && (sy->sattr & GLOBAL) == 0 + && (sy->sattre & (EQUATEDREG | UNDEF_EQUR | EQUATEDCC | UNDEF_CC)) == 0) { sy->senv = scount++; @@ -318,6 +315,7 @@ uint32_t sy_assign_ELF(uint8_t * buf, uint8_t *(* construct)()) for(SYM * sy=sdecl; sy!=NULL; sy=sy->sdecl) { if ((sy->stype == LABEL) + && (sy->sattre & (EQUATEDREG | UNDEF_EQUR | EQUATEDCC | UNDEF_CC)) == 0 && ((sy->sattr & (GLOBAL | DEFINED)) == (GLOBAL | DEFINED) || (sy->sattr & (GLOBAL | REFERENCED)) == (GLOBAL | REFERENCED)) || (sy->sattr & COMMON)) @@ -327,7 +325,7 @@ uint32_t sy_assign_ELF(uint8_t * buf, uint8_t *(* construct)()) if (buf != NULL) buf = construct(buf, sy, 1); } - else if ((sy->sattr == (GLOBAL | REFERENCED)) && (buf != NULL)) + else if ((sy->sattr == (GLOBAL | REFERENCED)) && (buf != NULL) && (sy->sattre & (EQUATEDREG | UNDEF_EQUR | EQUATEDCC | UNDEF_CC)) == 0) { buf = construct(buf, sy, 0); scount++;