1. 02 6月, 2015 1 次提交
    • A
      ARM: 8364/1: fix BE32 module loading · 73c430bf
      Arnd Bergmann 提交于
      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: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      73c430bf
  2. 08 5月, 2015 1 次提交
    • A
      ARM: 8220/1: allow modules outside of bl range · 7d485f64
      Ard Biesheuvel 提交于
      Loading modules far away from the kernel in memory is problematic
      because the 'bl' instruction only has limited reach, and modules are not
      built with PLTs. Instead of using the -mlong-calls option (which affects
      all compiler emitted bl instructions, but not the ones in assembler),
      this patch allocates some additional space at module load time, and
      populates it with PLT like veneers when encountering relocations that
      are out of range.
      
      This should work with all relocations against symbols exported by the
      kernel, including those resulting from GCC generated implicit function
      calls for ftrace etc.
      
      The module memory size increases by about 5% on average, regardless of
      whether any PLT entries were actually needed. However, due to the page
      based rounding that occurs when allocating module memory, the average
      memory footprint increase is negligible.
      Reviewed-by: NNicolas Pitre <nico@linaro.org>
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      7d485f64