Skip to content
  • Damien Le Moal's avatar
    riscv: Disable data start offset in flat binaries · 09accc3a
    Damien Le Moal authored
    
    
    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: default avatarDamien Le Moal <damien.lemoal@wdc.com>
    Acked-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
    Signed-off-by: default avatarGreg Ungerer <gerg@linux-m68k.org>
    09accc3a