2015-09-22 03:30:11 +08:00
|
|
|
// Test that relocation of local symbols is working.
|
|
|
|
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
|
2015-11-18 14:11:01 +08:00
|
|
|
// RUN: ld.lld %t -o %t2
|
2015-09-22 03:30:11 +08:00
|
|
|
// RUN: llvm-objdump -s -d %t2 | FileCheck %s
|
|
|
|
// REQUIRES: x86
|
|
|
|
|
|
|
|
|
|
|
|
.global _start
|
|
|
|
_start:
|
|
|
|
call lulz
|
|
|
|
|
|
|
|
.zero 4
|
|
|
|
lulz:
|
|
|
|
|
|
|
|
.section .text2,"ax",@progbits
|
|
|
|
R_X86_64_32:
|
|
|
|
movl $R_X86_64_32, %edx
|
|
|
|
|
|
|
|
// FIXME: this would be far more self evident if llvm-objdump printed
|
|
|
|
// constants in hex.
|
|
|
|
// CHECK: Disassembly of section .text2:
|
|
|
|
// CHECK-NEXT: R_X86_64_32:
|
2015-10-11 07:25:39 +08:00
|
|
|
// CHECK-NEXT: 11009: {{.*}} movl $69641, %edx
|
2015-09-22 03:30:11 +08:00
|
|
|
|
|
|
|
.section .R_X86_64_32S,"ax",@progbits
|
|
|
|
R_X86_64_32S:
|
|
|
|
movq lulz - 0x100000, %rdx
|
|
|
|
|
|
|
|
// CHECK: Disassembly of section .R_X86_64_32S:
|
|
|
|
// CHECK-NEXT: R_X86_64_32S:
|
2015-10-11 07:25:39 +08:00
|
|
|
// CHECK-NEXT: {{.*}}: {{.*}} movq -978935, %rdx
|
2015-09-22 03:30:11 +08:00
|
|
|
|
|
|
|
.section .R_X86_64_64,"a",@progbits
|
|
|
|
R_X86_64_64:
|
|
|
|
.quad R_X86_64_64
|
|
|
|
|
|
|
|
// CHECK: Contents of section .R_X86_64_64:
|
2015-11-25 02:48:16 +08:00
|
|
|
// CHECK-NEXT: 10120 20010100 00000000
|