linux/arch/arm64/kernel
Ard Biesheuvel 08cc55b2af arm64: relocatable: suppress R_AARCH64_ABS64 relocations in vmlinux
The linker routines that we rely on to produce a relocatable PIE binary
treat it as a shared ELF object in some ways, i.e., it emits symbol based
R_AARCH64_ABS64 relocations into the final binary since doing so would be
appropriate when linking a shared library that is subject to symbol
preemption. (This means that an executable can override certain symbols
that are exported by a shared library it is linked with, and that the
shared library *must* update all its internal references as well, and point
them to the version provided by the executable.)

Symbol preemption does not occur for OS hosted PIE executables, let alone
for vmlinux, and so we would prefer to get rid of these symbol based
relocations. This would allow us to simplify the relocation routines, and
to strip the .dynsym, .dynstr and .hash sections from the binary. (Note
that these are tiny, and are placed in the .init segment, but they clutter
up the vmlinux binary.)

Note that these R_AARCH64_ABS64 relocations are only emitted for absolute
references to symbols defined in the linker script, all other relocatable
quantities are covered by anonymous R_AARCH64_RELATIVE relocations that
simply list the offsets to all 64-bit values in the binary that need to be
fixed up based on the offset between the link time and run time addresses.

Fortunately, GNU ld has a -Bsymbolic option, which is intended for shared
libraries to allow them to ignore symbol preemption, and unconditionally
bind all internal symbol references to its own definitions. So set it for
our PIE binary as well, and get rid of the asoociated sections and the
relocation code that processes them.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
[will: fixed conflict with __dynsym_offset linker script entry]
Signed-off-by: Will Deacon <will.deacon@arm.com>
2016-07-29 10:45:01 +01:00
..
probes arm64: kprobes: Add KASAN instrumentation around stack accesses 2016-07-21 11:47:53 +01:00
vdso arm64: Add support for CLOCK_MONOTONIC_RAW in clock_gettime() vDSO 2016-07-12 16:06:32 +01:00
.gitignore
acpi_parking_protocol.c arm64: kernel: acpi: fix ioremap in ACPI parking protocol cpu_postboot 2016-02-26 15:39:52 +00:00
acpi.c arm64: acpi: add acpi=on cmdline option to prefer ACPI boot over DT 2016-04-26 14:37:41 +01:00
alternative.c
arm64ksyms.c Merge branch 'for-next/kprobes' into for-next/core 2016-07-21 18:20:41 +01:00
armv8_deprecated.c Merge branch 'for-next/kprobes' into for-next/core 2016-07-21 18:20:41 +01:00
asm-offsets.c Merge branch 'for-next/kprobes' into for-next/core 2016-07-21 18:20:41 +01:00
cacheinfo.c
cpu_errata.c arm64: trap userspace "dc cvau" cache operation on errata-affected core 2016-07-01 11:46:00 +01:00
cpu_ops.c arm64: kernel: implement ACPI parking protocol 2016-02-16 15:12:32 +00:00
cpu-reset.h arm64: Add back cpu reset routines 2016-06-27 16:31:25 +01:00
cpu-reset.S arm64: Add back cpu reset routines 2016-06-27 16:31:25 +01:00
cpufeature.c arm64: errata: Calling enable functions for CPU errata too 2016-07-01 11:30:28 +01:00
cpuidle.c arm64: cpuidle: make arm_cpuidle_suspend() a bit more efficient 2016-04-13 14:49:23 +01:00
cpuinfo.c arm64: cpuinfo: Expose MIDR_EL1 and REVIDR_EL1 to sysfs 2016-07-12 16:09:37 +01:00
debug-monitors.c Merge branch 'for-next/kprobes' into for-next/core 2016-07-21 18:20:41 +01:00
efi-entry.S arm64: move early boot code to the .init segment 2016-04-14 18:11:30 +01:00
efi.c arm64: efi: avoid block mappings for unaligned UEFI memory regions 2016-07-01 11:56:26 +01:00
entry32.S
entry-fpsimd.S
entry-ftrace.S
entry.S Merge branch 'for-next/kprobes' into for-next/core 2016-07-21 18:20:41 +01:00
fpsimd.c arm64: Fix misspellings in comments. 2016-03-04 18:19:17 +00:00
ftrace.c
head.S arm64: relocatable: suppress R_AARCH64_ABS64 relocations in vmlinux 2016-07-29 10:45:01 +01:00
hibernate-asm.S arm64: kernel: Add support for hibernate/suspend-to-disk 2016-04-28 13:36:22 +01:00
hibernate.c arm64: hibernate: Refuse to hibernate if the boot cpu is offline 2016-04-28 13:36:23 +01:00
hw_breakpoint.c arm64: Blacklist non-kprobe-able symbol 2016-07-19 15:03:20 +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 arm64: kprobes instruction simulation support 2016-07-19 15:03:21 +01:00
io.c
irq.c
jump_label.c
kaslr.c arm64: relocatable: deal with physically misaligned kernel images 2016-04-26 12:23:28 +01:00
kgdb.c arm64: Blacklist non-kprobe-able symbol 2016-07-19 15:03:20 +01:00
kuser32.S
machine_kexec.c arm64/kexec: Add pr_debug output 2016-06-27 16:31:26 +01:00
Makefile Merge branch 'for-next/kprobes' into for-next/core 2016-07-21 18:20:41 +01:00
module-plts.c arm64: add support for module PLTs 2016-02-24 14:57:24 +00:00
module.c arm64: add support for kernel ASLR 2016-02-24 14:57:27 +00:00
module.lds arm64: add support for module PLTs 2016-02-24 14:57:24 +00:00
paravirt.c
pci.c arm64, numa: Add NUMA support for arm64 platforms. 2016-04-15 18:06:09 +01: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: perf: don't expose CHAIN event in sysfs 2016-04-25 15:05:24 +01:00
perf_regs.c
process.c exit_thread: remove empty bodies 2016-05-20 17:58:30 -07:00
psci.c
ptrace.c arm64: Add HAVE_REGS_AND_STACK_ACCESS_API feature 2016-07-19 15:03:18 +01:00
relocate_kernel.S arm64/kexec: Add core kexec support 2016-06-27 16:31:25 +01:00
return_address.c
setup.c arm64: mm: fix location of _etext 2016-06-27 18:21:27 +01:00
signal32.c arm64: Fix misspellings in comments. 2016-03-04 18:19:17 +00:00
signal.c arm64: Rework valid_user_regs 2016-03-02 15:49:28 +00:00
sleep.S arm64: Change cpu_resume() to enable mmu early then access sleep_sp by va 2016-04-28 12:05:46 +01:00
smccc-call.S
smp_spin_table.c arm64: spin-table: add missing of_node_put() 2016-04-20 10:35:15 +01:00
smp.c arm64: Honor nosmp kernel command line option 2016-07-21 16:48:37 +01:00
stacktrace.c
suspend.c arm64: Change cpu_resume() to enable mmu early then access sleep_sp by va 2016-04-28 12:05:46 +01:00
sys32.c
sys_compat.c
sys.c arm64: compat: Check for AArch32 state 2016-04-20 12:22:42 +01:00
time.c
topology.c
trace-events-emulation.h
traps.c arm64: trap userspace "dc cvau" cache operation on errata-affected core 2016-07-01 11:46:00 +01:00
vdso.c arm64: Add support for CLOCK_MONOTONIC_RAW in clock_gettime() vDSO 2016-07-12 16:06:32 +01:00
vmlinux.lds.S arm64: relocatable: suppress R_AARCH64_ABS64 relocations in vmlinux 2016-07-29 10:45:01 +01:00