brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.9 KiB · 618b5c7 Raw
89 lines · plain
1// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -S --sr  - | FileCheck  %s2// RUN: not llvm-mc -filetype=obj -triple x86_64 --defsym ERR=1 %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR --implicit-check-not=error:3 4// Test that we produce the correct relocation.5 6 7        .section	.pr23272,"awG",@progbits,pr23272,comdat8	.globl pr232729pr23272:10pr23272_2:11pr23272_3 = pr23272_212 13        .text14bar:15        movl	$bar, %edx        # R_X86_64_3216        movq	$bar, %rdx        # R_X86_64_32S17        movq	$bar, bar(%rip)   # R_X86_64_32S18        movl	bar, %edx         # R_X86_64_32S19        movq	bar, %rdx         # R_X86_64_32S20.long bar                         # R_X86_64_3221        movabs  $0, %rax22        movabs  $0, %rax23        pushq    $bar24        movq	foo(%rip), %rdx25        leaq    foo-bar(%r14),%r1426        addq	$bar,%rax         # R_X86_64_32S27	.word   foo-bar28	.byte   foo-bar29	call foo30 31        leaq    -1+foo(%rip), %r1132 33        leaq  _GLOBAL_OFFSET_TABLE_(%rax), %r1534        leaq  _GLOBAL_OFFSET_TABLE_(%rip), %r1535        movl  $_GLOBAL_OFFSET_TABLE_, %eax36        movabs  $_GLOBAL_OFFSET_TABLE_, %rax37 38        .long   foo@gotpcrel39        .long foo@plt40 41        .quad	pr23272_2 - pr2327242        .quad	pr23272_3 - pr2327243 44	.global pr2448645pr24486:46	pr24486_alias = pr2448647	.long pr24486_alias48 49        .code1650        call pr2377151 52        .weak weak_sym53weak_sym:54        .long  pr23272-weak_sym55 56// CHECK:        Section {57// CHECK:          Name: .rela.text58// CHECK:          Relocations [59// CHECK-NEXT:       0x1 R_X86_64_32 .text 0x060// CHECK-NEXT:       0x8 R_X86_64_32S .text 0x061// CHECK-NEXT:       0x13 R_X86_64_32S .text 0x062// CHECK-NEXT:       0x1A R_X86_64_32S .text 0x063// CHECK-NEXT:       0x22 R_X86_64_32S .text 0x064// CHECK-NEXT:       0x26 R_X86_64_32 .text 0x065// CHECK-NEXT:       0x3F R_X86_64_32S .text 0x066// CHECK-NEXT:       0x46 R_X86_64_PC32 foo 0xFFFFFFFFFFFFFFFC67// CHECK-NEXT:       0x4D R_X86_64_PC32 foo 0x4D68// CHECK-NEXT:       0x54 R_X86_64_32S .text 0x069// CHECK-NEXT:       0x58 R_X86_64_PC16 foo 0x5870// CHECK-NEXT:       0x5A R_X86_64_PC8 foo 0x5A71// CHECK-NEXT:       0x5C R_X86_64_PLT32 foo 0xFFFFFFFFFFFFFFFC72// CHECK-NEXT:       0x63 R_X86_64_PC32 foo 0xFFFFFFFFFFFFFFFB73// CHECK-NEXT:       0x6A R_X86_64_GOTPC32 _GLOBAL_OFFSET_TABLE_ 0x374// CHECK-NEXT:       0x71 R_X86_64_GOTPC32 _GLOBAL_OFFSET_TABLE_ 0xFFFFFFFFFFFFFFFC75// CHECK-NEXT:       0x76 R_X86_64_GOTPC32 _GLOBAL_OFFSET_TABLE_ 0x176// CHECK-NEXT:       0x7C R_X86_64_GOTPC64 _GLOBAL_OFFSET_TABLE_ 0x277// CHECK-NEXT:       0x84 R_X86_64_GOTPCREL foo 0x078// CHECK-NEXT:       0x88 R_X86_64_PLT32 foo 0x079// CHECK-NEXT:       0x9C R_X86_64_32 .text 0x9C80// CHECK-NEXT:       0xA1 R_X86_64_PC16 pr23771 0xFFFFFFFFFFFFFFFE81// CHECK-NEXT:       0xA3 R_X86_64_PC32 pr23272 0x082// CHECK-NEXT:     ]83// CHECK-NEXT:   }84 85.ifdef ERR86// ERR: [[#@LINE+1]]:7: error: unsupported relocation type87.long foo@gotoff88.endif89