brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 114c7bf Raw
55 lines · plain
1# REQUIRES: mips2# Check R_MIPS_CALL_HI16 / R_MIPS_CALL_LO16 relocations calculation.3 4# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o5# RUN: ld.lld %t.o -shared -o %t.so6# RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t.so | FileCheck %s7# RUN: llvm-readelf -r -s -A %t.so | FileCheck -check-prefix=GOT %s8 9# CHECK:      Disassembly of section .text:10# CHECK-EMPTY:11# CHECK-NEXT: <foo>:12# CHECK-NEXT:    {{.*}}:  lui  $2, 013# CHECK-NEXT:    {{.*}}:  lw   $2, -32736($2)14# CHECK-NEXT:    {{.*}}:  lui  $2, 015# CHECK-NEXT:    {{.*}}:  lw   $2, -32744($2)16# CHECK-NEXT:    {{.*}}:  lui  $2, 017# CHECK-NEXT:    {{.*}}:  lw   $2, -32740($2)18 19# GOT: There are no relocations in this file.20 21# GOT: Symbol table '.symtab'22# GOT: {{.*}}:  [[LOC1:[0-9a-f]+]]  {{.*}} loc123# GOT: {{.*}}:  [[LOC2:[0-9a-f]+]]  {{.*}} loc224 25# GOT:      Primary GOT:26# GOT-NEXT:  Canonical gp value:27# GOT-EMPTY:28# GOT-NEXT:  Reserved entries:29# GOT-NEXT:    Address     Access  Initial Purpose30# GOT-NEXT:   {{.*}} -32752(gp) 00000000 Lazy resolver31# GOT-NEXT:   {{.*}} -32748(gp) 80000000 Module pointer (GNU extension)32# GOT-EMPTY:33# GOT-NEXT:  Local entries:34# GOT-NEXT:    Address     Access  Initial35# GOT-NEXT:   {{.*}} -32744(gp) [[LOC1]]36# GOT-NEXT:   {{.*}} -32740(gp) [[LOC2]]37# GOT-EMPTY:38# GOT-NEXT:  Global entries:39# GOT-NEXT:    Address     Access  Initial Sym.Val. Type    Ndx Name40# GOT-NEXT:   {{.*}} -32736(gp) 00000000 00000000 NOTYPE  UND bar41 42  .text43  .global foo44foo:45  lui   $2, %call_hi(bar)46  lw    $2, %call_lo(bar)($2)47  lui   $2, %call_hi(loc1)48  lw    $2, %call_lo(loc1)($2)49  lui   $2, %call_hi(loc2)50  lw    $2, %call_lo(loc2)($2)51loc1:52  nop53loc2:54  nop55