llvm-project/lld/test/core/pass-got-basic.objtxt

83 lines
2.5 KiB
Plaintext

# 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: ...