LEFT | RIGHT |
(no file at all) | |
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 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 *l = nil; | 774 *l = nil; |
775 | 775 |
776 datap = datsort(datap); | 776 datap = datsort(datap); |
777 | 777 |
778 /* | 778 /* |
779 * allocate data sections. list is sorted by type, | 779 * allocate data sections. list is sorted by type, |
780 * so we can just walk it for each piece we want to emit. | 780 * so we can just walk it for each piece we want to emit. |
781 */ | 781 */ |
782 | 782 |
783 /* read-only data */ | 783 /* read-only data */ |
784 » sect = addsection(&segtext, ".rodata", 06); | 784 » sect = addsection(&segtext, ".rodata", 04); |
785 sect->vaddr = 0; | 785 sect->vaddr = 0; |
786 datsize = 0; | 786 datsize = 0; |
787 s = datap; | 787 s = datap; |
788 for(; s != nil && s->type < SDATA; s = s->next) { | 788 for(; s != nil && s->type < SDATA; s = s->next) { |
789 s->type = SRODATA; | 789 s->type = SRODATA; |
790 t = rnd(s->size, PtrSize); | 790 t = rnd(s->size, PtrSize); |
791 s->value = datsize; | 791 s->value = datsize; |
792 datsize += t; | 792 datsize += t; |
793 } | 793 } |
794 sect->len = datsize - sect->vaddr; | 794 sect->len = datsize - sect->vaddr; |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 xdefine("erodata", SRODATA, rodata->vaddr + rodata->len); | 936 xdefine("erodata", SRODATA, rodata->vaddr + rodata->len); |
937 xdefine("data", SBSS, data->vaddr); | 937 xdefine("data", SBSS, data->vaddr); |
938 xdefine("edata", SBSS, data->vaddr + data->len); | 938 xdefine("edata", SBSS, data->vaddr + data->len); |
939 xdefine("end", SBSS, segdata.vaddr + segdata.len); | 939 xdefine("end", SBSS, segdata.vaddr + segdata.len); |
940 | 940 |
941 sym = lookup("pclntab", 0); | 941 sym = lookup("pclntab", 0); |
942 xdefine("epclntab", SRODATA, sym->value + sym->size); | 942 xdefine("epclntab", SRODATA, sym->value + sym->size); |
943 sym = lookup("symtab", 0); | 943 sym = lookup("symtab", 0); |
944 xdefine("esymtab", SRODATA, sym->value + sym->size); | 944 xdefine("esymtab", SRODATA, sym->value + sym->size); |
945 } | 945 } |
LEFT | RIGHT |