• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -S --sr - | FileCheck  %s
2
3// Test that we produce the correct relocation.
4
5        loope   0                 # R_X86_64_PC8
6        jmp     -256              # R_X86_64_PC32
7        .word 0x42 - .            # R_X86_64_PC16
8
9// CHECK:        Section {
10// CHECK:          Index:
11// CHECK:          Name: .rela.text
12// CHECK-NEXT:     Type: SHT_RELA
13// CHECK-NEXT:     Flags [
14// CHECK-NEXT:     ]
15// CHECK-NEXT:     Address: 0x0
16// CHECK-NEXT:     Offset:
17// CHECK-NEXT:     Size:
18// CHECK-NEXT:     Link:
19// CHECK-NEXT:     Info:
20// CHECK-NEXT:     AddressAlignment: 8
21// CHECK-NEXT:     EntrySize: 24
22// CHECK-NEXT:     Relocations [
23// CHECK-NEXT:       0x1 R_X86_64_PC8 - 0xFFFFFFFFFFFFFFFF
24// CHECK-NEXT:       0x3 R_X86_64_PC32 - 0xFFFFFFFFFFFFFEFC
25// CHECK-NEXT:       0x7 R_X86_64_PC16 - 0x42
26// CHECK-NEXT:     ]
27// CHECK-NEXT:   }
28