comparison lwlink/objdump.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 fdc11ef4115b
children 346966cffeef
comparison
equal deleted inserted replaced
155:1571e150f1fd 156:fc8386b13399
152 { 152 {
153 unsigned char *fp; 153 unsigned char *fp;
154 long cc; 154 long cc;
155 int val; 155 int val;
156 int bss; 156 int bss;
157 int constant;
157 158
158 static char *opernames[] = { 159 static char *opernames[] = {
159 "?", 160 "?",
160 "PLUS", 161 "PLUS",
161 "MINUS", 162 "MINUS",
177 cc = 8; 178 cc = 8;
178 179
179 while (1) 180 while (1)
180 { 181 {
181 bss = 0; 182 bss = 0;
183 constant = 0;
182 184
183 // bail out if no more sections 185 // bail out if no more sections
184 if (!(CURBYTE())) 186 if (!(CURBYTE()))
185 break; 187 break;
186 188
195 { 197 {
196 case 0x01: 198 case 0x01:
197 printf(" FLAG: BSS\n"); 199 printf(" FLAG: BSS\n");
198 bss = 1; 200 bss = 1;
199 break; 201 break;
200 202 case 0x02:
203 printf(" FLAG: CONSTANT\n");
204 constant = 1;
205 break;
206
201 default: 207 default:
202 printf(" FLAG: %02X (unknown)\n", CURBYTE()); 208 printf(" FLAG: %02X (unknown)\n", CURBYTE());
203 break; 209 break;
204 } 210 }
205 NEXTBYTE(); 211 NEXTBYTE();