llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

arch/arm/kernel/sleep.S:149:20: error: invalid reassignment of non-absolute variable 'up_b_offset' in '.equ' directive

Open jcai19 opened this issue 6 years ago • 1 comments

Bugzilla Link 45248
Resolution FIXED
Resolved on Dec 17, 2020 16:58
Version trunk
OS All

Extended Description

Building arch/arm/kernel/sleep.S in linux kernel for ARM with integrated assembler ended up with the following assertion failure:

arch/arm/kernel/sleep.S:149:20: error: invalid reassignment of non-absolute variable 'up_b_offset' in '.equ' directive .equ up_b_offset, 1f - 9998b ; .pushsection ".alt.smp.init", "a" ; .long 9998b ; b . + up_b_offset ; .popsection

I was able to reduce the code to as follows, using X86 assembly,

$ cat repro.s 0: .equ x, 1f - 0b ; jmp . + x ; 1:

$ llvm-mc -triple i386 repro.s -filetype=obj -o /dev/null

repro.s:5:9: error: invalid reassignment of non-absolute variable 'x' in '.equ' directive .equ x, 0xff ;

$ gcc -c repro.s $ echo $? 0

jcai19 avatar Mar 19 '20 03:03 jcai19

Fixed on Linux https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a780e485b5768e78aef087502499714901b68cc4

jcai19 avatar Dec 18 '20 00:12 jcai19