comparison lwasm/output.c @ 243:f9f01a499525 2.x

Added zero-width external references
author lost
date Tue, 15 Sep 2009 03:16:17 +0000
parents a58f49a77441
children
comparison
equal deleted inserted replaced
242:848d55b181f0 243:f9f01a499525
350 // flag end of exported symbols - "" is NOT an error 350 // flag end of exported symbols - "" is NOT an error
351 writebytes("", 1, 1, of); 351 writebytes("", 1, 1, of);
352 352
353 // now output the "incomplete references" 353 // now output the "incomplete references"
354 // this being the most complex bit 354 // this being the most complex bit
355 for (i = 0; i < as -> nextdeps; i++)
356 {
357 // flag 0-width reference
358 writebytes("\xFF\x02", 2, 1, of);
359 // write external symbol ref
360 writebytes("\x02", 1, 1, of);
361 writebytes(as -> extdeps[i], strlen(as -> extdeps[i]) + 1, 1, of);
362 // flag end of expr & offset 0 - the 3 is not an error
363 writebytes("\0\0", 3, 1, of);
364 }
355 for (re = s -> rl; re; re = re -> next) 365 for (re = s -> rl; re; re = re -> next)
356 { 366 {
357 if (re -> expr == NULL) 367 if (re -> expr == NULL)
358 { 368 {
359 // this is an error but we'll simply ignore it 369 // this is an error but we'll simply ignore it