MIPS: MSA: Fix a link error on `_init_msa_upper' with older GCC
commit9a4687f43ea206028babf56e191383c8d3ee04c7
authorMaciej W. Rozycki <macro@imgtec.com>
Tue, 17 May 2016 05:12:27 +0000 (17 06:12 +0100)
committerSasha Levin <sasha.levin@oracle.com>
Mon, 6 Jun 2016 23:11:06 +0000 (6 19:11 -0400)
tree2cd56efc43df8ec4433f8cf23db64e30cb0047cd
parentcf2e0092c579a29686fafb3c9acd7bcae57a0237
MIPS: MSA: Fix a link error on `_init_msa_upper' with older GCC

[ Upstream commit e49d38488515057dba8f0c2ba4cfde5be4a7281f ]

Fix a build regression from commit c9017757c532 ("MIPS: init upper 64b
of vector registers when MSA is first used"):

arch/mips/built-in.o: In function `enable_restore_fp_context':
traps.c:(.text+0xbb90): undefined reference to `_init_msa_upper'
traps.c:(.text+0xbb90): relocation truncated to fit: R_MIPS_26 against `_init_msa_upper'
traps.c:(.text+0xbef0): undefined reference to `_init_msa_upper'
traps.c:(.text+0xbef0): relocation truncated to fit: R_MIPS_26 against `_init_msa_upper'

to !CONFIG_CPU_HAS_MSA configurations with older GCC versions, which are
unable to figure out that calls to `_init_msa_upper' are indeed dead.
Of the many ways to tackle this failure choose the approach we have
already taken in `thread_msa_context_live'.

[ralf@linux-mips.org: Drop patch segment to junk file.]

Signed-off-by: Maciej W. Rozycki <macro@imgtec.com>
Cc: stable@vger.kernel.org # v3.16+
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/13271/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
arch/mips/include/asm/msa.h
arch/mips/kernel/traps.c