The nrf52_common.ld linker script oddly uses ALIGN when attempting to draw a distinction between the heap and the stack:
|
.heap : |
|
{ |
|
__HeapBase = .; |
|
__end__ = .; |
|
PROVIDE(end = .); |
|
KEEP(*(.heap*)) |
|
. = ALIGN(__StackLimit); |
|
__HeapLimit = .; |
|
} > RAM |
While GNU binutils has not required ALIGN's argument to be a power of two since 2.15 (contrast 2.12), lld still complains (probably because ALIGN is almost always used with a small power of two) and, besides and more importantly, ALIGN-ment isn't what the linker script is trying to ensure here! It wants . to advance to the lowest stack address -- that is, __StackLimit, and to place the symbol __HeapLimit there.
TL;DR: I think that line should just be . = __StackLimit;, without the ALIGN() (ah, no, that's a divergence between LLVM and GNU interpretations of linker scripts, siiiigh) be . = ABSOLUTE(__StackLimit);.
Does that seem right?
The
nrf52_common.ldlinker script oddly usesALIGNwhen attempting to draw a distinction between the heap and the stack:Adafruit_nRF52_Arduino/cores/nRF5/linker/nrf52_common.ld
Lines 151 to 159 in fa129c2
While GNU binutils has not required
ALIGN's argument to be a power of two since 2.15 (contrast 2.12),lldstill complains (probably becauseALIGNis almost always used with a small power of two) and, besides and more importantly,ALIGN-ment isn't what the linker script is trying to ensure here! It wants.to advance to the lowest stack address -- that is,__StackLimit, and to place the symbol__HeapLimitthere.TL;DR: I think that line should
just be(ah, no, that's a divergence between LLVM and GNU interpretations of linker scripts, siiiigh) be. = __StackLimit;, without theALIGN(). = ABSOLUTE(__StackLimit);.Does that seem right?