1.1 --- a/generator.py Fri Feb 24 00:02:46 2017 +0100
1.2 +++ b/generator.py Fri Feb 24 13:25:05 2017 +0100
1.3 @@ -78,13 +78,13 @@
1.4 self.optimiser = optimiser
1.5 self.output = output
1.6
1.7 - def to_output(self, debug=False):
1.8 + def to_output(self, debug=False, gc_sections=False):
1.9
1.10 "Write the generated code."
1.11
1.12 self.check_output()
1.13 self.write_structures()
1.14 - self.write_scripts(debug)
1.15 + self.write_scripts(debug, gc_sections)
1.16 self.copy_templates()
1.17
1.18 def copy_templates(self):
1.19 @@ -418,7 +418,7 @@
1.20 f_signatures.close()
1.21 f_code.close()
1.22
1.23 - def write_scripts(self, debug):
1.24 + def write_scripts(self, debug, gc_sections):
1.25
1.26 "Write scripts used to build the program."
1.27
1.28 @@ -429,6 +429,9 @@
1.29 if debug:
1.30 print >>f_options, "CFLAGS = -g"
1.31
1.32 + if gc_sections:
1.33 + print >>f_options, "include gc_sections.mk"
1.34 +
1.35 # Identify modules used by the program.
1.36
1.37 native_modules = [join("native", "common.c")]