diff options
author | Jerome Forissier <jerome@forissier.org> | 2020-05-19 09:54:01 +0200 |
---|---|---|
committer | Jérôme Forissier <jerome@forissier.org> | 2020-05-20 08:32:55 +0200 |
commit | 7fdadfdb9678d1217c6c161116dec8342642fb0b (patch) | |
tree | 40cae6cdc764a9a99b06f45daa1a7a3c15552f7c /core/arch | |
parent | bef33113ac2922f950094f131b4c79a15f89d3a1 (diff) |
core: aslr: suppress R_AARCH64_ABS64 and R_ARM_ABS32 relocations
The following errors were observed when building with GCC 6.2.1:
- 64 bits:
GEN out/arm/core/tee.bin
Unexpected relocation type 0x101
- 32 bits:
GEN out/arm/core/tee.bin
Unexpected relocation type 0x2
Relocation type 0x101 is R_AARCH64_ABS64 and 0x2 is R_ARM_ABS32. The
errors are output by scripts/gen_tee_bin.py which expects only relative
relocations (the ones that are necessary for ASLR).
This patch adds the -Bsymbolic linker option to avoid these
relocations. More information can be found in Linux commit [1].
Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=08cc55b2afd97a654f71b3bebf8bb0ec89fdc498
Signed-off-by: Jerome Forissier <jerome@forissier.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
Diffstat (limited to 'core/arch')
-rw-r--r-- | core/arch/arm/kernel/link.mk | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/arch/arm/kernel/link.mk b/core/arch/arm/kernel/link.mk index 6b057f64..1b89b895 100644 --- a/core/arch/arm/kernel/link.mk +++ b/core/arch/arm/kernel/link.mk @@ -11,7 +11,7 @@ AWK = awk link-ldflags = $(LDFLAGS) ifeq ($(CFG_CORE_ASLR),y) -link-ldflags += -pie -z notext -z norelro $(ldflag-apply-dynamic-relocs) +link-ldflags += -pie -Bsymbolic -z notext -z norelro $(ldflag-apply-dynamic-relocs) endif link-ldflags += -T $(link-script-pp) -Map=$(link-out-dir)/tee.map link-ldflags += --sort-section=alignment |