• Arnd Bergmann's avatar
    ARM: 8364/1: fix BE32 module loading · 73c430bf
    Arnd Bergmann authored
    The new veneer support for loadable modules on ARM uses the
    __opcode_to_mem_thumb32() function to count R_ARM_THM_CALL
    and R_ARM_THM_JUMP24 relocations.
    
    However, this function is not defined for big-endian kernels
    on ARMv5 or before, causing a compile-time error:
    
    arch/arm/kernel/module-plts.c: In function 'count_plts':
    arch/arm/kernel/module-plts.c:124:9: error: implicit declaration of function '__opcode_to_mem_thumb32' [-Werror=implicit-function-declaration]
             __opcode_to_mem_thumb32(0x07ff2fff)))
             ^
    
    As we know that this part of the function is only needed for
    Thumb2 kernels, and that those can never happen with BE32,
    we can avoid the error by enclosing the code in an #ifdef.
    
    Fixes: 7d485f64 ("ARM: 8220/1: allow modules outside of bl range")
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Acked-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
    Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
    73c430bf
module-plts.c 4.86 KB