Commit 5d7b54450582f31d0d5d3ecca7f330b70446f195

Richard Henderson 2014-10-24T11:45:53

sparc: Tidy up symbols Assembly to use local labels, .type annotation, hidden annotation. I do retain the _prefix for the symbols, but given that it wasn't done consistently across all symbols, I doubt it's actually needed.

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
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
diff --git a/src/sparc/ffi.c b/src/sparc/ffi.c
index c2a0d14..1f38f54 100644
--- a/src/sparc/ffi.c
+++ b/src/sparc/ffi.c
@@ -44,7 +44,8 @@
 /* ffi_prep_args is called by the assembly routine once stack space
    has been allocated for the function's arguments */
 
-void ffi_prep_args_v8(char *stack, extended_cif *ecif)
+void FFI_HIDDEN
+ffi_prep_args_v8(char *stack, extended_cif *ecif)
 {
   int i;
   void **p_argv;
@@ -127,7 +128,8 @@ void ffi_prep_args_v8(char *stack, extended_cif *ecif)
   return;
 }
 
-int ffi_prep_args_v9(char *stack, extended_cif *ecif)
+int FFI_HIDDEN
+ffi_prep_args_v9(char *stack, extended_cif *ecif)
 {
   int i, ret = 0;
   int tmp;
@@ -254,7 +256,8 @@ int ffi_prep_args_v9(char *stack, extended_cif *ecif)
 }
 
 /* Perform machine dependent cif processing */
-ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
+ffi_status FFI_HIDDEN
+ffi_prep_cif_machdep(ffi_cif *cif)
 {
   int wordsize;
 
@@ -337,7 +340,8 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
   return FFI_OK;
 }
 
-int ffi_v9_layout_struct(ffi_type *arg, int off, char *ret, char *intg, char *flt)
+static int
+ffi_v9_layout_struct(ffi_type *arg, int off, char *ret, char *intg, char *flt)
 {
   ffi_type **ptr = &arg->elements[0];
 
@@ -371,14 +375,14 @@ int ffi_v9_layout_struct(ffi_type *arg, int off, char *ret, char *intg, char *fl
 
 #ifdef SPARC64
 extern int ffi_call_v9(void *, extended_cif *, unsigned, 
-		       unsigned, unsigned *, void (*fn)(void));
+		       unsigned, unsigned *, void (*fn)(void)) FFI_HIDDEN;
 #else
 extern int ffi_call_v8(void *, extended_cif *, unsigned, 
-		       unsigned, unsigned *, void (*fn)(void));
+		       unsigned, unsigned *, void (*fn)(void)) FFI_HIDDEN;
 #endif
 
 #ifndef __GNUC__
-void ffi_flush_icache (void *, size_t);
+void ffi_flush_icache (void *, size_t) FFI_HIDDEN;
 #endif
 
 void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
@@ -478,9 +482,9 @@ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
 
 
 #ifdef SPARC64
-extern void ffi_closure_v9(void);
+extern void ffi_closure_v9(void) FFI_HIDDEN;
 #else
-extern void ffi_closure_v8(void);
+extern void ffi_closure_v8(void) FFI_HIDDEN;
 #endif
 
 ffi_status
@@ -534,9 +538,9 @@ ffi_prep_closure_loc (ffi_closure* closure,
   return FFI_OK;
 }
 
