# HG changeset patch # User lost@starbug # Date 1272328626 21600 # Node ID 55ed7d06b1367a2e3e9efe320282a88cae56d37a # Parent 91c0fe0269408ea867f474a57f9f06a825f8b9dd Fixed intersection internal references in object target diff -r 91c0fe026940 -r 55ed7d06b136 lwasm/output.c --- a/lwasm/output.c Mon Apr 26 17:59:30 2010 -0600 +++ b/lwasm/output.c Mon Apr 26 18:37:06 2010 -0600 @@ -316,9 +316,15 @@ switch (v) { case lwasm_expr_secbase: - writebytes("\x05", 1, 1, of); - break; - + { + // replaced with a synthetic symbol + sectiontab_t *se; + se = lw_expr_specptr(e); + + writebytes("\x03\x02", 1, 1, of); + writebytes(se -> name, strlen(se -> name) + 1, 1, of); + break; + } case lwasm_expr_import: { importlist_t *ie; @@ -422,6 +428,10 @@ writebytes("", 1, 1, of); // now the local symbols + + // a symbol for section base address + writebytes("\x02", 1, 1, of); + writebytes(s -> name, strlen(s -> name) + 1, 1, of); for (se = as -> symtab.head; se; se = se -> next) { // ignore symbols not in this section