changeset 167:872fa82680e1

Make multiple instances of constant sections all start at offset 0 rather than merging them
author lost@l-w.ca
date Mon, 29 Aug 2011 19:05:18 -0600
parents 324f28905144
children 1e0a0e6cd918
files lwasm/section.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lwasm/section.c	Mon Aug 29 18:30:55 2011 -0600
+++ b/lwasm/section.c	Mon Aug 29 19:05:18 2011 -0600
@@ -138,6 +138,9 @@
 		as -> sections = s;
 	}
 	
+	// cause all instances of "constant" sections to start at 0
+	if (s -> flags & section_flag_constant)
+		s -> offset = 0;
 	lw_expr_destroy(l -> addr);
 	l -> addr = lw_expr_copy(s -> offset);
 	lw_expr_destroy(l -> daddr);