brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · bc8eb59 Raw
66 lines · plain
1// REQUIRES: x862// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o3// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/relocation-copy.s -o %t2.o4// RUN: ld.lld -shared %t2.o -soname=so -o %t.so5// RUN: ld.lld %t.o %t.so -o %t36// RUN: llvm-readobj -S -r --expand-relocs %t3 | FileCheck %s7// RUN: llvm-objdump -d --no-show-raw-insn --print-imm-hex %t3 | FileCheck --check-prefix=CODE %s8 9.text10.global _start11_start:12movl $5, x13movl $7, y14movl $9, z15movl $x, %edx16movl $y, %edx17movl $z, %edx18 19// CHECK:      Name: .bss20// CHECK-NEXT:  Type: SHT_NOBITS (0x8)21// CHECK-NEXT:  Flags [ (0x3)22// CHECK-NEXT:   SHF_ALLOC (0x2)23// CHECK-NEXT:   SHF_WRITE (0x1)24// CHECK-NEXT:  ]25// CHECK-NEXT:  Address: 0x20340026// CHECK-NEXT:  Offset:27// CHECK-NEXT:  Size: 2428// CHECK-NEXT:  Link: 029// CHECK-NEXT:  Info: 030// CHECK-NEXT:  AddressAlignment: 1631// CHECK-NEXT:  EntrySize: 032 33// CHECK:      Relocations [34// CHECK-NEXT:   Section ({{.*}}) .rela.dyn {35// CHECK-NEXT:     Relocation {36// CHECK-NEXT:       Offset:37// CHECK-NEXT:       Type: R_X86_64_COPY38// CHECK-NEXT:       Symbol: x39// CHECK-NEXT:       Addend: 0x040// CHECK-NEXT:     }41// CHECK-NEXT:     Relocation {42// CHECK-NEXT:       Offset:43// CHECK-NEXT:       Type: R_X86_64_COPY44// CHECK-NEXT:       Symbol: y45// CHECK-NEXT:       Addend: 0x046// CHECK-NEXT:     }47// CHECK-NEXT:     Relocation {48// CHECK-NEXT:       Offset:49// CHECK-NEXT:       Type: R_X86_64_COPY50// CHECK-NEXT:       Symbol: z51// CHECK-NEXT:       Addend: 0x052// CHECK-NEXT:     }53// CHECK-NEXT:   }54// CHECK-NEXT: ]55 56// 16 is alignment here57// CODE: Disassembly of section .text:58// CODE-EMPTY:59// CODE-NEXT: <_start>:60// CODE-NEXT:   movl $0x5, 0x20340061// CODE-NEXT:   movl $0x7, 0x20341062// CODE-NEXT:   movl $0x9, 0x20341463// CODE-NEXT:   movl $0x203400, %edx64// CODE-NEXT:   movl $0x203410, %edx65// CODE-NEXT:   movl $0x203414, %edx66