Commit fbe5f0e
committed
[X86] Do not use movq in -mcmodel=kernel on an out of range abs global
CFI can lead to some `relocation R_X86_64_32S out of range` errors when
using thinlto. We have an instance of an `inline_bits` alias with a
value of 0x8000008000000001 which cannot fit into a signed 32-bit reloc
hence the error. This reloc is used because the instruction for reading
the alias is `movq` which uses a signed 32-bit immediate. The proper
instruction to use in this instance is `movabs` for the full 64-bit
reloc.
Under the kernel model, a signed 32-bit immediate was always used but if
the target is a global with `absolue_symbol` attached and the range
cannot fit within 32 bits, we should reject the MOV64ri32. The pattern
matching logic will eventually lead to a match for MOV64ri which emits
the `movabs`.1 parent 3f3ffed commit fbe5f0e
File tree
2 files changed
+36
-2
lines changed- llvm
- lib/Target/X86
- test/CodeGen/X86
2 files changed
+36
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1256 | 1256 | | |
1257 | 1257 | | |
1258 | 1258 | | |
1259 | | - | |
1260 | | - | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
1261 | 1273 | | |
1262 | 1274 | | |
1263 | 1275 | | |
| |||
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
0 commit comments