brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 2df535c Raw
62 lines · plain
1// REQUIRES: x862// RUN: llvm-mc -filetype=obj -triple=i686-pc-linux %s -o %t.o3// RUN: llvm-mc -filetype=obj -triple=i686-pc-linux %p/Inputs/relocation-copy.s -o %t2.o4// RUN: ld.lld -shared %t2.o -soname=t.so -o %t.so5// RUN: ld.lld -e main %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.globl main11.align 16, 0x9012.type main,@function13main:14movl $5, x15movl $7, y16movl $9, z17 18// CHECK:      Name: .bss19// CHECK-NEXT:  Type: SHT_NOBITS20// CHECK-NEXT:  Flags [21// CHECK-NEXT:   SHF_ALLOC22// CHECK-NEXT:   SHF_WRITE23// CHECK-NEXT:  ]24// CHECK-NEXT:  Address:  0x40327025// CHECK-NEXT:  Offset:26// CHECK-NEXT:  Size: 2427// CHECK-NEXT:  Link: 028// CHECK-NEXT:  Info: 029// CHECK-NEXT:  AddressAlignment: 1630// CHECK-NEXT:  EntrySize: 031 32// CHECK:      Relocations [33// CHECK-NEXT:   Section ({{.*}}) .rel.dyn {34// CHECK-NEXT:     Relocation {35// CHECK-NEXT:       Offset:36// CHECK-NEXT:       Type: R_386_COPY37// CHECK-NEXT:       Symbol: x38// CHECK-NEXT:     }39// CHECK-NEXT:     Relocation {40// CHECK-NEXT:       Offset:41// CHECK-NEXT:       Type: R_386_COPY42// CHECK-NEXT:       Symbol: y43// CHECK-NEXT:     }44// CHECK-NEXT:     Relocation {45// CHECK-NEXT:       Offset:46// CHECK-NEXT:       Type: R_386_COPY47// CHECK-NEXT:       Symbol: z48// CHECK-NEXT:     }49// CHECK-NEXT:   }50// CHECK-NEXT: ]51 52// 16 is alignment here53// CODE: Disassembly of section .text:54// CODE-EMPTY:55// CODE-NEXT: <main>:56/// .bss + 0 = 0x40327057// CODE-NEXT: 4011f0:       movl $0x5, 0x40327058/// .bss + 16 = 0x403270 + 16 = 0x40328059// CODE-NEXT: 4011fa:       movl $0x7, 0x40328060/// .bss + 20 = 0x403270 + 20 = 0x40328461// CODE-NEXT: 401204:       movl $0x9, 0x40328462