arch/x86/entry/entry_64_compat.S: Assertion `OS.tell() - Start == Layout.getSectionAddressSize(Sec)' failed
| Bugzilla Link | 45190 |
| Resolution | FIXED |
| Resolved on | Mar 23, 2020 11:44 |
| Version | trunk |
| OS | All |
| CC | @RKSimon |
| Fixed by commit(s) | rG6a38e0e4f518 |
Extended Description
Building above file in the linux kernel triggered the assertion failure. The reason is due to the following code pattern
$ cat bad.s .macro ALTERNATIVE newinstr .skip 144f-143f,0x0 .pushsection .altinstr_replacement,"ax" 143: \newinstr 144: .popsection .endm
.section .entry.text, "ax" ALTERNATIVE "jmp .Lint80_keep_stack" .Lint80_keep_stack:
$ gcc -c bad.s $ echo $? 0
The fix has been accepted and submitted upstream.
Proposed fix: https://reviews.llvm.org/D76114
The reason is when the jump instruction gets relaxed, the evaluation of 144f-143f changed in the example. However, the offsets of the fragments following the FT_Fill fragment enclosing .skip directive are not updated.
assigned to @jcai19