ObjFW  Check-in [5c0891c85d]

Overview
Comment:Add bti instructions
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 5c0891c85da93302239ef4e39f3810b4f08efddafe80949b59651693fe3c799a
User & Date: js on 2024-02-24 21:07:41
Other Links: manifest | tags
Context
2024-02-24
21:12
Update ChangeLog for 1.0.10 check-in: 7767b60d7f user: js tags: trunk
21:08
Add bti instructions check-in: d73a388eca user: js tags: 1.0
21:07
Add bti instructions check-in: 5c0891c85d user: js tags: trunk
20:50
Add endbr32 / endbr64 check-in: 75d88e0f6e user: js tags: trunk
Changes

Modified configure.ac from [6589788787] to [6716f34b04].

842
843
844
845
846
847
848













849
850
851
852
853
854
855
		])
	], [
		AC_DEFINE(HAVE_VFP2, 1, [Whether we have VFP2 or above])
		AC_MSG_RESULT(yes)
	], [
		AC_MSG_RESULT(no)
	])













	;;
i?86)
	AC_MSG_CHECKING(for endbr32)
	AC_COMPILE_IFELSE([
		AC_LANG_PROGRAM([], [
			__asm__ __volatile__ ("endbr32");
		])







>
>
>
>
>
>
>
>
>
>
>
>
>







842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
		])
	], [
		AC_DEFINE(HAVE_VFP2, 1, [Whether we have VFP2 or above])
		AC_MSG_RESULT(yes)
	], [
		AC_MSG_RESULT(no)
	])
	;;
aarch64* | arm64*)
	AC_MSG_CHECKING(for bti)
	AC_COMPILE_IFELSE([
		AC_LANG_PROGRAM([], [
			__asm__ __volatile__ ("bti jc");
		])
	], [
		AC_DEFINE(HAVE_BTI, 1, [Whether we have bti])
		AC_MSG_RESULT(yes)
	], [
		AC_MSG_RESULT(no)
	])
	;;
i?86)
	AC_MSG_CHECKING(for endbr32)
	AC_COMPILE_IFELSE([
		AC_LANG_PROGRAM([], [
			__asm__ __volatile__ ("endbr32");
		])

Modified src/forwarding/apple-forwarding-arm64.S from [a595def47d] to [295019262c].

29
30
31
32
33
34
35




36
37
38
39
40
41
42
.section __DATA, __objc_imageinfo, regular, no_dead_strip
	.long 0, 0

.section __TEXT, __text, regular, pure_instructions
.align 2
_OFForward:
_OFForward_stret:




	stp	fp, lr, [sp, #-208]!
	mov	fp, sp
	sub	sp, sp, #208

	/* Save all arguments, x8 and x19 */
	stp	x0, x1, [sp]
	stp	x2, x3, [sp, #16]







>
>
>
>







29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
.section __DATA, __objc_imageinfo, regular, no_dead_strip
	.long 0, 0

.section __TEXT, __text, regular, pure_instructions
.align 2
_OFForward:
_OFForward_stret:
#ifdef HAVE_BTI
	bti	jc
#endif

	stp	fp, lr, [sp, #-208]!
	mov	fp, sp
	sub	sp, sp, #208

	/* Save all arguments, x8 and x19 */
	stp	x0, x1, [sp]
	stp	x2, x3, [sp, #16]

Modified src/forwarding/forwarding-arm64-elf.S from [ae93185aa7] to [a4d41fba56].

19
20
21
22
23
24
25




26
27
28
29
30
31
32

.globl OFForward
.globl OFForward_stret

.section .text
OFForward:
OFForward_stret:




	stp	fp, lr, [sp, #-208]!
	mov	fp, sp
	sub	sp, sp, #208

	/* Save all arguments, x8 and x19 */
	stp	x0, x1, [sp]
	stp	x2, x3, [sp, #16]







>
>
>
>







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

.globl OFForward
.globl OFForward_stret

.section .text
OFForward:
OFForward_stret:
#ifdef HAVE_BTI
	bti	jc
#endif

	stp	fp, lr, [sp, #-208]!
	mov	fp, sp
	sub	sp, sp, #208

	/* Save all arguments, x8 and x19 */
	stp	x0, x1, [sp]
	stp	x2, x3, [sp, #16]
99
100
101
102
103
104
105




106
107
108
109
110
111
112
	b	OFMethodNotFound
.type OFForward, %function
.size OFForward, .-OFForward
.type OFForward_stret, %function
.size OFForward_stret, .-OFForward_stret

.Linit:




	adrp	x0, .Lmodule
	add	x0, x0, :lo12:.Lmodule
	b	__objc_exec_class

.section .init_array, "aw", %init_array
	.xword .Linit








>
>
>
>







103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
	b	OFMethodNotFound
.type OFForward, %function
.size OFForward, .-OFForward
.type OFForward_stret, %function
.size OFForward_stret, .-OFForward_stret

.Linit:
#ifdef HAVE_BTI
	bti	c
#endif

	adrp	x0, .Lmodule
	add	x0, x0, :lo12:.Lmodule
	b	__objc_exec_class

.section .init_array, "aw", %init_array
	.xword .Linit

Modified src/runtime/lookup-asm/lookup-asm-arm64-elf.S from [3f3a340787] to [0b31617db4].

21
22
23
24
25
26
27




28
29
30
31
32
33
34
.globl objc_msg_lookup_stret
.globl objc_msg_lookup_super
.globl objc_msg_lookup_super_stret

.section .text
.macro GENERATE_LOOKUP name notFound
\name:




	cbz	x0, .LreturnNilMethod

	tst	x0, #1
	b.ne	.LtaggedPointer_\name

	ldr	x2, [x0]
	ldr	x2, [x2, #64]







>
>
>
>







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
.globl objc_msg_lookup_stret
.globl objc_msg_lookup_super
.globl objc_msg_lookup_super_stret

.section .text
.macro GENERATE_LOOKUP name notFound
\name:
#ifdef HAVE_BTI
	bti	jc
#endif

	cbz	x0, .LreturnNilMethod

	tst	x0, #1
	b.ne	.LtaggedPointer_\name

	ldr	x2, [x0]
	ldr	x2, [x2, #64]
64
65
66
67
68
69
70




71
72
73
74
75
76
77
	b	.Lmain_\name
.type \name, %function
.size \name, .-\name
.endm

.macro GENERATE_LOOKUP_SUPER name lookup
\name:




	mov	x2, x0
	ldr	x0, [x0]
	cbz	x0, .LreturnNilMethod

	ldr	x2, [x2, #8]
	ldr	x2, [x2, #64]








>
>
>
>







68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
	b	.Lmain_\name
.type \name, %function
.size \name, .-\name
.endm

.macro GENERATE_LOOKUP_SUPER name lookup
\name:
#ifdef HAVE_BTI
	bti	jc
#endif

	mov	x2, x0
	ldr	x0, [x0]
	cbz	x0, .LreturnNilMethod

	ldr	x2, [x2, #8]
	ldr	x2, [x2, #64]