
On 7/9/07, Andrew Dyer amdyer@gmail.com wrote:
In cpu/arm920t/start.S the macro get_bad_stack assumes that (CONFIG_STACKSIZE+CFG_MALLOC_LEN) will fit in a 16-bit constant. I am trying to do a build where CFG_MALLOC_LEN is much larger (need buffering for gzip splash screen decompression). Assembly of the file fails with errors due to invalid constants.
the macro looks like this:
.macro get_bad_stack ldr r13, _armboot_start @ setup our mode stack sub r13, r13, #(CONFIG_STACKSIZE+CFG_MALLOC_LEN)
OK, I fixed it for my case by changing this section to 2 subtracts like so:
sub r13, r13, #(CONFIG_STACKSIZE) sub r13, r13, #(CFG_MALLOC_LEN)
This will still break with defines that can't be encoded in the ARM constant field (8 bit constant shifted by an even number of bit positions). It appears this construct appears in a bunch of ARM start.S files.
Any opinions on how this should get fixed? I'm happy to cook up a patch if there is consensus on what to do.