Greetings! I think we have a somewhat workable solution committed to master.
We define an __end variable in msbrk.c in assembler, using the xcode .zerofill directive, and place it in its own segment and section to get it past .bss and .common. Note that if the size is too large, the xcode linker will ignore the segment/section designation and fold the variable into a newly created __huge section under __DATA, and interleave it with other variables, which is not what we want. So we have a 1-2Gb heap for the raw image, and then expand the vmsize to 128Gb (currently) on unexec. I sure would appreciate if a knowledgeable user could show me how to avoid this two step process. Initializing the raw image may require setting GCL_MEM_BOUND to 29 or so to make sure we stay within this reserved range. If this two step process stays in we will put that in explicitly in the Makefile.am rule. If the linker behaves, then otool -t unixport/raw_pre_gcl |sort should have something like 000000010278a060 l O __DATA,__bss _begin_tzp.4 000000010278a060 l d *UND* _begin_tzp.4 000000010278c000 g O __HEAP,__heap __end SYMBOL TABLE: near the bottom, with no variables between __end and the SYMBOL TABLE. In any case, the heap is now growing at the correct place with no holes at all stages. The resulting saved images should be able to adapt to any user runtime memory up to 128Gb. We might need another power of two in the end, but you get the idea, and this can now be tested. If other people's linkers do not behave like I describe please let me know quickly and we will pursue another route. Take care, ============================================================================= msbrk.c ============================================================================= #if defined(DARWIN) /*This initial heap must be large enough to initialize the raw image, but not so large that the Mac linker ignores the segment designation and creates a __huge section under __DATA for this and other variables. We enlarge this on unexec.*/ asm (".zerofill __HEAP,__heap,__end,0x70000000\n\t.globl __end"); #endif ============================================================================= -- Camm Maguire c...@maguirefamily.org ========================================================================== "The earth is but one country, and mankind its citizens." -- Baha'u'llah