To add a module initializer optimization, we need to defer finishing writing out the module file until the end of determining the dynamic initializers. This is achieved by passing some saved-state from the main module writing to a new function that completes it. This patch merely adds the skeleton of that state and move things around, allowing the finalization of the ELF file to be postponed. None of the contents writing is moved, or the init optimization added. nathan -- Nathan Sidwell