linux-stable/arch/arm64
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
..
boot arm64: localise Image objcopy flags 2016-07-19 15:30:23 +01:00
configs arm64/kexec: Enable kexec in the arm64 defconfig 2016-06-27 16:31:25 +01:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2016-03-17 11:22:54 -07:00
include arm64: arm: Fix-up the removal of the arm64 regs_query_register_name() prototype 2016-07-27 08:15:42 +01:00
kernel arm64: relocatable: suppress R_AARCH64_ABS64 relocations in vmlinux 2016-07-29 10:45:01 +01:00
kvm arm64/kvm: use ESR_ELx_EC to extract EC 2016-06-21 17:07:38 +01:00
lib arm64: kasan: instrument user memory access API 2016-06-21 15:37:18 +01:00
mm arm64: mm: run pgtable_page_ctor() on non-swapper translation table pages 2016-07-25 17:43:36 +01:00
net bpf: arm64: remove callee-save registers use for tmp registers 2016-05-17 14:03:33 -04:00
xen xen/arm: introduce HYPERVISOR_platform_op on arm and arm64 2015-12-21 14:40:56 +00:00
Kconfig arm64: Only select ARM64_MODULE_PLTS if MODULES=y 2016-07-27 00:20:32 +01:00
Kconfig.debug arm64: enable CONFIG_SET_MODULE_RONX by default 2016-05-31 14:23:29 +01:00
Kconfig.platforms ARM: SoC 64-bit changes for v4.7 2016-05-18 12:43:08 -07:00
Makefile arm64: relocatable: suppress R_AARCH64_ABS64 relocations in vmlinux 2016-07-29 10:45:01 +01:00