• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# REQUIRES: mips
2# Check assigning STO_MIPS_PLT flag to symbol needs a pointer equality.
3
4# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
5# RUN:         %S/Inputs/mips-dynamic.s -o %t.so.o
6# RUN: ld.lld %t.so.o -shared -o %t.so
7# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
8# RUN: ld.lld %t.o %t.so -o %t.exe
9# RUN: llvm-readobj --dyn-syms -A %t.exe | FileCheck %s
10
11# CHECK:      Symbol {
12# CHECK:        Name: foo0
13# CHECK-NEXT:   Value: 0x0
14# CHECK-NEXT:   Size: 0
15# CHECK-NEXT:   Binding: Global
16# CHECK-NEXT:   Type: Function
17# CHECK-NEXT:   Other: 0
18# CHECK-NEXT:   Section: Undefined
19# CHECK-NEXT: }
20# CHECK-NEXT: Symbol {
21# CHECK-NEXT:   Name: foo1
22# CHECK-NEXT:   Value: 0x[[FOO1:[0-9A-F]+]]
23# CHECK-NEXT:   Size: 0
24# CHECK-NEXT:   Binding: Global
25# CHECK-NEXT:   Type: Function
26# CHECK-NEXT:   Other [ (0x8)
27# CHECK-NEXT:     STO_MIPS_PLT
28# CHECK-NEXT:   ]
29# CHECK-NEXT:   Section: Undefined
30# CHECK-NEXT: }
31
32# CHECK:      Primary GOT {
33# CHECK:        Local entries [
34# CHECK-NEXT:   ]
35# CHECK-NEXT:   Global entries [
36# CHECK-NEXT:   ]
37# CHECK:      PLT GOT {
38# CHECK:        Entries [
39# CHECK-NEXT:     Entry {
40# CHECK-NEXT:       Address:
41# CHECK-NEXT:       Initial:
42# CHECK-NEXT:       Value: 0x0
43# CHECK-NEXT:       Type: Function
44# CHECK-NEXT:       Section: Undefined
45# CHECK-NEXT:       Name: foo0
46# CHECK-NEXT:     }
47# CHECK-NEXT:     Entry {
48# CHECK-NEXT:       Address:
49# CHECK-NEXT:       Initial:
50# CHECK-NEXT:       Value: 0x[[FOO1]]
51# CHECK-NEXT:       Type: Function
52# CHECK-NEXT:       Section: Undefined
53# CHECK-NEXT:       Name: foo1
54# CHECK-NEXT:     }
55# CHECK-NEXT:   ]
56
57  .text
58  .globl __start
59__start:
60  jal    foo0               # R_MIPS_26 against 'foo0' from DSO
61  lui    $t0,%hi(foo1)      # R_MIPS_HI16/LO16 against 'foo1' from DSO
62  addi   $t0,$t0,%lo(foo1)
63
64loc:
65  nop
66