arm64: avoid R_AARCH64_ABS64 relocations for Image header fields
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Sat, 26 Dec 2015 12:48:02 +0000 (13:48 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 24 Feb 2016 14:57:25 +0000 (14:57 +0000)
commit6ad1fe5d9077a1ab40bf74b61994d2e770b00b14
tree88cfed6d43d89bb5e21c7e8ea9c32e54baa88fac
parentfd045f6cd98ec4953147b318418bd45e441e52a3
arm64: avoid R_AARCH64_ABS64 relocations for Image header fields

Unfortunately, the current way of using the linker to emit build time
constants into the Image header will no longer work once we switch to
the use of PIE executables. The reason is that such constants are emitted
into the binary using R_AARCH64_ABS64 relocations, which are resolved at
runtime, not at build time, and the places targeted by those relocations
will contain zeroes before that.

So refactor the endian swapping linker script constant generation code so
that it emits the upper and lower 32-bit words separately.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/assembler.h
arch/arm64/kernel/head.S
arch/arm64/kernel/image.h