[prefix] Use .bss16 as temporary stack space for calls to install_block

Some decompression algorithms (e.g. LZMA) require large amounts of
temporary stack space, which may not be made available by all
prefixes.  Use .bss16 as a temporary stack for the duration of the
calls to install_block (switching back to the external stack before we
start making calls into code which might access variables in .bss16),
and allow the decompressor to define a global symbol to force a
minimum value on the size of .bss16.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2015-02-24 16:13:55 +00:00
parent b6889eaa1e
commit 3e04f0791e
2 changed files with 46 additions and 11 deletions

View File

@@ -26,6 +26,13 @@ SECTIONS {
PROVIDE ( _max_align = 16 );
/*
* Allow decompressor to require a minimum amount of temporary stack
* space.
*
*/
PROVIDE ( _min_decompress_stack = 0 );
/*
* The prefix
*
@@ -87,6 +94,7 @@ SECTIONS {
*(.bss16.*)
*(.stack16)
*(.stack16.*)
. = MAX ( ., _mdata16 + _min_decompress_stack );
_edata16 = .;
}
_data16_filesz = ABSOLUTE ( _mdata16 ) - ABSOLUTE ( _data16 );