sparc: Re-introduce hand-written unwind info Fixes the build with the Solaris assembler.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323
diff --git a/src/sparc/v8.S b/src/sparc/v8.S
index 3f48382..a2e4908 100644
--- a/src/sparc/v8.S
+++ b/src/sparc/v8.S
@@ -28,7 +28,6 @@
#define LIBFFI_ASM
#include <fficonfig.h>
#include <ffi.h>
-#include <ffi_cfi.h>
#include "internal.h"
#ifndef SPARC64
@@ -52,7 +51,6 @@
FFI_HIDDEN(C(ffi_flush_icache))
C(ffi_flush_icache):
- cfi_startproc
1: iflush %o0
iflush %o+8
nop
@@ -62,7 +60,6 @@ C(ffi_flush_icache):
nop
retl
nop
- cfi_endproc
.size C(ffi_flush_icache), . - C(ffi_flush_icache)
#endif
@@ -78,13 +75,10 @@ C(ffi_flush_icache):
FFI_HIDDEN(C(ffi_call_v8))
C(ffi_call_v8):
- cfi_startproc
+.LUW0:
! Allocate a stack frame sized by ffi_call.
save %sp, %o4, %sp
- cfi_def_cfa_register(%fp)
- cfi_window_save
- cfi_register(%o7, %i7)
-
+.LUW1:
mov %i0, %o0 ! copy cif
add %sp, 64+32, %o1 ! load args area
mov %i2, %o2 ! copy rvalue
@@ -233,7 +227,7 @@ E(SPARC_RET_F_1)
rept256; rept256; rept256; rept256
rept256; rept256; rept256; rept256
- cfi_endproc
+.LUW2:
.size C(ffi_call_v8),. - C(ffi_call_v8)
@@ -255,17 +249,14 @@ E(SPARC_RET_F_1)
FFI_HIDDEN(C(ffi_go_closure_v8))
C(ffi_go_closure_v8):
- cfi_startproc
+.LUW3:
save %sp, -STACKFRAME, %sp
- cfi_def_cfa_register(%fp)
- cfi_window_save
- cfi_register(%o7, %i7)
-
+.LUW4:
ld [%g2+4], %o0 ! load cif
ld [%g2+8], %o1 ! load fun
b 0f
mov %g2, %o2 ! load user_data
- cfi_endproc
+.LUW5:
.size C(ffi_go_closure_v8), . - C(ffi_go_closure_v8)
.align 8
@@ -274,12 +265,9 @@ C(ffi_go_closure_v8):
FFI_HIDDEN(C(ffi_closure_v8))
C(ffi_closure_v8):
- cfi_startproc
+.LUW6:
save %sp, -STACKFRAME, %sp
- cfi_def_cfa_register(%fp)
- cfi_window_save
- cfi_register(%o7, %i7)
-
+.LUW7:
ld [%g2+FFI_TRAMPOLINE_SIZE], %o0 ! load cif
ld [%g2+FFI_TRAMPOLINE_SIZE+4], %o1 ! load fun
ld [%g2+FFI_TRAMPOLINE_SIZE+8], %o2 ! load user_data
@@ -375,8 +363,80 @@ E(SPARC_RET_F_1)
ret
restore
- cfi_endproc
+.LUW8:
.size C(ffi_closure_v8), . - C(ffi_closure_v8)
+
+#ifdef HAVE_RO_EH_FRAME
+ .section ".eh_frame",#alloc
+#else
+ .section ".eh_frame",#alloc,#write
+#endif
+
+#ifdef HAVE_AS_SPARC_UA_PCREL
+# define FDE_ADDR(X) %r_disp32(X)
+#else
+# define FDE_ADDR(X) X
+#endif
+
+ .align 4
+.LCIE:
+ .long .LECIE - .LSCIE ! CIE Length
+.LSCIE:
+ .long 0 ! CIE Identifier Tag
+ .byte 1 ! CIE Version
+ .ascii "zR\0" ! CIE Augmentation
+ .byte 4 ! CIE Code Alignment Factor
+ .byte 0x7c ! CIE Data Alignment Factor
+ .byte 15 ! CIE RA Column
+ .byte 1 ! Augmentation size
+#ifdef HAVE_AS_SPARC_UA_PCREL
+ .byte 0x1b ! FDE Encoding (pcrel sdata4)
+#else
+ .byte 0x50 ! FDE Encoding (aligned absolute)
+#endif
+ .byte 0xc, 14, 0 ! DW_CFA_def_cfa, %o6, offset 0
+ .align 4
+.LECIE:
+
+ .long .LEFDE1 - .LSFDE1 ! FDE Length
+.LSFDE1:
+ .long .LSFDE1 - .LCIE ! FDE CIE offset
+ .long FDE_ADDR(.LUW0) ! Initial location
+ .long .LUW2 - .LUW0 ! Address range
+ .byte 0 ! Augmentation size
+ .byte 0x40+1 ! DW_CFA_advance_loc 4
+ .byte 0xd, 30 ! DW_CFA_def_cfa_register, %i6
+ .byte 0x2d ! DW_CFA_GNU_window_save
+ .byte 0x9, 15, 31 ! DW_CFA_register, %o7, %i7
+ .align 4
+.LEFDE1:
+
+ .long .LEFDE2 - .LSFDE2 ! FDE Length
+.LSFDE2:
+ .long .LSFDE2 - .LCIE ! FDE CIE offset
+ .long FDE_ADDR(.LUW3) ! Initial location
+ .long .LUW5 - .LUW3 ! Address range
+ .byte 0 ! Augmentation size
+ .byte 0x40+1 ! DW_CFA_advance_loc 4
+ .byte 0xd, 30 ! DW_CFA_def_cfa_register, %i6
+ .byte 0x2d ! DW_CFA_GNU_window_save
+ .byte 0x9, 15, 31 ! DW_CFA_register, %o7, %i7
+ .align 4
+.LEFDE2:
+
+ .long .LEFDE3 - .LSFDE3 ! FDE Length
+.LSFDE3:
+ .long .LSFDE3 - .LCIE ! FDE CIE offset
+ .long FDE_ADDR(.LUW6) ! Initial location
+ .long .LUW8 - .LUW6 ! Address range
+ .byte 0 ! Augmentation size
+ .byte 0x40+1 ! DW_CFA_advance_loc 4
+ .byte 0xd, 30 ! DW_CFA_def_cfa_register, %i6
+ .byte 0x2d ! DW_CFA_GNU_window_save
+ .byte 0x9, 15, 31 ! DW_CFA_register, %o7, %i7
+ .align 4
+.LEFDE3:
+
#endif /* !SPARC64 */
#if defined __ELF__ && defined __linux__
.section .note.GNU-stack,"",@progbits
diff --git a/src/sparc/v9.S b/src/sparc/v9.S
index 05ef54c..55f8f43 100644
--- a/src/sparc/v9.S
+++ b/src/sparc/v9.S
@@ -27,7 +27,6 @@
#define LIBFFI_ASM
#include <fficonfig.h>
#include <ffi.h>
-#include <ffi_cfi.h>
#include "internal.h"
#ifdef SPARC64
@@ -57,12 +56,9 @@
FFI_HIDDEN(C(ffi_call_v9))
C(ffi_call_v9):
- cfi_startproc
+.LUW0:
save %sp, %o4, %sp
- cfi_def_cfa_register(%fp)
- cfi_window_save
- cfi_register(%o7, %i7)
-
+.LUW1:
mov %i0, %o0 ! copy cif
add %sp, STACK_BIAS+128+48, %o1 ! load args area
mov %i2, %o2 ! copy rvalue
@@ -199,7 +195,7 @@ E(SPARC_RET_F_1)
return %i7+8
nop
- cfi_endproc
+.LUW2:
.size C(ffi_call_v9), . - C(ffi_call_v9)
@@ -219,18 +215,15 @@ E(SPARC_RET_F_1)
FFI_HIDDEN(C(ffi_go_closure_v9))
C(ffi_go_closure_v9):
- cfi_startproc
+.LUW3:
save %sp, -STACKFRAME, %sp
- cfi_def_cfa_register(%fp)
- cfi_window_save
- cfi_register(%o7, %i7)
-
+.LUW4:
ldx [%g5+8], %o0
ldx [%g5+16], %o1
b 0f
mov %g5, %o2
- cfi_endproc
+.LUW5:
.size C(ffi_go_closure_v9), . - C(ffi_go_closure_v9)
.align 8
@@ -239,12 +232,9 @@ C(ffi_go_closure_v9):
FFI_HIDDEN(C(ffi_closure_v9))
C(ffi_closure_v9):
- cfi_startproc
+.LUW6:
save %sp, -STACKFRAME, %sp
- cfi_def_cfa_register(%fp)
- cfi_window_save
- cfi_register(%o7, %i7)
-
+.LUW7:
ldx [%g1+FFI_TRAMPOLINE_SIZE], %o0
ldx [%g1+FFI_TRAMPOLINE_SIZE+8], %o1
ldx [%g1+FFI_TRAMPOLINE_SIZE+16], %o2
@@ -373,8 +363,77 @@ E(SPARC_RET_F_1)
return %i7+8
nop
- cfi_endproc
+.LUW8:
.size C(ffi_closure_v9), . - C(ffi_closure_v9)
+
+#ifdef HAVE_RO_EH_FRAME
+ .section ".eh_frame",#alloc
+#else
+ .section ".eh_frame",#alloc,#write
+#endif
+
+#ifdef HAVE_AS_SPARC_UA_PCREL
+# define FDE_RANGE(B, E) .long %r_disp32(B), E - B
+#else
+# define FDE_RANGE(B, E) .align 8; .xword B, E - B
+#endif
+
+ .align 8
+.LCIE:
+ .long .LECIE - .LSCIE ! CIE Length
+.LSCIE:
+ .long 0 ! CIE Identifier Tag
+ .byte 1 ! CIE Version
+ .ascii "zR\0" ! CIE Augmentation
+ .byte 4 ! CIE Code Alignment Factor
+ .byte 0x78 ! CIE Data Alignment Factor
+ .byte 15 ! CIE RA Column
+ .byte 1 ! Augmentation size
+#ifdef HAVE_AS_SPARC_UA_PCREL
+ .byte 0x1b ! FDE Encoding (pcrel sdata4)
+#else
+ .byte 0x50 ! FDE Encoding (aligned absolute)
+#endif
+ .byte 0xc, 14, 0xff, 0xf ! DW_CFA_def_cfa, %o6, offset 0x7ff
+ .align 8
+.LECIE:
+
+ .long .LEFDE1 - .LSFDE1 ! FDE Length
+.LSFDE1:
+ .long .LSFDE1 - .LCIE ! FDE CIE offset
+ FDE_RANGE(.LUW0, .LUW2)
+ .byte 0 ! Augmentation size
+ .byte 0x40+1 ! DW_CFA_advance_loc 4
+ .byte 0xd, 30 ! DW_CFA_def_cfa_register, %i6
+ .byte 0x2d ! DW_CFA_GNU_window_save
+ .byte 0x9, 15, 31 ! DW_CFA_register, %o7, %i7
+ .align 8
+.LEFDE1:
+
+ .long .LEFDE2 - .LSFDE2 ! FDE Length
+.LSFDE2:
+ .long .LSFDE2 - .LCIE ! FDE CIE offset
+ FDE_RANGE(.LUW3, .LUW5)
+ .byte 0 ! Augmentation size
+ .byte 0x40+1 ! DW_CFA_advance_loc 4
+ .byte 0xd, 30 ! DW_CFA_def_cfa_register, %i6
+ .byte 0x2d ! DW_CFA_GNU_window_save
+ .byte 0x9, 15, 31 ! DW_CFA_register, %o7, %i7
+ .align 8
+.LEFDE2:
+
+ .long .LEFDE3 - .LSFDE3 ! FDE Length
+.LSFDE3:
+ .long .LSFDE3 - .LCIE ! FDE CIE offset
+ FDE_RANGE(.LUW6, .LUW8)
+ .byte 0 ! Augmentation size
+ .byte 0x40+1 ! DW_CFA_advance_loc 4
+ .byte 0xd, 30 ! DW_CFA_def_cfa_register, %i6
+ .byte 0x2d ! DW_CFA_GNU_window_save
+ .byte 0x9, 15, 31 ! DW_CFA_register, %o7, %i7
+ .align 8
+.LEFDE3:
+
#endif /* SPARC64 */
#ifdef __linux__
.section .note.GNU-stack,"",@progbits