Mercurial > hg-old > index.cgi
comparison src/pseudo.c @ 99:3dcb12a6f4ff
Fixed problem handling sections with options on pass 2
author | lost |
---|---|
date | Sat, 17 Jan 2009 07:28:45 +0000 |
parents | f3497072ac44 |
children | 26c058fa0bc1 |
comparison
equal
deleted
inserted
replaced
98:81fc353d4d69 | 99:3dcb12a6f4ff |
---|---|
129 { | 129 { |
130 as -> addr += l -> nocodelen; | 130 as -> addr += l -> nocodelen; |
131 return; | 131 return; |
132 } | 132 } |
133 r = lwasm_expr_result2(as, l, p, EXPR_PASS1CONST, &v, -1); | 133 r = lwasm_expr_result2(as, l, p, EXPR_PASS1CONST, &v, -1); |
134 fprintf(stderr, "RMB: v=%d, addr=%d\n", v, as -> addr); | |
135 if (r != 0) | 134 if (r != 0) |
136 return; | 135 return; |
137 l -> nocodelen = v; | 136 l -> nocodelen = v; |
138 as -> addr += v; | 137 as -> addr += v; |
139 } | 138 } |
659 sectiontab_t *s; | 658 sectiontab_t *s; |
660 char *p2; | 659 char *p2; |
661 char *sn; | 660 char *sn; |
662 char *opts; | 661 char *opts; |
663 | 662 |
664 | 663 |
665 if (as -> outformat != OUTPUT_OBJ) | 664 if (as -> outformat != OUTPUT_OBJ) |
666 { | 665 { |
667 register_error(as, l, 1, "Sections only supported for obj target"); | 666 register_error(as, l, 1, "Sections only supported for obj target"); |
668 return; | 667 return; |
669 } | 668 } |
700 { | 699 { |
701 if (!strcmp(s -> name, sn)) | 700 if (!strcmp(s -> name, sn)) |
702 break; | 701 break; |
703 } | 702 } |
704 | 703 |
705 if (s) | 704 if (s && as -> passnum == 1) |
706 { | 705 { |
707 lwasm_free(sn); | 706 lwasm_free(sn); |
708 if (opts) | 707 if (opts) |
709 { | 708 { |
710 register_error(as, l, 1, "Section options can only be specified the first time"); | 709 register_error(as, l, 1, "Section options can only be specified the first time"); |