25 lines · plain
1// REQUIRES: x862// RUN: llvm-mc %s -o %t.o -triple i386-pc-linux-code16 -filetype=obj3 4// RUN: echo ".global foo; foo = 0x10202" > %t1.s5// RUN: llvm-mc %t1.s -o %t1.o -triple i386-pc-linux -filetype=obj6// RUN: echo ".global foo; foo = 0x10203" > %t2.s7// RUN: llvm-mc %t2.s -o %t2.o -triple i386-pc-linux -filetype=obj8 9// RUN: ld.lld --image-base=0x200 -Ttext 0x200 %t.o %t1.o -o %t110// RUN: llvm-objdump -d --no-show-raw-insn --triple=i386-pc-linux-code16 %t1 | FileCheck %s11 12// CHECK: Disassembly of section .text:13// CHECK-EMPTY:14// CHECK-NEXT: <_start>:15// CHECK-NEXT: 200: jmp 0x20216// 0x10202 - 0x203 == 0xffff17 18// RUN: not ld.lld --image-base=0x200 -Ttext 0x200 %t.o %t2.o -o /dev/null 2>&1 | FileCheck --check-prefix=ERR %s19 20// ERR: {{.*}}:(.text+0x1): relocation R_386_PC16 out of range: 65536 is not in [-65536, 65535]; references 'foo'21 22 .global _start23_start:24 jmp foo25