2012-04-20 09:24:37 +08:00
|
|
|
# RUN: lld-core %s -got-pass | FileCheck %s
|
2012-03-16 07:36:24 +08:00
|
|
|
|
|
|
|
#
|
|
|
|
# Test that GOT pass instantiates GOT entires and alters references
|
|
|
|
#
|
|
|
|
|
|
|
|
---
|
2013-01-05 10:22:35 +08:00
|
|
|
defined-atoms:
|
2012-03-16 07:36:24 +08:00
|
|
|
- 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 ]
|
2013-01-09 05:12:13 +08:00
|
|
|
references:
|
2012-03-16 07:36:24 +08:00
|
|
|
- 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
|
|
|
|
|
2013-01-05 10:22:35 +08:00
|
|
|
shared-library-atoms:
|
2012-03-16 07:36:24 +08:00
|
|
|
- name: malloc
|
|
|
|
load-name: libc.so
|
|
|
|
|
|
|
|
...
|
|
|
|
|
2013-01-05 10:22:35 +08:00
|
|
|
# CHECK: defined-atoms:
|
2012-03-16 07:36:24 +08:00
|
|
|
# CHECK: name: foo
|
2013-01-09 05:12:13 +08:00
|
|
|
# CHECK: references:
|
2013-01-05 10:22:35 +08:00
|
|
|
# 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
|
2012-03-16 07:36:24 +08:00
|
|
|
# CHECK: name: myPrivate
|
|
|
|
# CHECK: name: myInterposable
|
|
|
|
# CHECK: interposable: yes
|
|
|
|
# CHECK: name: L
|
|
|
|
# CHECK: type: got
|
|
|
|
# CHECK: type: got
|
|
|
|
# CHECK: type: got
|
2013-01-05 10:22:35 +08:00
|
|
|
# CHECK: shared-library-atoms:
|
2012-03-16 07:36:24 +08:00
|
|
|
# CHECK: name: malloc
|
|
|
|
# CHECK: ...
|