comparison src/pseudo.c @ 82:03be43ae19cf

Added EXTERN directive
author lost
date Sat, 10 Jan 2009 22:24:29 +0000
parents d0ce3f5f6797
children 918be0c02239
comparison
equal deleted inserted replaced
81:b6b1e79cc277 82:03be43ae19cf
759 as -> csect -> offset = as -> addr; 759 as -> csect -> offset = as -> addr;
760 as -> addr = 0; 760 as -> addr = 0;
761 as -> csect = 0; 761 as -> csect = 0;
762 as -> context = lwasm_next_context(as); 762 as -> context = lwasm_next_context(as);
763 } 763 }
764
765 OPFUNC(pseudo_extern)
766 {
767 if (as -> passnum != 1)
768 return;
769
770 if (as -> outformat != OUTPUT_OBJ)
771 {
772 register_error(as, l, 1, "External references only supported for obj target");
773 return;
774 }
775
776 if (as -> csect)
777 {
778 register_error(as, l, 1, "Cannot declare external symbols within a section");
779 return;
780 }
781
782 lwasm_register_symbol(as, l, l -> sym, 0, SYMBOL_EXTERN);
783 }