Replace
.word platform_normal_stacks
with
adrp x0, platform_normal_stacks

Regards.

Alexei.



From: Olivier Deprez <Olivier.Deprez@arm.com>
Sent: 30 July 2020 14:17
To: tf-a@lists.trustedfirmware.org <tf-a@lists.trustedfirmware.org>; Alexei Fedorov <Alexei.Fedorov@arm.com>
Subject: Re: [TF-A] Linker error on integration branch for FVP with ENABLE_PIE
 
Hi Raghu,

On the toolchain question you would normally use CROSS_COMPILE=aarch64-none-elf- as recommended here: https://trustedfirmware-a.readthedocs.io/en/latest/getting_started/initial-build.html#performing-an-initial-build
However this does not seem to be the root cause of the problem you report.

I reproduce the build issue, however it's not yet clear to me if this platform_normal_stacks variable should be rather placed in a specific section (.data?), rather than embedded in the code. Tbc.

Regards,
Olivier.


________________________________________
From: TF-A <tf-a-bounces@lists.trustedfirmware.org> on behalf of Alexei Fedorov via TF-A <tf-a@lists.trustedfirmware.org>
Sent: 30 July 2020 14:53
To: tf-a@lists.trustedfirmware.org
Subject: Re: [TF-A] Linker error on integration branch for FVP with ENABLE_PIE

Is it a copy/paste typo?
CTX_INCLUDE_EL2)REGS

Regards.
Alexei
________________________________
From: TF-A <tf-a-bounces@lists.trustedfirmware.org> on behalf of Raghu Krishnamurthy via TF-A <tf-a@lists.trustedfirmware.org>
Sent: 30 July 2020 02:44
To: tf-a@lists.trustedfirmware.org <tf-a@lists.trustedfirmware.org>
Subject: [TF-A] Linker error on integration branch for FVP with ENABLE_PIE


When I compile TF-A code on the integration branch with the ENABLE_PIE=1 option for FVP, I get a linker error “./build/fvp/debug/bl31/platform_mp_stack.o: relocation R_AARCH64_ABS32 against `a local symbol' can not be used when making a shared object". It appears to be related to line 62(.word platform_normal_stack) of plat/common/aarch64/platform_mp_stack.S that was introduced by https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/4301 . It looks like the linker is having trouble resolving this symbol for which I cant find a use for.

If I remove line 62 or set ENABLE_PIE=0, the below command line to compile succeeds. What is the use of line 62 in the file? Seems like it may have some use in other configurations that are not obvious. Or is the issue due to the toolchain I’m using? See gcc version below.



Command line I’m using:

make CROSS_COMPILE=aarch64-none-linux-gnu- TRUSTED_BOARD_BOOT=1 GENERATE_COT=1 DEBUG=1 LOG_LEVEL=40 MBEDTLS_DIR=../mbed-tls PLAT=fvp ARM_ROTPK_LOCATION=regs CTX_INCLUDE_PAUTH_REGS=1 CTX_INCLUDE_EL2)REGS=1 ARM_ARCH_MINOR=5 ENABLE_PIE=1 BRANCH_PROTECTION=1 FVP_HW_CONFIG_DTS=fdts/fvp-base-gicv3-psci-1t.dts BL33=<path_to_bl33> all fip



Compiler version: aarch64-none-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10)) 9.2.1 20191025



Thanks

Raghu