~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to src/cmd/gc/obj.c

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-08-20 14:06:23 UTC
  • mfrom: (14.1.23 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130820140623-b414jfxi3m0qkmrq
Tags: 2:1.1.2-2ubuntu1
* Merge from Debian unstable (LP: #1211749, #1202027). Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - d/control,control.cross: Update Breaks/Replaces for Ubuntu
    versions to ensure smooth upgrades, regenerate control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
void
17
17
dumpobj(void)
18
18
{
 
19
        NodeList *externs, *tmp;
 
20
 
19
21
        bout = Bopen(outfile, OWRITE);
20
22
        if(bout == nil) {
21
23
                flusherrors();
31
33
 
32
34
        outhist(bout);
33
35
 
 
36
        externs = nil;
 
37
        if(externdcl != nil)
 
38
                externs = externdcl->end;
 
39
 
34
40
        dumpglobls();
35
41
        dumptypestructs();
 
42
 
 
43
        // Dump extra globals.
 
44
        tmp = externdcl;
 
45
        if(externs != nil)
 
46
                externdcl = externs->next;
 
47
        dumpglobls();
 
48
        externdcl = tmp;
 
49
 
36
50
        dumpdata();
37
51
        dumpfuncs();
38
52
 
59
73
                        continue;
60
74
                dowidth(n->type);
61
75
 
62
 
                ggloblnod(n, n->type->width);
 
76
                ggloblnod(n);
 
77
        }
 
78
 
 
79
        for(l=funcsyms; l; l=l->next) {
 
80
                n = l->n;
 
81
                dsymptr(n->sym, 0, n->sym->def->shortname->sym, 0);
 
82
                ggloblsym(n->sym, widthptr, 1, 1);
63
83
        }
64
84
}
65
85
 
302
322
        off = 0;
303
323
        
304
324
        // string header
305
 
        off = dsymptr(sym, off, sym, widthptr+4);
306
 
        off = duint32(sym, off, len);
 
325
        off = dsymptr(sym, off, sym, widthptr+widthint);
 
326
        off = duintxx(sym, off, len, widthint);
307
327
        
308
328
        // string data
309
329
        for(n=0; n<len; n+=m) {
314
334
        }
315
335
        off = duint8(sym, off, 0);  // terminating NUL for runtime
316
336
        off = (off+widthptr-1)&~(widthptr-1);  // round to pointer alignment
317
 
        ggloblsym(sym, off, 1);
 
337
        ggloblsym(sym, off, 1, 1);
318
338
 
319
339
        return sym;     
320
340
}