linux/arch/arm64/kernel
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
..
probes arm64: kprobes: remove kprobe_exceptions_notify 2017-03-10 17:41:19 +00:00
vdso arm64: Add support for CLOCK_MONOTONIC_RAW in clock_gettime() vDSO 2016-07-12 16:06:32 +01:00
.gitignore arm64: Build infrastructure 2012-09-17 13:42:21 +01:00
Makefile arm64: kdump: provide /proc/vmcore file 2017-04-05 18:31:38 +01:00
acpi.c ACPI / osl: Remove acpi_get_table_with_size()/early_acpi_os_unmap_memory() users 2016-12-21 02:36:38 +01:00
acpi_numa.c arm64/numa: avoid inconsistent information to be printed 2016-09-09 14:59:08 +01:00
acpi_parking_protocol.c arm64: Use __pa_symbol for kernel symbols 2017-01-12 15:05:39 +00:00
alternative.c arm64: alternatives: apply boot time fixups via the linear mapping 2017-03-23 13:54:19 +00:00
arm64ksyms.c arm: kernel: Add SMC structure parameter 2017-02-03 18:46:33 +00:00
armv8_deprecated.c kprobes: move kprobe declarations to asm-generic/kprobes.h 2017-02-27 18:43:45 -08:00
asm-offsets.c arm: kernel: Add SMC structure parameter 2017-02-03 18:46:33 +00:00
cacheinfo.c arm64: cacheinfo: Remove CCSIDR-based cache information probing 2017-03-20 16:16:54 +00:00
cpu-reset.S arm64: Add back cpu reset routines 2016-06-27 16:31:25 +01:00
cpu-reset.h arm64: Use __pa_symbol for kernel symbols 2017-01-12 15:05:39 +00:00
cpu_errata.c arm64: cpu_errata: Add capability to advertise Cortex-A73 erratum 858921 2017-04-07 11:22:08 +01:00
cpu_ops.c arm64: apply __ro_after_init to some objects 2016-08-22 12:32:29 +01:00
cpufeature.c Pre-requisites for the arch timer errata workarounds: 2017-04-07 17:04:19 +01:00
cpuidle.c arm64: kernel: Update kerneldoc for cpu_suspend() rename 2017-03-10 18:06:24 +00:00
cpuinfo.c arm64: v8.3: Support for weaker release consistency 2017-03-20 16:30:22 +00:00
crash_dump.c arm64: kdump: provide /proc/vmcore file 2017-04-05 18:31:38 +01:00
debug-monitors.c arm64: cpufeature: Make ID reg accessor naming less counterintuitive 2017-04-04 16:55:41 +01:00
efi-entry.S arm64: efi-entry.S: avoid open-coded adr_l 2017-01-17 17:41:14 +00:00
efi-header.S arm64: efi: split Image code and data into separate PE/COFF sections 2017-04-04 17:50:59 +01:00
efi.c arm64: mm: replace 'block_mappings_allowed' with 'page_mappings_only' 2016-11-07 18:15:04 +00:00
entry-fpsimd.S arm64: fpsimd: fix a typo in fpsimd_save_partial_state ENDPROC 2014-07-31 11:42:42 +01:00
entry-ftrace.S arm64: include asm/assembler.h in entry-ftrace.S 2017-02-15 11:34:25 +00:00
entry.S arm64: avoid returning from bad_mode 2017-01-19 15:38:22 +00:00
entry32.S arm64: entry32: remove pointless register assignment 2015-07-10 16:47:13 +01:00
fpsimd.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/signal.h> 2017-03-02 08:42:29 +01:00
ftrace.c ftrace: Add return address pointer to ftrace_ret_stack 2016-08-24 12:15:14 +02:00
head.S Merge branch 'arm64/common-sysreg' of git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux into for-next/core 2017-04-04 18:08:47 +01:00
hibernate-asm.S arm64: Introduce raw_{d,i}cache_line_size 2016-09-09 15:03:29 +01:00
hibernate.c arm64: hibernate: preserve kdump image around hibernation 2017-04-05 18:28:50 +01:00
hw_breakpoint.c cpu/hotplug: Cleanup state names 2016-12-25 10:47:44 +01:00
hyp-stub.S arm64: Add back cpu reset routines 2016-06-27 16:31:25 +01:00
image.h arm64 updates for 4.7: 2016-05-16 17:17:24 -07:00
insn.c kprobes: move kprobe declarations to asm-generic/kprobes.h 2017-02-27 18:43:45 -08:00
io.c arm64: optimize memcpy_{from,to}io() and memset_io() 2014-11-06 17:25:27 +00:00
irq.c arm64: remove irq_count and do_softirq_own_stack() 2015-12-21 17:26:01 +00:00
jump_label.c jump_label: Rename JUMP_LABEL_{EN,DIS}ABLE to JUMP_LABEL_{JMP,NOP} 2015-08-03 11:34:12 +02:00
kaslr.c arm64: apply __ro_after_init to some objects 2016-08-22 12:32:29 +01:00
kgdb.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/task_stack.h> 2017-03-02 08:42:36 +01:00
kuser32.S arm64: Add __NR_* definitions for compat syscalls 2014-07-10 11:02:40 +01:00
machine_kexec.c arm64: kdump: add VMCOREINFO's for user-space tools 2017-04-05 18:29:47 +01:00
module-plts.c arm64: module: split core and init PLT sections 2017-04-26 12:31:00 +01:00
module.c arm64: module: split core and init PLT sections 2017-04-26 12:31:00 +01:00
module.lds arm64: module: split core and init PLT sections 2017-04-26 12:31:00 +01:00
paravirt.c arm64: introduce CONFIG_PARAVIRT, PARAVIRT_TIME_ACCOUNTING and pv_time_ops 2015-12-21 14:40:54 +00:00
pci.c PCI/ACPI: Extend pci_mcfg_lookup() to return ECAM config accessors 2016-12-06 13:45:48 -06:00
perf_callchain.c perf core: Add a 'nr' field to perf_event_callchain_context 2016-05-16 23:11:51 -03:00
perf_event.c arm64: pmuv3: handle pmuv3+ 2017-04-25 15:12:59 +01:00
perf_regs.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/task_stack.h> 2017-03-02 08:42:36 +01:00
process.c arm64: drop unnecessary newlines in show_regs() 2017-03-23 14:20:41 +00:00
psci.c arm64: Use __pa_symbol for kernel symbols 2017-01-12 15:05:39 +00:00
ptrace.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/task_stack.h> 2017-03-02 08:42:36 +01:00
reloc_test_core.c arm64: relocation testing module 2017-04-04 17:03:32 +01:00
reloc_test_syms.S arm64: relocation testing module 2017-04-04 17:03:32 +01:00
relocate_kernel.S arm64: Introduce raw_{d,i}cache_line_size 2016-09-09 15:03:29 +01:00
return_address.c arm64: factor out current_stack_pointer 2016-11-11 18:25:43 +00:00
setup.c arm64: kdump: reserve memory for crash dump kernel 2017-04-05 18:26:57 +01:00
signal.c arm64: Add uprobe support 2016-11-07 18:15:21 +00:00
signal32.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
sleep.S arm64: move sp_el0 and tpidr_el1 into cpu_suspend_ctx 2016-11-11 18:25:44 +00:00
smccc-call.S firmware: qcom: scm: Fix interrupted SCM calls 2017-02-03 18:46:33 +00:00
smp.c Merge branch 'will/for-next/perf' into for-next/core 2017-04-12 10:41:50 +01:00
smp_spin_table.c arm64: Use __pa_symbol for kernel symbols 2017-01-12 15:05:39 +00:00
stacktrace.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/task_stack.h> 2017-03-02 08:42:36 +01:00
suspend.c arm64: move sp_el0 and tpidr_el1 into cpu_suspend_ctx 2016-11-11 18:25:44 +00:00
sys.c arm64: compat: Check for AArch32 state 2016-04-20 12:22:42 +01:00
sys32.c arm64: fix implementation of mmap2 compat syscall 2015-03-19 10:43:51 +00:00
sys_compat.c sched/headers: Prepare for the reduction of <linux/sched.h>'s signal API dependency 2017-03-02 08:42:37 +01:00
time.c arm64: ftrace: fix a stack tracer's output under function graph tracer 2015-12-21 17:26:02 +00:00
topology.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/topology.h> 2017-03-02 08:42:26 +01:00
trace-events-emulation.h arm64: Trace emulation of AArch32 legacy instructions 2014-11-20 16:35:02 +00:00
traps.c arm64: Add CNTFRQ_EL0 trap handler 2017-04-24 12:22:25 +01:00
vdso.c arm64: Use __pa_symbol for kernel symbols 2017-01-12 15:05:39 +00:00
vmlinux.lds.S arm64: efi: split Image code and data into separate PE/COFF sections 2017-04-04 17:50:59 +01:00