Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.19
 
1.20
 
MAIN:ragge:20110623134125
 
code.c
_>1818 
 1919 #include "pass1.h"
 2020 
<> 21+/*
  22+ * Print out assembler segment name.
  23+ */
2124 void
<> 25+setseg(int seg, char *name)
  26+{
  27+        switch (seg) {
  28+        case PROG: name = ".text"; break;
  29+        case DATA:
  30+        case LDATA: name = ".data"; break;
  31+        case STRNG:
  32+        case RDATA: name = ".section .rodata"; break;
  33+        case UDATA: break;
  34+        case PICLDATA:
  35+        case PICDATA:
  36+        case PICRDATA:
  37+        case TLSDATA:
  38+        case TLSUDATA:
  39+        case CTORS:
  40+        case DTORS:
  41+                uerror("FIXME: unknown section");
  42+        case NMSEG:
  43+                printf("\t.section %s,\"aw\",@progbits\n", name);
  44+                return;
  45+        }
  46+        printf("\t%s\n", name);
  47+}
  48+
  49+
  50+void
2251 defloc(struct symtab *sp)
 2352 {
<>24 -        static char *loctbl[] = { "text", "data", "rodata" };
 25 -        static int lastloc = -1;
2653         TWORD t;
<>27 -        char *n;
 28 -        int s;
  54+        char *name;
2955 
<>30 -        if (sp == NULL)
 31 -                return;
 32 -
3356         t = sp->stype;
<>34 -        s = ISFTN(t) ? PROG : ISCON(cqual(t, sp->squal)) ? RDATA : DATA;
 35 -        if (s != lastloc)
 36 -                printf("\n\t.section \".%s\"\n", loctbl[s]);
 37 -        lastloc = s;
 38 -        if (s == PROG)
 39 -                return;
4057 
<>41 -        switch (DEUNSIGN(sp->stype)) {
 42 -                case CHAR:      s = 1;
 43 -                case SHORT:     s = 2;
 44 -                case INT:
 45 -                case UNSIGNED:  s = 4;
 46 -                default:        s = 8;
 47 -        }
 48 -        printf("\t.align %d\n", s);
  58+        if ((name = sp->soname) == NULL)
  59+                name = exname(sp->sname);
4960 
<>50 -        n = sp->soname ? sp->soname : sp->sname;
  61+        if (!ISFTN(t)) {
  62+                printf("\t.type %s,#object\n", name);
  63+                printf("\t.size %s," CONFMT "\n", name,
  64+                        tsize(sp->stype, sp->sdf, sp->sap) / SZCHAR);
  65+        }
5166         if (sp->sclass == EXTDEF)
<>52 -                printf("\t.global %s\n", n);
  67+                printf("\t.global %s\n", name);
5368         if (sp->slevel == 0) {
<>54 -                printf("\t.type %s,#object\n", n);
 55 -                printf("\t.size %s," CONFMT "\n", n,
 56 -                        tsize(sp->stype, sp->sdf, sp->sap) / SZCHAR);
 57 -                printf("%s:\n", n);
  69+                printf("%s:\n", name);
<_5870         } else
 5971                 printf(LABFMT ":\n", sp->soffset);
 6072 }
FishEye: Open Source License registered to PCC.
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-12-18 19:22 +0100