arm64: PIE: Allow fixed stack pointer
authorAndre Przywara <andre.przywara@arm.com>
Wed, 30 Sep 2020 16:39:15 +0000 (17:39 +0100)
committerTom Rini <trini@konsulko.com>
Thu, 8 Oct 2020 15:42:36 +0000 (11:42 -0400)
commit12650e4a46c859eb14e6141b828d92919a18b9c6
tree114ad2eae5ce9fadcccd31642b1229c240253d60
parent9a984f100ed1d2d4a3aed7db9cfd1a3892e2bccd
arm64: PIE: Allow fixed stack pointer

Currently selecting CONFIG_POSITION_INDEPENDENT also forces us to use an
initial stack pointer relative to the beginning of the BSS section.
This makes some sense, because this should be writable memory anyway.

However the BSS section is not cleared or used until later in the
setup process (after relocation), so memory nearby might not be
available early enough to host the initial stack. This is an issue if
U-Boot is loaded from (Flash-)ROM, for instance.

Allow CONFIG_INIT_SP_RELATIVE to be turned off by a board's config, to
be able to select a fixed stack pointer, for instance in known good
DRAM.

This will help QEMU utilising PIE, when it's loaded to (Flash-)ROM.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
arch/arm/Kconfig