Skip to content

Commit a0bf403

Browse files
committed
asm-tests/i386-pc: Check that movl is 5 bytes.
LLVM 3.9 now emits short form of jump instructions, but it is still using 32 bit addresses for some movl instructions. Fortunately it was caught early: clang ... boot/i386/pc/boot.S clang -cc1as: fatal error: error in backend: invalid .org offset '440' (at offset '441') Add additional check to catch it during configure run and force -no-integrated-as. Closes: 49200 More details in https://lists.gnu.org/archive/html/grub-devel/2015-02/msg00099.html https://llvm.org/bugs/show_bug.cgi?id=22662
1 parent 4e0f8f6 commit a0bf403

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

asm-tests/i386-pc.S

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
/* on x86 old clang doesn't support .code16
22
newer clang supports it but creates 6-byte jumps instead of 3-byte ones
3-
which makes us go over boot sector size. */
3+
which makes us go over boot sector size.
4+
Starting with 3.9 clang emits 3-byte jumps but still creates 8-bytes movl
5+
instead of 5-bytes, so code overflows into data. */
46

57
.code16
68
jmp far
79
.org 4
810
jmp nearer
911
.org 6
12+
movl nearer, %ebx
13+
.org 11
1014
.space 100
1115
nearer:
1216
.space 200

0 commit comments

Comments
 (0)