Don't require text relocations on AArc32.

This has been tested with a few hacks on FreeBSD, where everything
except for throwing exceptions in +initialize appears to work (most
likely an unrelated issue, though it's possible that there are problems
with the unwind tables in objc_msgSend.)

Fixes #92
main
David Chisnall 7 years ago
parent bd5637af6d
commit fe5ad93523

@ -1,6 +1,7 @@
.syntax unified .syntax unified
.fpu neon .fpu neon
#if ((__ARM_ARCH >= 7) || defined (__ARM_ARCH_6T2__)) #if ((__ARM_ARCH >= 7) || defined (__ARM_ARCH_6T2__))
#define RELOC_OFFSET 4
// If we're using a CPU that supports Thumb-2, use it. This makes the // If we're using a CPU that supports Thumb-2, use it. This makes the
// objc_msgSend function 130 bytes instead of 176. The fast path drops from 108 // objc_msgSend function 130 bytes instead of 176. The fast path drops from 108
// bytes to 82, meaning that it will fit in 3 32-byte i-cache lines, rather // bytes to 82, meaning that it will fit in 3 32-byte i-cache lines, rather
@ -18,6 +19,7 @@
ubfx \dst, \src, #16, #8 ubfx \dst, \src, #16, #8
.endm .endm
#else #else
#define RELOC_OFFSET 8
.macro byte1 dst, src .macro byte1 dst, src
and \dst, \src, #0xff and \dst, \src, #0xff
.endm .endm
@ -51,10 +53,12 @@
// directives for them, but not for any other pushes // directives for them, but not for any other pushes
tst \receiver, SMALLOBJ_MASK // Sets Z if this is not a small int tst \receiver, SMALLOBJ_MASK // Sets Z if this is not a small int
ldr r4, 7f
6:
add r4, pc
itte ne itte ne
ldrne r4, LSmallIntClass // Small Int class -> r4 if this is a small int
ldrne r4, [r4] ldrne r4, [r4]
ldrne r4, [r4] // Small Int class -> r4 if this is a small int
ldreq r4, [\receiver] // Load class to r4 if not a small int ldreq r4, [\receiver] // Load class to r4 if not a small int
ldr r4, [r4, #DTABLE_OFFSET] // Dtable -> r4 ldr r4, [r4, #DTABLE_OFFSET] // Dtable -> r4
@ -122,6 +126,9 @@
# endif # endif
#endif #endif
bx lr bx lr
7:
.long SmallObjectClasses(GOT_PREL)-((6b+RELOC_OFFSET)-7b)
.align 2
.fnend .fnend
.endm .endm
@ -137,6 +144,3 @@ TYPE_DIRECTIVE(CDECL(objc_msgSend_stret), %function)
CDECL(objc_msgSend_stret): CDECL(objc_msgSend_stret):
MSGSEND r1, r2 MSGSEND r1, r2
LSmallIntClass:
.long SmallObjectClasses
.align 2

Loading…
Cancel
Save