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

Side by Side Diff: src/cmd/8l/asm.c

Issue 2288041: code review 2288041: 6l, 8l: elfsetstring is only for .shstrtab (Closed)
Patch Set: code review 2288041: 6l, 8l: elfsetstring is only for .shstrtab Created 14 years, 5 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/cmd/6l/asm.c ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Inferno utils/8l/asm.c 1 // Inferno utils/8l/asm.c
2 // http://code.google.com/p/inferno-os/source/browse/utils/8l/asm.c 2 // http://code.google.com/p/inferno-os/source/browse/utils/8l/asm.c
3 // 3 //
4 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. 4 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved.
5 // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) 5 // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
6 // Portions Copyright © 1997-1999 Vita Nuova Limited 6 // Portions Copyright © 1997-1999 Vita Nuova Limited
7 // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuov a.com) 7 // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuov a.com)
8 // Portions Copyright © 2004,2006 Bruce Ellis 8 // Portions Copyright © 2004,2006 Bruce Ellis
9 // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) 9 // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net)
10 // Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others 10 // Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 { 122 {
123 int n, m; 123 int n, m;
124 vlong r; 124 vlong r;
125 Prog *p; 125 Prog *p;
126 126
127 if(s->type == 0) 127 if(s->type == 0)
128 s->type = SDATA; 128 s->type = SDATA;
129 s->reachable = 1; 129 s->reachable = 1;
130 r = s->size; 130 r = s->size;
131 n = strlen(str)+1; 131 n = strlen(str)+1;
132 » elfsetstring(str, r); 132 » if(strcmp(s->name, ".shstrtab") == 0)
133 » » elfsetstring(str, r);
133 while(n > 0) { 134 while(n > 0) {
134 m = n; 135 m = n;
135 if(m > sizeof(p->to.scon)) 136 if(m > sizeof(p->to.scon))
136 m = sizeof(p->to.scon); 137 m = sizeof(p->to.scon);
137 p = newdata(s, s->size, m, D_EXTERN); 138 p = newdata(s, s->size, m, D_EXTERN);
138 p->to.type = D_SCONST; 139 p->to.type = D_SCONST;
139 memmove(p->to.scon, str, m); 140 memmove(p->to.scon, str, m);
140 s->size += m; 141 s->size += m;
141 str += m; 142 str += m;
142 n -= m; 143 n -= m;
(...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after
1314 1315
1315 if(r <= 0) 1316 if(r <= 0)
1316 return v; 1317 return v;
1317 v += r - 1; 1318 v += r - 1;
1318 c = v % r; 1319 c = v % r;
1319 if(c < 0) 1320 if(c < 0)
1320 c += r; 1321 c += r;
1321 v -= c; 1322 v -= c;
1322 return v; 1323 return v;
1323 } 1324 }
OLDNEW
« no previous file with comments | « src/cmd/6l/asm.c ('k') | no next file » | no next file with comments »

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