LEFT | RIGHT |
(no file at all) | |
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 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 for(i=0; i<nelem(internalpkg); i++) { | 578 for(i=0; i<nelem(internalpkg); i++) { |
579 if(strcmp(pkg, internalpkg[i]) == 0) { | 579 if(strcmp(pkg, internalpkg[i]) == 0) { |
580 isinternal = 1; | 580 isinternal = 1; |
581 break; | 581 break; |
582 } | 582 } |
583 } | 583 } |
584 | 584 |
585 if(!isinternal) | 585 if(!isinternal) |
586 externalobj = 1; | 586 externalobj = 1; |
587 | 587 |
| 588 // DragonFly declares errno with __thread, which results in a symbol |
| 589 // type of R_386_TLS_GD or R_X86_64_TLSGD. The Go linker does not |
| 590 // currently know how to handle TLS relocations, hence we have to |
| 591 // force external linking for any libraries that link in code that |
| 592 // uses errno. This can be removed if the Go linker ever supports |
| 593 // these relocation types. |
| 594 if(HEADTYPE == Hdragonfly) |
| 595 if(strcmp(pkg, "net") == 0 || strcmp(pkg, "os/user") == 0) |
| 596 externalobj = 1; |
| 597 |
588 if(nhostobj >= mhostobj) { | 598 if(nhostobj >= mhostobj) { |
589 if(mhostobj == 0) | 599 if(mhostobj == 0) |
590 mhostobj = 16; | 600 mhostobj = 16; |
591 else | 601 else |
592 mhostobj *= 2; | 602 mhostobj *= 2; |
593 hostobj = erealloc(hostobj, mhostobj*sizeof hostobj[0]); | 603 hostobj = erealloc(hostobj, mhostobj*sizeof hostobj[0]); |
594 } | 604 } |
595 h = &hostobj[nhostobj++]; | 605 h = &hostobj[nhostobj++]; |
596 h->ld = ld; | 606 h->ld = ld; |
597 h->pkg = estrdup(pkg); | 607 h->pkg = estrdup(pkg); |
(...skipping 1916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2514 symgrow(ftab, start+(nhistfile+1)*4); | 2524 symgrow(ftab, start+(nhistfile+1)*4); |
2515 setuint32(ftab, start, nhistfile); | 2525 setuint32(ftab, start, nhistfile); |
2516 for(s = filesyms; s != S; s = s->next) | 2526 for(s = filesyms; s != S; s = s->next) |
2517 setuint32(ftab, start + s->value*4, ftabaddstring(ftab, s->name)
); | 2527 setuint32(ftab, start + s->value*4, ftabaddstring(ftab, s->name)
); |
2518 | 2528 |
2519 ftab->size = ftab->np; | 2529 ftab->size = ftab->np; |
2520 ········ | 2530 ········ |
2521 if(debug['v']) | 2531 if(debug['v']) |
2522 Bprint(&bso, "%5.2f pclntab=%lld bytes, funcdata total %lld byte
s\n", cputime(), (vlong)ftab->size, (vlong)funcdata_bytes); | 2532 Bprint(&bso, "%5.2f pclntab=%lld bytes, funcdata total %lld byte
s\n", cputime(), (vlong)ftab->size, (vlong)funcdata_bytes); |
2523 }······· | 2533 }······· |
LEFT | RIGHT |