comparison lwasm/lwasm.c @ 376:91c0fe026940

Output incomplete references in object target
author lost@starbug
date Mon, 26 Apr 2010 17:59:30 -0600
parents 3498b2d88376
children 1624a36f12a3
comparison
equal deleted inserted replaced
375:3498b2d88376 376:91c0fe026940
627 else 627 else
628 { 628 {
629 if (l -> as -> output_format == OUTPUT_OBJ) 629 if (l -> as -> output_format == OUTPUT_OBJ)
630 { 630 {
631 reloctab_t *re; 631 reloctab_t *re;
632 lw_expr_t te;
632 633
633 // add "expression" record to section table 634 // add "expression" record to section table
634 v = lw_expr_intval(l -> addr) + l -> outputl;
635 re = lw_alloc(sizeof(reloctab_t)); 635 re = lw_alloc(sizeof(reloctab_t));
636 re -> next = l -> csect -> reloctab; 636 re -> next = l -> csect -> reloctab;
637 l -> csect -> reloctab = re; 637 l -> csect -> reloctab = re;
638 re -> offset = v; 638 te = lw_expr_build(lw_expr_type_int, l -> outputl);
639 re -> offset = lw_expr_build(lw_expr_type_oper, lw_expr_oper_plus, l -> addr, te);
640 lw_expr_destroy(te);
641 lwasm_reduce_expr(l -> as, re -> offset);
639 re -> size = size; 642 re -> size = size;
640 re -> expr = lw_expr_copy(expr); 643 re -> expr = lw_expr_copy(expr);
641 644
642 for (v = 0; v < size; v++) 645 for (v = 0; v < size; v++)
643 lwasm_emit(l, 0); 646 lwasm_emit(l, 0);