summaryrefslogtreecommitdiffstats
path: root/lld/test/pass-got-basic.objtxt
blob: 6f0d4f2bceca2e073a365e58758b6d95132487b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# RUN: lld -core %s --add-pass GOT  | FileCheck %s

#
# Test that GOT pass instantiates GOT entires and alters references
#

---
defined-atoms:
    - name:              foo
      type:              code
      content:           [ 48, 8B, 0D, 00, 00, 00, 00, 
                           48, 8B, 0D, 00, 00, 00, 00, 
                           48, 8B, 0D, 00, 00, 00, 00, 
                           48, 83, 3D, 00, 00, 00, 00, 00,
                           48, 83, 3D, 00, 00, 00, 00, 00, 
                           48, 83, 3D, 00, 00, 00, 00, 00,
                           48, 83, 3D, 00, 00, 00, 00, 00 ]
      references:
      - offset:          3
        kind:            gotLoad32
        target:          malloc
      - offset:          10
        kind:            gotLoad32
        target:          myPrivate
      - offset:          17
        kind:            gotLoad32
        target:          myInterposable
      - offset:          24
        kind:            gotUse32
        target:          malloc
      - offset:          32
        kind:            gotUse32
        target:          myPrivate
      - offset:          40
        kind:            gotUse32
        target:          myInterposable

    - name:              myPrivate
      scope:             global
      interposable:      no

    - name:              myInterposable
      scope:             global
      interposable:      yes

shared-library-atoms:
    - name:              malloc
      load-name:         libc.so
      
...

# CHECK:  defined-atoms:
# CHECK:       name:         foo
# CHECK:       references: 
# CHECK:        kind:         pcrel32
# CHECK:        offset:       3
# CHECK:        target:       L
# CHECK:        kind:         lea32wasGot
# CHECK:        offset:       10
# CHECK:        target:       myPrivate
# CHECK:        kind:         pcrel32
# CHECK:        offset:       17
# CHECK:        target:       L
# CHECK:        kind:         pcrel32
# CHECK:        offset:       24
# CHECK:        target:       L
# CHECK:        kind:         pcrel32
# CHECK:        offset:       32
# CHECK:        target:       L
# CHECK:        kind:         pcrel32
# CHECK:        offset:       40
# CHECK:        target:       L
# CHECK:       name:         myPrivate
# CHECK:       name:         myInterposable
# CHECK:       interposable: yes
# CHECK:       name:         L
# CHECK:       type:         got
# CHECK:       type:         got
# CHECK:       type:         got
# CHECK:   shared-library-atoms:
# CHECK:       name:         malloc
# CHECK:       ...
OpenPOWER on IntegriCloud