Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.63
 
1.64
 
MAIN:ragge:20071129160211
 
local.c
_>7272         strlcpy(sp->sname, s, len);
 7373         strlcat(sp->sname, s2, len);
 7474         sp->sclass = EXTERN;
<>75 -        sp->slevel = 0;
  75+        sp->sflags = sp->slevel = 0;
7676         return sp;
 7777 }
 7878 
     
 !
8787 
 8888         q = tempnode(gotnr, PTR|VOID, 0, MKSUE(VOID));
 8989         r = bcon(0);
<>90 -        r->n_sp = picsymtab(p->n_sp->sname, "@GOT");
  90+        r->n_sp = picsymtab(gcc_findname(p->n_sp), "@GOT");
9191         q = buildtree(PLUS, q, r);
 9292         q = block(UMUL, q, 0, PTR|VOID, 0, MKSUE(VOID));
 9393         q = block(UMUL, q, 0, p->n_type, p->n_df, p->n_sue);
     
 !
110110                 snprintf(buf, 32, LABFMT, (int)p->n_sp->soffset);
 111111                 r->n_sp = picsymtab(buf, "@GOTOFF");
 112112         } else
<>113 -                r->n_sp = picsymtab(p->n_sp->sname, "@GOTOFF");
  113+                r->n_sp = picsymtab(gcc_findname(p->n_sp), "@GOTOFF");
  114+        r->n_sp->sclass = STATIC;
  115+        r->n_sp->stype = p->n_sp->stype;
114116         q = buildtree(PLUS, q, r);
 115117         q = block(UMUL, q, 0, p->n_type, p->n_df, p->n_sue);
 116118         nfree(p);
     
 !
166168                                 if (q->slevel == 0)
 167169                                         break;
 168170                                 p->n_lval = 0;
<>169 -                        } else
  171+                        } else if (blevel > 0)
170172                                 p = picstatic(p);
 171173                         break;
 172174 
     
 !
180182                 case EXTDEF:
 181183                         if (kflag == 0)
 182184                                 break;
<>183 -                        if ((p->n_type & TMASK2) == FTN) {
 184 -                                p->n_sp = picsymtab(q->sname, "@PLT");
 185 -                        } else
  185+                        if (blevel > 0)
186186                                 p = picext(p);
 187187                         break;
 188188                 }
     
 !
199199                     tempnode(gotnr, INT, 0, MKSUE(INT)));
 200200                 p->n_op -= (UCALL-CALL);
 201201                 break;
<>202 -                
  202+
203203         case CBRANCH:
 204204                 l = p->n_left;
 205205 
     
 !
414414         return(p);
 415415 }
 416416 
<> 417+/*
  418+ * Change CALL references to either direct (static) or PLT.
  419+ */
  420+static void
  421+fixnames(NODE *p)
  422+{
  423+        struct symtab *sp;
  424+        NODE *q;
  425+        char *c;
  426+        int isu;
  427+
  428+        if ((cdope(p->n_op) & CALLFLG) == 0)
  429+                return;
  430+        isu = 0;
  431+        q = p->n_left;
  432+        if (q->n_op == UMUL)
  433+                q = q->n_left, isu = 1;
  434+        if (q->n_op == PLUS && q->n_left->n_op == TEMP &&
  435+            q->n_right->n_op == ICON) {
  436+                sp = q->n_right->n_sp;
  437+
  438+                if (sp->sclass == STATIC && !ISFTN(sp->stype))
  439+                        return; /* function pointer */
  440+
  441+                if (sp->sclass != STATIC && sp->sclass != EXTERN &&
  442+                    sp->sclass != EXTDEF)
  443+                        cerror("fixnames");
  444+
  445+                if ((c = strstr(sp->sname, "@GOT")) == NULL)
  446+                        cerror("fixnames2");
  447+                if (isu) {
  448+                        memcpy(c, "@PLT", sizeof("@PLT"));
  449+                } else
  450+                        *c = 0;
  451+                nfree(q->n_left);
  452+                q = q->n_right;
  453+                if (isu)
  454+                        nfree(p->n_left->n_left);
  455+                nfree(p->n_left);
  456+                p->n_left = q;
  457+        }
  458+}
  459+
417460 void
 418461 myp2tree(NODE *p)
 419462 {
<> 463+        if (kflag)
  464+                walkf(p, fixnames);
420465 }
 421466 
 422467 /*ARGSUSED*/
 423468 int
 424469 andable(NODE *p)
 425470 {
<>426 -        return(1);  /* all names can have & taken on them */
  471+        return(1);      /* all names can have & taken on them */
427472 }
 428473 
 429474 /*
     
 !
614659 {
 615660         union { float f; double d; long double l; int i[3]; } u;
 616661         struct symtab *q;
<> 662+        char *c;
617663         TWORD t;
 618664         int i;
 619665 
 620666         t = p->n_type;
 621667         if (t > BTMASK)
 622668                 t = INT; /* pointer */
 623669 
<> 670+        if (kflag && (p->n_op == PLUS || p->n_op == UMUL)) {
  671+                if (p->n_op == UMUL)
  672+                        p = p->n_left;
  673+                p = p->n_right;
  674+                q = p->n_sp;
  675+                if ((c = strstr(q->sname, "@GOT")) != NULL)
  676+                        *c = 0; /* ignore GOT ref here */
  677+        }
<_624678         if (p->n_op != ICON && p->n_op != FCON)
 625679                 cerror("ninval: init node not constant");
 626680 
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-09-03 09:04 +0200