OLD | NEW |
1 // Inferno utils/5l/asm.c | 1 // Inferno utils/5l/asm.c |
2 // http://code.google.com/p/inferno-os/source/browse/utils/5l/asm.c | 2 // http://code.google.com/p/inferno-os/source/browse/utils/5l/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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 */ | 315 */ |
316 s = dynamic; | 316 s = dynamic; |
317 elfwritedynentsym(s, DT_HASH, lookup(".hash", 0)); | 317 elfwritedynentsym(s, DT_HASH, lookup(".hash", 0)); |
318 elfwritedynentsym(s, DT_SYMTAB, lookup(".dynsym", 0)); | 318 elfwritedynentsym(s, DT_SYMTAB, lookup(".dynsym", 0)); |
319 elfwritedynent(s, DT_SYMENT, ELF32SYMSIZE); | 319 elfwritedynent(s, DT_SYMENT, ELF32SYMSIZE); |
320 elfwritedynentsym(s, DT_STRTAB, lookup(".dynstr", 0)); | 320 elfwritedynentsym(s, DT_STRTAB, lookup(".dynstr", 0)); |
321 elfwritedynentsymsize(s, DT_STRSZ, lookup(".dynstr", 0)); | 321 elfwritedynentsymsize(s, DT_STRSZ, lookup(".dynstr", 0)); |
322 elfwritedynentsym(s, DT_REL, lookup(".rel", 0)); | 322 elfwritedynentsym(s, DT_REL, lookup(".rel", 0)); |
323 elfwritedynentsymsize(s, DT_RELSZ, lookup(".rel", 0)); | 323 elfwritedynentsymsize(s, DT_RELSZ, lookup(".rel", 0)); |
324 elfwritedynent(s, DT_RELENT, ELF32RELSIZE); | 324 elfwritedynent(s, DT_RELENT, ELF32RELSIZE); |
| 325 if(rpath) |
| 326 elfwritedynent(s, DT_RUNPATH, addstring(dynstr, rpath)); |
325 elfwritedynent(s, DT_NULL, 0); | 327 elfwritedynent(s, DT_NULL, 0); |
326 } | 328 } |
327 } | 329 } |
328 | 330 |
329 vlong | 331 vlong |
330 datoff(vlong addr) | 332 datoff(vlong addr) |
331 { | 333 { |
332 if(addr >= INITDAT) | 334 if(addr >= INITDAT) |
333 return addr - INITDAT + rnd(HEADR+textsize, INITRND); | 335 return addr - INITDAT + rnd(HEADR+textsize, INITRND); |
334 diag("datoff %#llx", addr); | 336 diag("datoff %#llx", addr); |
(...skipping 2089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2424 int n; | 2426 int n; |
2425 | 2427 |
2426 for(n = sizeof(chipfloats)/sizeof(chipfloats[0]); --n >= 0;){ | 2428 for(n = sizeof(chipfloats)/sizeof(chipfloats[0]); --n >= 0;){ |
2427 p = &chipfloats[n]; | 2429 p = &chipfloats[n]; |
2428 if(p->l == e->l && p->h == e->h) | 2430 if(p->l == e->l && p->h == e->h) |
2429 return n; | 2431 return n; |
2430 } | 2432 } |
2431 return -1; | 2433 return -1; |
2432 } | 2434 } |
2433 | 2435 |
OLD | NEW |