]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/ELF/mips-call-hilo.s
Vendor import of lld trunk r338150:
[FreeBSD/FreeBSD.git] / test / ELF / mips-call-hilo.s
1 # REQUIRES: mips
2 # 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.o
5 # RUN: ld.lld %t.o -shared -o %t.so
6 # RUN: llvm-objdump -d %t.so | FileCheck %s
7 # RUN: llvm-readobj -r -mips-plt-got %t.so | FileCheck -check-prefix=GOT %s
8
9 # CHECK:      Disassembly of section .text:
10 # CHECK-NEXT: foo:
11 # CHECK-NEXT:    10000:       3c 02 00 00     lui     $2, 0
12 # CHECK-NEXT:    10004:       8c 42 80 20     lw      $2, -32736($2)
13 # CHECK-NEXT:    10008:       3c 02 00 00     lui     $2, 0
14 # CHECK-NEXT:    1000c:       8c 42 80 18     lw      $2, -32744($2)
15 # CHECK-NEXT:    10010:       3c 02 00 00     lui     $2, 0
16 # CHECK-NEXT:    10014:       8c 42 80 1c     lw      $2, -32740($2)
17
18 # GOT:      Relocations [
19 # GOT-NEXT: ]
20
21 # GOT:      Primary GOT {
22 # GOT-NEXT:   Canonical gp value: 0x27FF0
23 # GOT:        Local entries [
24 # GOT-NEXT:     Entry {
25 # GOT-NEXT:       Address: 0x20008
26 # GOT-NEXT:       Access: -32744
27 # GOT-NEXT:       Initial: 0x10018
28 # GOT-NEXT:     }
29 # GOT-NEXT:     Entry {
30 # GOT-NEXT:       Address: 0x2000C
31 # GOT-NEXT:       Access: -32740
32 # GOT-NEXT:       Initial: 0x1001C
33 # GOT-NEXT:     }
34 # GOT-NEXT:   ]
35 # GOT-NEXT:   Global entries [
36 # GOT-NEXT:     Entry {
37 # GOT-NEXT:       Address: 0x20010
38 # GOT-NEXT:       Access: -32736
39 # GOT-NEXT:       Initial: 0x0
40 # GOT-NEXT:       Value: 0x0
41 # GOT-NEXT:       Type: None
42 # GOT-NEXT:       Section: Undefined
43 # GOT-NEXT:       Name: bar
44 # GOT-NEXT:     }
45 # GOT-NEXT:   ]
46 # GOT-NEXT:   Number of TLS and multi-GOT entries: 0
47 # GOT-NEXT: }
48
49   .text
50   .global foo
51 foo:
52   lui   $2, %call_hi(bar)
53   lw    $2, %call_lo(bar)($2)
54   lui   $2, %call_hi(loc1)
55   lw    $2, %call_lo(loc1)($2)
56   lui   $2, %call_hi(loc2)
57   lw    $2, %call_lo(loc2)($2)
58 loc1:
59   nop
60 loc2:
61   nop