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

Delta Between Two Patch Sets: src/cmd/ld/data.c

Issue 4607048: code review 4607048: ld: make .rodata section read-only (Closed)
Left Patch Set: code review 4607048: ld: make .rodata section read-only Created 13 years, 9 months ago
Right Patch Set: diff -r db55aab08087 https://go.googlecode.com/hg/ Created 13 years, 9 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:
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(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
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
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 }
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

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