-int
-ffi_closure_sparc_inner_v8(ffi_closure *closure,
-  void *rvalue, unsigned long *gpr, unsigned long *scratch)
+int FFI_HIDDEN
+ffi_closure_sparc_inner_v8(ffi_closure *closure, void *rvalue,
+			   unsigned long *gpr, unsigned long *scratch)
 {
   ffi_cif *cif;
   ffi_type **arg_types;
@@ -592,9 +596,9 @@ ffi_closure_sparc_inner_v8(ffi_closure *closure,
   return cif->rtype->type;
 }
 
-int
-ffi_closure_sparc_inner_v9(ffi_closure *closure,
-  void *rvalue, unsigned long *gpr, double *fpr)
+int FFI_HIDDEN
+ffi_closure_sparc_inner_v9(ffi_closure *closure, void *rvalue,
+			   unsigned long *gpr, double *fpr)
 {
   ffi_cif *cif;
   ffi_type **arg_types;
diff --git a/src/sparc/v8.S b/src/sparc/v8.S
index 6bf7ac0..10c66ba 100644
--- a/src/sparc/v8.S
+++ b/src/sparc/v8.S
@@ -28,18 +28,31 @@
 #define LIBFFI_ASM	
 #include <fficonfig.h>
 #include <ffi.h>
+#include <ffi_cfi.h>
 
 #define STACKFRAME 96		/* Minimum stack framesize for SPARC */
 #define ARGS (64+4)		/* Offset of register area in frame */
 
-#ifndef __GNUC__	
+#define C2(X, Y)  X ## Y
+#define C1(X, Y)  C2(X, Y)
+
+#ifdef __USER_LABEL_PREFIX__
+# define C(Y)	C1(__USER_LABEL_PREFIX__, Y)
+#else
+# define C(Y)	Y
+#endif
+#define L(Y)	C1(.L, Y)
+
 	.text
+
+#ifndef __GNUC__	
         .align 8
-.globl ffi_flush_icache
-.globl _ffi_flush_icache
+	.globl	C(ffi_flush_icache)
+	.type	C(ffi_flush_icache),@function
+	FFI_HIDDEN(C(ffi_flush_icache))
 
-ffi_flush_icache:
-_ffi_flush_icache:	
+C(ffi_flush_icache):
+	cfi_startproc
         add %o0, %o1, %o2
 #ifdef SPARC64	
 1:	flush %o0
@@ -56,20 +69,20 @@ _ffi_flush_icache:
 	nop
 	retl
 	nop
-.ffi_flush_icache_end:
-	.size	ffi_flush_icache,.ffi_flush_icache_end-ffi_flush_icache
+	cfi_endproc
+	.size	C(ffi_flush_icache), . - C(ffi_flush_icache)
 #endif
 
-	.text
         .align 8
-.globl ffi_call_v8
-.globl _ffi_call_v8
+	.globl	C(ffi_call_v8)
+	.type	C(ffi_call_v8),@function
+	FFI_HIDDEN(C(ffi_call_v8))
 	
-ffi_call_v8:
-_ffi_call_v8:
-.LLFB1:
+C(ffi_call_v8):
+	cfi_startproc
 	save	%sp, -STACKFRAME, %sp
-.LLCFI0:
+	cfi_def_cfa_register(%fp)
+	cfi_window_save
 	
 	sub	%sp, %i2, %sp	! alloca() space in stack for frame to set up
 	add	%sp, STACKFRAME, %l0	! %l0 has start of 
@@ -91,81 +104,81 @@ _ffi_call_v8:
 
 	! If the return value pointer is NULL, assume no return value.
 	tst	%i4
-	bz	done
+	bz	L(done)
 	nop
 
 	cmp	%i3, FFI_TYPE_INT
-	be,a	done
+	be,a	L(done)
 	st	%o0, [%i4]	! (delay)
 
 	cmp	%i3, FFI_TYPE_FLOAT
-	be,a	done
+	be,a	L(done)
 	st	%f0, [%i4+0]	! (delay)
 
 	cmp	%i3, FFI_TYPE_DOUBLE
-	be,a	double
+	be,a	L(double)
 	st	%f0, [%i4+0]	! (delay)
 
 	cmp	%i3, FFI_TYPE_SINT8
-	be,a	sint8
+	be,a	L(sint8)
 	sll	%o0, 24, %o0	! (delay)
 
 	cmp	%i3, FFI_TYPE_UINT8
-	be,a	uint8
+	be,a	L(uint8)
 	sll	%o0, 24, %o0	! (delay)
 
 	cmp	%i3, FFI_TYPE_SINT16
-	be,a	sint16
+	be,a	L(sint16)
 	sll	%o0, 16, %o0	! (delay)
 
 	cmp	%i3, FFI_TYPE_UINT16
-	be,a	uint16
+	be,a	L(uint16)
 	sll	%o0, 16, %o0	! (delay)
 
 	cmp	%i3, FFI_TYPE_SINT64
-	be,a	longlong
+	be,a	L(longlong)
 	st	%o0, [%i4+0]	! (delay)
-done:
+
+L(done):
 	ret
 	restore
 
-double:
+L(double):
 	st	%f1, [%i4+4]
 	ret
 	restore
 
-sint8:
+L(sint8):
 	sra	%o0, 24, %o0
 	st	%o0, [%i4+0]
 	ret
 	restore
 
-uint8:
+L(uint8):
 	srl	%o0, 24, %o0
 	st	%o0, [%i4+0]
 	ret
 	restore
 
-sint16:
+L(sint16):
 	sra	%o0, 16, %o0
 	st	%o0, [%i4+0]
 	ret
 	restore
 
-uint16:
+L(uint16):
 	srl	%o0, 16, %o0
 	st	%o0, [%i4+0]
 	ret
 	restore
 
-longlong:
+L(longlong):
 	st	%o1, [%i4+4]
 	ret
 	restore
-.LLFE1:
+	cfi_endproc
 
-.ffi_call_v8_end:
-	.size	ffi_call_v8,.ffi_call_v8_end-ffi_call_v8
+	.size	C(ffi_call_v8),. - C(ffi_call_v8)
 
 
 #undef STACKFRAME
@@ -178,15 +191,16 @@ longlong:
 
    Receives the closure argument in %g2.   */
 
-	.text
 	.align 8
-	.globl ffi_closure_v8
+	.globl	C(ffi_closure_v8)
+	.type	C(ffi_closure_v8),@function
+	FFI_HIDDEN(C(ffi_closure_v8))
 
-ffi_closure_v8:
+C(ffi_closure_v8):
 #ifdef HAVE_AS_REGISTER_PSEUDO_OP
 		.register	%g2, #scratch
 #endif
-.LLFB2:
+	cfi_startproc
 	! Reserve frame space for all arguments in case
 	! we need to align them on a 8-byte boundary.
 	ld	[%g2+FFI_TRAMPOLINE_SIZE], %g1
@@ -196,7 +210,8 @@ ffi_closure_v8:
 	! %g1 == STACKFRAME + 8*nargs
 	neg	%g1
 	save	%sp, %g1, %sp
-.LLCFI1:
+	cfi_def_cfa_register(%fp)
+	cfi_window_save
 
 	! Store all of the potential argument registers in va_list format.
 	st	%i0, [%fp+68+0]
@@ -216,130 +231,47 @@ ffi_closure_v8:
 	! Load up the return value in the proper type.
 	! See ffi_prep_cif_machdep for the list of cases.
 	cmp	%o0, FFI_TYPE_VOID
-	be	done1
+	be	L(done1)
 
 	cmp	%o0, FFI_TYPE_INT
-	be	done1
+	be	L(done1)
 	 ld	[%fp-8], %i0
 
 	cmp	%o0, FFI_TYPE_FLOAT
-	be,a	done1
+	be,a	L(done1)
 	 ld	[%fp-8], %f0
 
 	cmp	%o0, FFI_TYPE_DOUBLE
-	be,a	done1
+	be,a	L(done1)
 	 ldd	[%fp-8], %f0
 
 #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
 	cmp	%o0, FFI_TYPE_LONGDOUBLE
-	be	done2
+	be	L(done2)
 #endif
 
 	cmp	%o0, FFI_TYPE_STRUCT
-	be	done2
+	be	L(done2)
 
 	cmp	%o0, FFI_TYPE_SINT64
-	be,a	done1
+	be,a	L(done1)
 	 ldd	[%fp-8], %i0
 
 	cmp	%o0, FFI_TYPE_UINT64
-	be,a	done1
+	be,a	L(done1)
 	 ldd	[%fp-8], %i0
 
 	ld	[%fp-8], %i0
-done1:
+L(done1):
 	jmp	%i7+8
 	 restore
-done2:
+L(done2):
 	! Skip 'unimp'.
 	jmp	%i7+12
 	 restore
-.LLFE2:
-
-.ffi_closure_v8_end:
-	.size	ffi_closure_v8,.ffi_closure_v8_end-ffi_closure_v8
 
-#ifdef SPARC64
-#define WS 8
-#define nword	xword
-#define uanword	uaxword
-#else
-#define WS 4
-#define nword	long
-#define uanword	uaword
-#endif
-
-#ifdef HAVE_RO_EH_FRAME
-	.section	".eh_frame",#alloc
-#else
-	.section	".eh_frame",#alloc,#write
-#endif
-.LLframe1:
-	.uaword	.LLECIE1-.LLSCIE1	! Length of Common Information Entry
-.LLSCIE1:
-	.uaword	0x0	! CIE Identifier Tag
-	.byte	0x1	! CIE Version
-	.ascii "zR\0"	! CIE Augmentation
-	.byte	0x1	! uleb128 0x1; CIE Code Alignment Factor
-	.byte	0x80-WS	! sleb128 -WS; CIE Data Alignment Factor
-	.byte	0xf	! CIE RA Column
-	.byte	0x1	! uleb128 0x1; Augmentation size
-#ifdef HAVE_AS_SPARC_UA_PCREL
-	.byte	0x1b	! FDE Encoding (pcrel sdata4)
-#else
-	.byte	0x50	! FDE Encoding (aligned absolute)
-#endif
-	.byte	0xc	! DW_CFA_def_cfa
-	.byte	0xe	! uleb128 0xe
-	.byte	0x0	! uleb128 0x0
-	.align	WS
-.LLECIE1:
-.LLSFDE1:
-	.uaword	.LLEFDE1-.LLASFDE1	! FDE Length
-.LLASFDE1:
-	.uaword	.LLASFDE1-.LLframe1	! FDE CIE offset
-#ifdef HAVE_AS_SPARC_UA_PCREL
-	.uaword	%r_disp32(.LLFB1)
-	.uaword	.LLFE1-.LLFB1	! FDE address range
-#else
-	.align	WS
-	.nword	.LLFB1
-	.uanword .LLFE1-.LLFB1	! FDE address range
-#endif
-	.byte	0x0	! uleb128 0x0; Augmentation size
-	.byte	0x4	! DW_CFA_advance_loc4
-	.uaword	.LLCFI0-.LLFB1
-	.byte	0xd	! DW_CFA_def_cfa_register
-	.byte	0x1e	! uleb128 0x1e
-	.byte	0x2d	! DW_CFA_GNU_window_save
-	.byte	0x9	! DW_CFA_register
-	.byte	0xf	! uleb128 0xf
-	.byte	0x1f	! uleb128 0x1f
-	.align	WS
-.LLEFDE1:
-.LLSFDE2:
-	.uaword	.LLEFDE2-.LLASFDE2	! FDE Length
-.LLASFDE2:
-	.uaword	.LLASFDE2-.LLframe1	! FDE CIE offset
-#ifdef HAVE_AS_SPARC_UA_PCREL
-	.uaword	%r_disp32(.LLFB2)
-	.uaword	.LLFE2-.LLFB2	! FDE address range
-#else
-	.align	WS
-	.nword	.LLFB2
-	.uanword .LLFE2-.LLFB2	! FDE address range
-#endif
-	.byte	0x0	! uleb128 0x0; Augmentation size
-	.byte	0x4	! DW_CFA_advance_loc4
-	.uaword	.LLCFI1-.LLFB2
-	.byte	0xd	! DW_CFA_def_cfa_register
-	.byte	0x1e	! uleb128 0x1e
-	.byte	0x2d	! DW_CFA_GNU_window_save
-	.byte	0x9	! DW_CFA_register
-	.byte	0xf	! uleb128 0xf
-	.byte	0x1f	! uleb128 0x1f
-	.align	WS
-.LLEFDE2:
+	cfi_endproc
+	.size	C(ffi_closure_v8), . - C(ffi_closure_v8)
 
 #if defined __ELF__ && defined __linux__
 	.section	.note.GNU-stack,"",@progbits
diff --git a/src/sparc/v9.S b/src/sparc/v9.S
index bf31a2b..aba468e 100644
--- a/src/sparc/v9.S
+++ b/src/sparc/v9.S
@@ -27,25 +27,38 @@
 #define LIBFFI_ASM	
 #include <fficonfig.h>
 #include <ffi.h>
+#include <ffi_cfi.h>
 
 #ifdef SPARC64
 /* Only compile this in for 64bit builds, because otherwise the object file
    will have inproper architecture due to used instructions.  */
 
+#define C2(X, Y)  X ## Y
+#define C1(X, Y)  C2(X, Y)
+
+#ifdef __USER_LABEL_PREFIX__
+# define C(Y)	C1(__USER_LABEL_PREFIX__, Y)
+#else
+# define C(Y)	Y
+#endif
+#define L(Y)	C1(.L, Y)
+
+
 #define STACKFRAME 176		/* Minimum stack framesize for SPARC 64-bit */
 #define STACK_BIAS 2047
 #define ARGS (128)		/* Offset of register area in frame */
 
 .text
         .align 8
-.globl ffi_call_v9
-.globl _ffi_call_v9
+	.globl	C(ffi_call_v9)
+	.type	C(ffi_call_v9),@function
+	FFI_HIDDEN(C(ffi_call_v9))
 
-ffi_call_v9:
-_ffi_call_v9:
-.LLFB1:
+C(ffi_call_v9):
+	cfi_startproc
 	save	%sp, -STACKFRAME, %sp
-.LLCFI0:
+	cfi_def_cfa_register(%fp)
+	cfi_window_save
 	
 	sub	%sp, %i2, %sp	! alloca() space in stack for frame to set up
 	add	%sp, STACKFRAME+STACK_BIAS, %l0	! %l0 has start of 
@@ -83,34 +96,35 @@ _ffi_call_v9:
 	 sub	%l0, STACK_BIAS, %sp	! (delay) switch to frame
 
 	! If the return value pointer is NULL, assume no return value.
-	brz,pn	%i4, done
+	brz,pn	%i4, L(done)
 	 nop
 
 	cmp	%i3, FFI_TYPE_INT
-	be,a,pt	%icc, done
+	be,a,pt	%icc, L(done)
 	 stx	%o0, [%i4+0]	! (delay)
 
 	cmp	%i3, FFI_TYPE_FLOAT
-	be,a,pn	%icc, done
+	be,a,pn	%icc, L(done)
 	 st	%f0, [%i4+0]	! (delay)
 
 	cmp	%i3, FFI_TYPE_DOUBLE
-	be,a,pn	%icc, done
+	be,a,pn	%icc, L(done)
 	 std	%f0, [%i4+0]	! (delay)
 
 	cmp	%i3, FFI_TYPE_STRUCT
-	be,pn	%icc, dostruct
+	be,pn	%icc, L(dostruct)
 
 	cmp	%i3, FFI_TYPE_LONGDOUBLE
-	bne,pt	%icc, done
+	bne,pt	%icc, L(done)
 	 nop
 	std	%f0, [%i4+0]
 	std	%f2, [%i4+8]
 
-done:	ret
+L(done):
+	ret
 	 restore
 
-dostruct:
+L(dostruct):
 	/* This will not work correctly for unions. */
 	stx	%o0, [%i4+0]
 	stx	%o1, [%i4+8]
@@ -122,10 +136,9 @@ dostruct:
 	std	%f6, [%i4+56]
 	ret
 	 restore
-.LLFE1:
 
-.ffi_call_v9_end:
-	.size	ffi_call_v9,.ffi_call_v9_end-ffi_call_v9
+	cfi_endproc
+	.size	C(ffi_call_v9), . - C(ffi_call_v9)
 
 
 #undef STACKFRAME
@@ -138,14 +151,16 @@ dostruct:
 
    Receives the closure argument in %g1.   */
 
-	.text
 	.align 8
-	.globl ffi_closure_v9
+	.globl	C(ffi_closure_v9)
+	.type	C(ffi_closure_v9),@function
+	FFI_HIDDEN(C(ffi_closure_v9))
 
-ffi_closure_v9:
-.LLFB2:
+C(ffi_closure_v9):
+	cfi_startproc
 	save	%sp, -STACKFRAME, %sp
-.LLCFI1:
+	cfi_def_cfa_register(%fp)
+	cfi_window_save
 
 	! Store all of the potential argument registers in va_list format.
 	stx	%i0, [FP+128+0]
@@ -177,28 +192,28 @@ ffi_closure_v9:
 	mov	%g1, %o0
 	add	%fp, STACK_BIAS-160, %o1
 	add	%fp, STACK_BIAS+128, %o2
-	call	ffi_closure_sparc_inner_v9
+	call	C(ffi_closure_sparc_inner_v9)
 	 add	%fp, STACK_BIAS-128, %o3
 
 	! Load up the return value in the proper type.
 	! See ffi_prep_cif_machdep for the list of cases.
 	cmp	%o0, FFI_TYPE_VOID
-	be,pn	%icc, done1
+	be,pn	%icc, L(done1)
 
 	cmp	%o0, FFI_TYPE_INT
-	be,pn	%icc, integer
+	be,pn	%icc, L(integer)
 
 	cmp	%o0, FFI_TYPE_FLOAT
-	be,a,pn	%icc, done1
+	be,a,pn	%icc, L(done1)
 	 ld	[FP-160], %f0
 
 	cmp	%o0, FFI_TYPE_DOUBLE
-	be,a,pn	%icc, done1
+	be,a,pn	%icc, L(done1)
 	 ldd	[FP-160], %f0
 
 #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
 	cmp	%o0, FFI_TYPE_LONGDOUBLE
-	be,a,pn	%icc, longdouble1
+	be,a,pn	%icc, L(longdouble1)
 	 ldd	[FP-160], %f0
 #endif
 
@@ -211,97 +226,24 @@ ffi_closure_v9:
 	ldd	[FP-144], %f4
 	ldd	[FP-136], %f6
 
-integer:
+L(integer):
 	ldx	[FP-160], %i0
 
-done1:
+L(done1):
 	ret
 	 restore
 
 #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
-longdouble1:
+L(longdouble1):
 	ldd	[FP-152], %f2
 	ret
 	 restore
 #endif
-.LLFE2:
 
-.ffi_closure_v9_end:
-	.size	ffi_closure_v9,.ffi_closure_v9_end-ffi_closure_v9
-
-#ifdef HAVE_RO_EH_FRAME
-	.section	".eh_frame",#alloc
-#else
-	.section	".eh_frame",#alloc,#write
-#endif
-.LLframe1:
-	.uaword	.LLECIE1-.LLSCIE1	! Length of Common Information Entry
-.LLSCIE1:
-	.uaword	0x0	! CIE Identifier Tag
-	.byte	0x1	! CIE Version
-	.ascii "zR\0"	! CIE Augmentation
-	.byte	0x1	! uleb128 0x1; CIE Code Alignment Factor
-	.byte	0x78	! sleb128 -8; CIE Data Alignment Factor
-	.byte	0xf	! CIE RA Column
-	.byte	0x1	! uleb128 0x1; Augmentation size
-#ifdef HAVE_AS_SPARC_UA_PCREL
-	.byte	0x1b	! FDE Encoding (pcrel sdata4)
-#else
-	.byte	0x50	! FDE Encoding (aligned absolute)
-#endif
-	.byte	0xc	! DW_CFA_def_cfa
-	.byte	0xe	! uleb128 0xe
-	.byte	0xff,0xf	! uleb128 0x7ff
-	.align 8
-.LLECIE1:
-.LLSFDE1:
-	.uaword	.LLEFDE1-.LLASFDE1	! FDE Length
-.LLASFDE1:
-	.uaword	.LLASFDE1-.LLframe1	! FDE CIE offset
-#ifdef HAVE_AS_SPARC_UA_PCREL
-	.uaword	%r_disp32(.LLFB1)
-	.uaword	.LLFE1-.LLFB1		! FDE address range
-#else
-	.align 8
-	.xword	.LLFB1
-	.uaxword	.LLFE1-.LLFB1	! FDE address range
-#endif
-	.byte	0x0	! uleb128 0x0; Augmentation size
-	.byte	0x4	! DW_CFA_advance_loc4
-	.uaword	.LLCFI0-.LLFB1
-	.byte	0xd	! DW_CFA_def_cfa_register
-	.byte	0x1e	! uleb128 0x1e
-	.byte	0x2d	! DW_CFA_GNU_window_save
-	.byte	0x9	! DW_CFA_register
-	.byte	0xf	! uleb128 0xf
-	.byte	0x1f	! uleb128 0x1f
-	.align 8
-.LLEFDE1:
-.LLSFDE2:
-	.uaword	.LLEFDE2-.LLASFDE2	! FDE Length
-.LLASFDE2:
-	.uaword	.LLASFDE2-.LLframe1	! FDE CIE offset
-#ifdef HAVE_AS_SPARC_UA_PCREL
-	.uaword	%r_disp32(.LLFB2)
-	.uaword	.LLFE2-.LLFB2		! FDE address range
-#else
-	.align 8
-	.xword	.LLFB2
-	.uaxword	.LLFE2-.LLFB2	! FDE address range
-#endif
-	.byte	0x0	! uleb128 0x0; Augmentation size
-	.byte	0x4	! DW_CFA_advance_loc4
-	.uaword	.LLCFI1-.LLFB2
-	.byte	0xd	! DW_CFA_def_cfa_register
-	.byte	0x1e	! uleb128 0x1e
-	.byte	0x2d	! DW_CFA_GNU_window_save
-	.byte	0x9	! DW_CFA_register
-	.byte	0xf	! uleb128 0xf
-	.byte	0x1f	! uleb128 0x1f
-	.align 8
-.LLEFDE2:
-#endif
+	cfi_endproc
+	.size	C(ffi_closure_v9), . - C(ffi_closure_v9)
 
+#endif /* SPARC64 */
 #ifdef __linux__
 	.section	.note.GNU-stack,"",@progbits
 #endif