linux/arch/arm64
Ard Biesheuvel 24af6c4e4e arm64: module: split core and init PLT sections
The arm64 module PLT code allocates all PLT entries in a single core
section, since the overhead of having a separate init PLT section is
not justified by the small number of PLT entries usually required for
init code.

However, the core and init module regions are allocated independently,
and there is a corner case where the core region may be allocated from
the VMALLOC region if the dedicated module region is exhausted, but the
init region, being much smaller, can still be allocated from the module
region. This leads to relocation failures if the distance between those
regions exceeds 128 MB. (In fact, this corner case is highly unlikely to
occur on arm64, but the issue has been observed on ARM, whose module
region is much smaller).

So split the core and init PLT regions, and name the latter ".init.plt"
so it gets allocated along with (and sufficiently close to) the .init
sections that it serves. Also, given that init PLT entries may need to
be emitted for branches that target the core module, modify the logic
that disregards defined symbols to only disregard symbols that are
defined in the same section as the relocated branch instruction.

Since there may now be two PLT entries associated with each entry in
the symbol table, we can no longer hijack the symbol::st_size fields
to record the addresses of PLT entries as we emit them for zero-addend
relocations. So instead, perform an explicit comparison to check for
duplicate entries.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2017-04-26 12:31:00 +01:00
..
boot Merge tag 'juno-fixes-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into next/late 2017-03-02 23:08:31 +01:00
configs arm64: kdump: enable kdump in defconfig 2017-04-05 18:32:25 +01:00
crypto crypto: arm64/aes - add NEON/Crypto Extensions CBCMAC/CMAC/XCBC driver 2017-02-11 17:50:45 +08:00
include arm64: module: split core and init PLT sections 2017-04-26 12:31:00 +01:00
kernel arm64: module: split core and init PLT sections 2017-04-26 12:31:00 +01:00
kvm arm64: cpufeature: Make ID reg accessor naming less counterintuitive 2017-04-04 16:55:41 +01:00
lib scripts/spelling.txt: add "overwritting" pattern and fix typo instances 2017-02-27 18:43:47 -08:00
mm arm64: print a fault message when attempting to write RO memory 2017-04-06 17:36:09 +01:00
net bpf: fix unlocking of jited image when module ronx not set 2017-02-21 13:30:14 -05:00
xen xen/privcmd: Add IOCTL_PRIVCMD_DM_OP 2017-02-14 15:13:43 -05:00
Kconfig arm64: kdump: provide /proc/vmcore file 2017-04-05 18:31:38 +01:00
Kconfig.debug arm64: relocation testing module 2017-04-04 17:03:32 +01:00
Kconfig.platforms arm64: add THUNDER2 processor family 2017-02-09 16:25:26 +01:00
Makefile arm64: Silence spurious kbuild warning on menuconfig 2017-04-12 09:48:03 +01:00