]> git.baikalelectronics.ru Git - kernel.git/commit
riscv: Disable data start offset in flat binaries
authorDamien Le Moal <damien.lemoal@wdc.com>
Sat, 17 Apr 2021 01:10:09 +0000 (10:10 +0900)
committerGreg Ungerer <gerg@linux-m68k.org>
Fri, 23 Apr 2021 05:33:40 +0000 (15:33 +1000)
commit352693c438ba8b052fe86ea9238867701ea44f6f
treebcc1eccf0909b07df3d27d00da0f7b31fa76edfe
parentfd425301f6290256671b2422b153b077d6b1bac2
riscv: Disable data start offset in flat binaries

uclibc/gcc combined with elf2flt riscv linker file fully resolve the
PC relative __global_pointer$ value at compile time and do not generate
a relocation entry to set a correct value of the gp register at runtime.
As a result, if the flatbin loader offsets the start of the data
section, the relative position change between the text and data sections
compared to the compile time positions results in an incorrect gp value
being used. This causes flatbin executables to crash.

Avoid this problem by enabling CONFIG_BINFMT_FLAT_NO_DATA_START_OFFSET
automatically when CONFIG_RISCV is enabled and CONFIG_MMU is disabled.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
arch/riscv/Kconfig