ARM: 8971/1: replace the sole use of a symbol with its definition
authorJian Cai <caij2003@gmail.com>
Wed, 29 Apr 2020 00:20:11 +0000 (01:20 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Wed, 29 Apr 2020 12:30:20 +0000 (13:30 +0100)
commita780e485b5768e78aef087502499714901b68cc4
treea960cd6ad4ed65de49565cd98a672e8b42abd879
parent7ae4a78daacf240a8247cde73337dc4b26d253da
ARM: 8971/1: replace the sole use of a symbol with its definition

ALT_UP_B macro sets symbol up_b_offset via .equ to an expression
involving another symbol. The macro gets expanded twice when
arch/arm/kernel/sleep.S is assembled, creating a scenario where
up_b_offset is set to another expression involving symbols while its
current value is based on symbols. LLVM integrated assembler does not
allow such cases, and based on the documentation of binutils, "Values
that are based on expressions involving other symbols are allowed, but
some targets may restrict this to only being done once per assembly", so
it may be better to avoid such cases as it is not clearly stated which
targets should support or disallow them. The fix in this case is simple,
as up_b_offset has only one use, so we can replace the use with the
definition and get rid of up_b_offset.

 Link:https://github.com/ClangBuiltLinux/linux/issues/920

Reviewed-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Jian Cai <caij2003@gmail.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
arch/arm/include/asm/assembler.h