Mercurial > hg > index.cgi
comparison lwasm/section.c @ 156:fc8386b13399
Added 'constant' sections to object file handling for lwasm and lwlink
author | lost@l-w.ca |
---|---|
date | Sun, 28 Aug 2011 02:06:42 -0600 |
parents | 5ac1c4cd81a7 |
children | 409295d09a2e |
comparison
equal
deleted
inserted
replaced
155:1571e150f1fd | 156:fc8386b13399 |
---|---|
96 s -> reloctab = NULL; | 96 s -> reloctab = NULL; |
97 if (!strcasecmp(sn, "bss") || !strcasecmp(sn, ".bss")) | 97 if (!strcasecmp(sn, "bss") || !strcasecmp(sn, ".bss")) |
98 { | 98 { |
99 s -> flags |= section_flag_bss; | 99 s -> flags |= section_flag_bss; |
100 } | 100 } |
101 if (!strcasecmp(sn, "_constant")) | |
102 { | |
103 s -> flags |= section_flag_constant; | |
104 } | |
105 | |
101 // parse options | 106 // parse options |
102 if (opts) | 107 if (opts) |
103 { | 108 { |
104 // only one option ("bss" or "!bss") | 109 // only one option ("bss" or "!bss") |
105 if (!strcasecmp(opts, "bss")) | 110 if (!strcasecmp(opts, "bss")) |
107 s -> flags |= section_flag_bss; | 112 s -> flags |= section_flag_bss; |
108 } | 113 } |
109 else if (!strcasecmp(opts, "!bss")) | 114 else if (!strcasecmp(opts, "!bss")) |
110 { | 115 { |
111 s -> flags &= ~section_flag_bss; | 116 s -> flags &= ~section_flag_bss; |
117 } | |
118 else if (!strcasecmp(opts, "constant")) | |
119 { | |
120 s -> flags |= section_flag_constant; | |
121 } | |
122 else if (!strcasecmp(opts, "!constant")) | |
123 { | |
124 s -> flags |= section_flag_constant; | |
112 } | 125 } |
113 else | 126 else |
114 { | 127 { |
115 lwasm_register_error(as, l, "Unrecognized section flag"); | 128 lwasm_register_error(as, l, "Unrecognized section flag"); |
116 lw_free(sn); | 129 lw_free(sn); |