2017-08-21 01:00:08 +08:00
|
|
|
# RUN: rm -rf %t && mkdir -p %t
|
|
|
|
# RUN: llvm-mc -triple=thumbv7s-apple-ios7.0.0 -filetype=obj -o %t/MachO_Thumb.o %s
|
|
|
|
# RUN: llvm-rtdyld -triple=thumbv7s-apple-ios7.0.0 -verify -check=%s %t/MachO_Thumb.o
|
2017-08-10 04:19:27 +08:00
|
|
|
|
|
|
|
.section __TEXT,__text,regular,pure_instructions
|
|
|
|
.syntax unified
|
|
|
|
|
2018-05-09 09:38:13 +08:00
|
|
|
.globl thumb_caller_thumb_callee
|
|
|
|
.p2align 1
|
|
|
|
.code 16
|
|
|
|
.thumb_func thumb_caller_thumb_callee
|
|
|
|
thumb_caller_thumb_callee:
|
|
|
|
nop
|
2017-08-10 04:19:27 +08:00
|
|
|
|
2018-05-09 09:38:13 +08:00
|
|
|
.globl arm_caller_thumb_callee
|
|
|
|
.p2align 1
|
|
|
|
.code 16
|
|
|
|
.thumb_func arm_caller_thumb_callee
|
|
|
|
arm_caller_thumb_callee:
|
|
|
|
nop
|
2017-08-10 04:19:27 +08:00
|
|
|
|
2018-05-09 09:38:13 +08:00
|
|
|
.globl thumb_caller_arm_callee
|
2017-08-10 04:19:27 +08:00
|
|
|
.p2align 1
|
2018-05-09 09:38:13 +08:00
|
|
|
.code 32
|
|
|
|
thumb_caller_arm_callee:
|
2017-08-10 04:19:27 +08:00
|
|
|
nop
|
|
|
|
|
2018-05-09 09:38:13 +08:00
|
|
|
.globl thumb_caller
|
|
|
|
.p2align 1
|
|
|
|
.code 16
|
|
|
|
.thumb_func thumb_caller
|
|
|
|
thumb_caller:
|
|
|
|
nop
|
|
|
|
|
|
|
|
# Check that stubs for thumb callers use thumb code (not arm), and that thumb
|
|
|
|
# callees have the low bit set on their addresses.
|
2017-08-10 04:19:27 +08:00
|
|
|
#
|
Simplify decoupling between RuntimeDyld/RuntimeDyldChecker, add 'got_addr' util.
This patch reduces the number of functions in the interface between RuntimeDyld
and RuntimeDyldChecker by combining "GetXAddress" and "GetXContent" functions
into "GetXInfo" functions that return a struct describing both the address and
content. The GetStubOffset function is also replaced with a pair of utilities,
GetStubInfo and GetGOTInfo, that fit the new scheme. For RuntimeDyld both of
these functions will return the same result, but for the new JITLink linker
(https://reviews.llvm.org/D58704) these will provide the addresses of PLT stubs
and GOT entries respectively.
For JITLink's use, a 'got_addr' utility has been added to the rtdyld-check
language, and the syntax of 'got_addr' and 'stub_addr' has been changed: both
functions now take two arguments, a 'stub container name' and a target symbol
name. For llvm-rtdyld/RuntimeDyld the stub container name is the object file
name and section name, separated by a slash. E.g.:
rtdyld-check: *{8}(stub_addr(foo.o/__text, y)) = y
For the upcoming llvm-jitlink utility, which creates stubs on a per-file basis
rather than a per-section basis, the container name is just the file name. E.g.:
jitlink-check: *{8}(got_addr(foo.o, y)) = y
llvm-svn: 358295
2019-04-13 02:07:28 +08:00
|
|
|
# rtdyld-check: *{4}(stub_addr(MachO_Thumb.o/__text, thumb_caller_thumb_callee)) = 0xf000f8df
|
|
|
|
# rtdyld-check: *{4}(stub_addr(MachO_Thumb.o/__text, thumb_caller_thumb_callee) + 4) = (thumb_caller_thumb_callee | 0x1)
|
2018-05-09 09:38:13 +08:00
|
|
|
bl thumb_caller_thumb_callee
|
|
|
|
|
|
|
|
# Check that arm callees do not have the low bit set on their addresses.
|
2017-08-10 04:19:27 +08:00
|
|
|
#
|
Simplify decoupling between RuntimeDyld/RuntimeDyldChecker, add 'got_addr' util.
This patch reduces the number of functions in the interface between RuntimeDyld
and RuntimeDyldChecker by combining "GetXAddress" and "GetXContent" functions
into "GetXInfo" functions that return a struct describing both the address and
content. The GetStubOffset function is also replaced with a pair of utilities,
GetStubInfo and GetGOTInfo, that fit the new scheme. For RuntimeDyld both of
these functions will return the same result, but for the new JITLink linker
(https://reviews.llvm.org/D58704) these will provide the addresses of PLT stubs
and GOT entries respectively.
For JITLink's use, a 'got_addr' utility has been added to the rtdyld-check
language, and the syntax of 'got_addr' and 'stub_addr' has been changed: both
functions now take two arguments, a 'stub container name' and a target symbol
name. For llvm-rtdyld/RuntimeDyld the stub container name is the object file
name and section name, separated by a slash. E.g.:
rtdyld-check: *{8}(stub_addr(foo.o/__text, y)) = y
For the upcoming llvm-jitlink utility, which creates stubs on a per-file basis
rather than a per-section basis, the container name is just the file name. E.g.:
jitlink-check: *{8}(got_addr(foo.o, y)) = y
llvm-svn: 358295
2019-04-13 02:07:28 +08:00
|
|
|
# rtdyld-check: *{4}(stub_addr(MachO_Thumb.o/__text, thumb_caller_arm_callee)) = 0xf000f8df
|
|
|
|
# rtdyld-check: *{4}(stub_addr(MachO_Thumb.o/__text, thumb_caller_arm_callee) + 4) = thumb_caller_arm_callee
|
2018-05-09 09:38:13 +08:00
|
|
|
bl thumb_caller_arm_callee
|
|
|
|
|
|
|
|
.globl arm_caller
|
|
|
|
.p2align 2
|
|
|
|
.code 32
|
|
|
|
arm_caller:
|
|
|
|
nop
|
|
|
|
|
|
|
|
# Check that stubs for arm callers use arm code (not thumb), and that thumb
|
|
|
|
# callees have the low bit set on their addresses.
|
Simplify decoupling between RuntimeDyld/RuntimeDyldChecker, add 'got_addr' util.
This patch reduces the number of functions in the interface between RuntimeDyld
and RuntimeDyldChecker by combining "GetXAddress" and "GetXContent" functions
into "GetXInfo" functions that return a struct describing both the address and
content. The GetStubOffset function is also replaced with a pair of utilities,
GetStubInfo and GetGOTInfo, that fit the new scheme. For RuntimeDyld both of
these functions will return the same result, but for the new JITLink linker
(https://reviews.llvm.org/D58704) these will provide the addresses of PLT stubs
and GOT entries respectively.
For JITLink's use, a 'got_addr' utility has been added to the rtdyld-check
language, and the syntax of 'got_addr' and 'stub_addr' has been changed: both
functions now take two arguments, a 'stub container name' and a target symbol
name. For llvm-rtdyld/RuntimeDyld the stub container name is the object file
name and section name, separated by a slash. E.g.:
rtdyld-check: *{8}(stub_addr(foo.o/__text, y)) = y
For the upcoming llvm-jitlink utility, which creates stubs on a per-file basis
rather than a per-section basis, the container name is just the file name. E.g.:
jitlink-check: *{8}(got_addr(foo.o, y)) = y
llvm-svn: 358295
2019-04-13 02:07:28 +08:00
|
|
|
# rtdyld-check: *{4}(stub_addr(MachO_Thumb.o/__text, arm_caller_thumb_callee)) = 0xe51ff004
|
|
|
|
# rtdyld-check: *{4}(stub_addr(MachO_Thumb.o/__text, arm_caller_thumb_callee) + 4) = (arm_caller_thumb_callee | 0x1)
|
2018-05-09 09:38:13 +08:00
|
|
|
bl arm_caller_thumb_callee
|
|
|
|
nop
|
2017-08-10 04:19:27 +08:00
|
|
|
|
|
|
|
.subsections_via_symbols
|