Bug 1994 - [5 Regression] linux-4.3 build on aarch64-linux-gnu: unsupported RELA relocation: 275
Summary: [5 Regression] linux-4.3 build on aarch64-linux-gnu: unsupported RELA relocat...
Status: RESOLVED FIXED
Alias: None
Product: GCC
Classification: Unclassified
Component: General (show other bugs)
Version: Linaro GCC 5
Hardware: All Linux
: --- major
Target Milestone: ---
Assignee: Christophe Lyon
URL: https://gcc.gnu.org/bugzilla/show_bug...
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-15 19:16 UTC by doko
Modified: 2016-04-22 20:28 UTC (History)
5 users (show)

See Also:
Linux kernel version:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description doko 2016-01-15 19:16:51 UTC
seen on aarch64-linux-gnu building the linux-4.3 kernel, with both 2015.12 and 2016.01.  details at

  https://launchpad.net/bugs/1533009

confirmed that the gcc-5 fsf branch builds the kernel fine. The LP issue will be updated with a kernel config to reproduce.
Comment 1 doko 2016-01-16 10:18:55 UTC
the diff of the generated asm changed with

 - the .cpu omission:

commit be09330da9d0777c4a58568d137e3f8a3dbe0a0b


        gcc/
        Backport from trunk r226558.
        2015-08-04  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>


 - the progbits changes:

commit da216a29cb73967885035c64308db95e353a167e
Author: Yvan Roux <yvan.roux@linaro.org>
Date:   Fri Oct 30 13:53:11 2015 +0100

        gcc/
        Backport from trunk r228390.
        2015-10-02  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
    
        * config/aarch64/aarch64.c (aarch64_elf_asm_named_section): Delete.
        (TLS_SECTION_ASM_FLAG): Delete.
    
        gcc/
        Backport from trunk r228397.
        2015-10-02  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
    
        * config/aarch64/aarch64-elf.h (TARGET_ASM_NAMED_SECTION): Delete.
    
    Change-Id: I6091ea000fd93e0812497a5319d4c632be39ad0c
Comment 2 Christophe Lyon 2016-01-18 15:19:02 UTC
I'm able to reproduce the difference mentioned in launchpad (.cpu omission), but I'm not sure how it related to the rest of the bug report, which indicates a link with -mcmodel=large. This option is not used in the attachment used to reproduce the .cpu omission, so it may be irrelevant.
Comment 3 Christophe Lyon 2016-01-21 10:12:25 UTC
I'm following up this on launchpad.
Comment 4 Christophe Lyon 2016-01-21 10:35:56 UTC
I've also updated https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63304
Comment 5 Christophe Lyon 2016-01-21 10:38:18 UTC
This message provides background on the kernel a53 erratum workaround:
http://www.spinics.net/lists/arm-kernel/msg445346.html

And this discusses the main patch we have backported:
https://gcc.gnu.org/ml/gcc-patches/2015-07/msg02258.html
Comment 6 Christophe Lyon 2016-01-26 22:59:32 UTC
I have posted a GCC patch:
https://gcc.gnu.org/ml/gcc-patches/2016-01/msg01986.html
to change the default of -mpc-relative-literal-loads when -mfix-cortex-a53-843419 is used.
Comment 7 Christophe Lyon 2016-03-10 13:32:32 UTC
Fixed in trunk at r234108.
Comment 8 Christophe Lyon 2016-03-25 21:28:18 UTC
Backported and available in our 5.3-2016.03 snapshot.
Comment 9 Naresh Kamboju 2016-04-17 08:44:29 UTC
Hi Team,

I do not see 5.3-2016.03 snapshot in release page.
Is this fix released ?
I would like to use pre-built binary toolchain.
Any help is appreciated.

I still see this bug when i compiler kernel module and insert with 5.3.1 tool chain.

Error log:
----------
root@genericarmv8:~# insmod test_kasan.ko 
module test_kasan: unsupported RELA relocation: 275
insmod: ERROR: could not insert module test_kasan.ko: Invalid module format
root@genericarmv8:~# cat /proc/version 
Linux version 4.1.21+ (root@kernel) (gcc version 5.3.1 20160113 (Linaro GCC 5.3-2016.02) ) #10 SMP PREEMPT Thu Apr 14 23:34:28 IST 2016
root@genericarmv8:~#

Ref:
Working on Kernel Ticket for testing KASAN.
https://projects.linaro.org/browse/TICKET-309
Comment 10 Christophe Lyon 2016-04-22 20:28:18 UTC
(In reply to Naresh Kamboju from comment #9)
> Hi Team,
> 
> I do not see 5.3-2016.03 snapshot in release page.
> Is this fix released ?
> I would like to use pre-built binary toolchain.
It's a snapshot, not a release.
It's available from snapshots.linaro.org (http://snapshots.linaro.org/components/toolchain/gcc-linaro/)
but only in source form

> Any help is appreciated.
> 
> I still see this bug when i compiler kernel module and insert with 5.3.1
> tool chain.
> 
> Error log:
> ----------
> root@genericarmv8:~# insmod test_kasan.ko 
> module test_kasan: unsupported RELA relocation: 275
> insmod: ERROR: could not insert module test_kasan.ko: Invalid module format
> root@genericarmv8:~# cat /proc/version 
> Linux version 4.1.21+ (root@kernel) (gcc version 5.3.1 20160113 (Linaro GCC
> 5.3-2016.02) ) #10 SMP PREEMPT Thu Apr 14 23:34:28 IST 2016
> root@genericarmv8:~#
> 
> Ref:
> Working on Kernel Ticket for testing KASAN.
> https://projects.linaro.org/browse/TICKET-309


Until our next 5.x release is available, maybe you can try to modify
the kernel Makefile as I suggested in comment #24 of:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1533009

This change (or a very similar one) has been integrated in the kernel mainline sources too.