Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(345)

Side by Side Diff: src/liblink/data.c

Issue 152570049: [dev.power64] code review 152570049: all: merge default into dev.power64 (Closed)
Patch Set: diff -r 36f7fc9495481ed67a159eea0eb2fac35b7c46a5 https://code.google.com/p/go Created 10 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/lib9/tempdir_windows.c ('k') | src/liblink/obj5.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Derived from Inferno utils/6l/obj.c and utils/6l/span.c 1 // Derived from Inferno utils/6l/obj.c and utils/6l/span.c
2 // http://code.google.com/p/inferno-os/source/browse/utils/6l/obj.c 2 // http://code.google.com/p/inferno-os/source/browse/utils/6l/obj.c
3 // http://code.google.com/p/inferno-os/source/browse/utils/6l/span.c 3 // http://code.google.com/p/inferno-os/source/browse/utils/6l/span.c
4 // 4 //
5 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. 5 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved.
6 // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) 6 // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
7 // Portions Copyright © 1997-1999 Vita Nuova Limited 7 // Portions Copyright © 1997-1999 Vita Nuova Limited
8 // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuov a.com) 8 // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuov a.com)
9 // Portions Copyright © 2004,2006 Bruce Ellis 9 // Portions Copyright © 2004,2006 Bruce Ellis
10 // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) 10 // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net)
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 int32 off, siz, i, fl; 76 int32 off, siz, i, fl;
77 float32 flt; 77 float32 flt;
78 uchar *cast; 78 uchar *cast;
79 vlong o; 79 vlong o;
80 Reloc *r; 80 Reloc *r;
81 81
82 off = p->from.offset; 82 off = p->from.offset;
83 siz = ctxt->arch->datasize(p); 83 siz = ctxt->arch->datasize(p);
84 if(off < 0 || siz < 0 || off >= 1<<30 || siz >= 100) 84 if(off < 0 || siz < 0 || off >= 1<<30 || siz >= 100)
85 mangle(pn); 85 mangle(pn);
86 if(ctxt->enforce_data_order && off < s->np)
87 ctxt->diag("data out of order (already have %d)\n%P", p);
86 symgrow(ctxt, s, off+siz); 88 symgrow(ctxt, s, off+siz);
87 89
88 if(p->to.type == ctxt->arch->D_FCONST) { 90 if(p->to.type == ctxt->arch->D_FCONST) {
89 switch(siz) { 91 switch(siz) {
90 default: 92 default:
91 case 4: 93 case 4:
92 flt = p->to.u.dval; 94 flt = p->to.u.dval;
93 cast = (uchar*)&flt; 95 cast = (uchar*)&flt;
94 for(i=0; i<4; i++) 96 for(i=0; i<4; i++)
95 s->p[off+i] = cast[fnuxi4[i]]; 97 s->p[off+i] = cast[fnuxi4[i]];
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 s->size += 4; 363 s->size += 4;
362 symgrow(ctxt, s, s->size); 364 symgrow(ctxt, s, s->size);
363 r = addrel(s); 365 r = addrel(s);
364 r->sym = t; 366 r->sym = t;
365 r->off = i; 367 r->off = i;
366 r->siz = 4; 368 r->siz = 4;
367 r->type = R_ADDR; 369 r->type = R_ADDR;
368 r->add = add; 370 r->add = add;
369 return i + r->siz; 371 return i + r->siz;
370 } 372 }
OLDNEW
« no previous file with comments | « src/lib9/tempdir_windows.c ('k') | src/liblink/obj5.c » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b