PIE: Use PC relative adrp/adr for symbol reference
This patch fixes up the AArch64 assembly code to use
adrp/adr instructions instead of ldr instruction for
reference to symbols. This allows these assembly
sequences to be Position Independant. Note that the
the reference to sizes have been replaced with
calculation of size at runtime. This is because size
is a constant value and does not depend on execution
address and using PC relative instructions for loading
them makes them relative to execution address. Also
we cannot use `ldr` instruction to load size as it
generates a dynamic relocation entry which must *not*
be fixed up and it is difficult for a dynamic loader
to differentiate which entries need to be skipped.

Change-Id: I8bf4ed5c58a9703629e5498a27624500ef40a836
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
1 parent 3bd17c0 commit f1722b693d363cc6a2b624d59f0442bf845baf62
@Soby Mathew Soby Mathew authored on 12 Oct 2018
Showing 6 changed files
View
bl2/aarch64/bl2_entrypoint.S
View
include/common/aarch64/asm_macros.S
View
include/common/aarch64/el3_common_macros.S
View
include/lib/pmf/pmf_asm_macros.S
View
lib/romlib/init.s
View
lib/xlat_tables_v2/aarch64/enable_mmu.S