This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [AARCH64] Disable pc relative literal load irrespective of TARGET_FIX_ERR_A53_84341
- From: Kugan Vivekanandarajah <kugan dot vivekanandarajah at linaro dot org>
- To: Ramana Radhakrishnan <ramana dot radhakrishnan at foss dot arm dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, James Greenhalgh <james dot greenhalgh at arm dot com>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>
- Date: Wed, 28 Jun 2017 11:02:45 +1000
- Subject: Re: [AARCH64] Disable pc relative literal load irrespective of TARGET_FIX_ERR_A53_84341
- Authentication-results: sourceware.org; auth=none
- References: <CAELXzTMS9eHrcQ5SxXq4CuipBX4hgqrcYXapSxnAwanXL0AWqA@mail.gmail.com> <752a2d93-0641-134f-33dd-bc550618f7f3@foss.arm.com>
Hi Ramana,
On 27 June 2017 at 18:01, Ramana Radhakrishnan
<ramana.radhakrishnan@foss.arm.com> wrote:
> On 27/06/17 02:20, Kugan Vivekanandarajah wrote:
>>
>> https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00614.html added this
>> workaround to get kernel building with when TARGET_FIX_ERR_A53_843419
>> is enabled.
>>
>> This was added to support building kernel loadable modules. In kernel,
>> when CONFIG_ARM64_ERRATUM_843419 is selected, the relocation needed
>> for ADRP/LDR (R_AARCH64_ADR_PREL_PG_HI21 and
>> R_AARCH64_ADR_PREL_PG_HI21_NC are removed from the kernel to avoid
>> loading objects with possibly offending sequence). Thus, it could only
>> support pc relative literal loads.
>>
>> However, the following patch was posted to kernel to add
>> -mpc-relative-literal-loads
>> http://www.spinics.net/lists/arm-kernel/msg476149.html
>>
>> -mpc-relative-literal-loads is unconditionally added to the kernel
>> build as can be seen from:
>> https://github.com/torvalds/linux/blob/master/arch/arm64/Makefile
>>
>> Therefore this patch removes the hunk so that applications like
>> SPECcpu2017's 521/621.wrf can be built (with LTO in this case) without
>> -mno-pc-relative-literal-loads
>
>
> Is that because your compiler has defaulted to -mpc-relative-literal-loads
> because it has the workaround enabled by default ? I'm curious as to why
> others haven't seen this issue.
>
If TARGET_FIX_ERR_A53_843419 is selected, compiler defaults to
-mpc-relative-literal-loads unless we explicitly specify
-mno-pc-relative-literal-loads. Linaro toolchain is built with
TARGET_FIX_ERR_A53_843419.
This linking of TARGET_FIX_ERR_A53_843419 and
-mpc-relative-literal-loads should now be relaxed since the kernel
explicitly uses -mpc-relative-literal-loads.
This 1MiB issue should be very rarely seen even before you fixed it.
Thanks,
Kugan
> regards
> Ramana