Re-diff strace patches against current version.
2 [ libdemo.so and main.o both use assignment on structures ]
3 $ sh4-unknown-linux-gnu-gcc libdemo.so main.o
4 sh4-unknown-linux-gnu/bin/ld: warning: type and size of dynamic symbol `__movstr_i4_even' are not defined
5 [ resulting app links, but crashes at runtime ]
6 See testcase at http://tsukuba.m17n.org/linux-sh/ml/linux-sh/2003-11/msg00016.html
8 Patch was posted as http://gcc.gnu.org/ml/gcc-patches/2002-11/msg01641.html
9 and is in cvs as http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sh/lib1funcs.asm.diff?r1=1.29.4.1&r2=1.29.4.2
11 but see also sh-libgcc-hidden.patch
13 ===================================================================
15 --- gcc/gcc/config/sh/lib1funcs.asm 2002/09/20 01:29:21 1.29.4.1
16 +++ gcc/gcc/config/sh/lib1funcs.asm 2003/11/18 12:27:31
21 -#define LOCAL(X) .L_##X
23 -#define LOCAL(X) L_##X
24 +#define LOCAL(X) .L_##X
25 +#define FUNC(X) .type X,@function
26 +#define ENDFUNC0(X) .Lfe_##X: .size X,.Lfe_##X-X
27 +#define ENDFUNC(X) ENDFUNC0(X)
29 +#define LOCAL(X) L_##X
34 #define CONCAT(A,B) A##B
36 .global GLOBAL(ashiftrt_r4_31)
37 .global GLOBAL(ashiftrt_r4_32)
39 + FUNC(GLOBAL(ashiftrt_r4_0))
40 + FUNC(GLOBAL(ashiftrt_r4_1))
41 + FUNC(GLOBAL(ashiftrt_r4_2))
42 + FUNC(GLOBAL(ashiftrt_r4_3))
43 + FUNC(GLOBAL(ashiftrt_r4_4))
44 + FUNC(GLOBAL(ashiftrt_r4_5))
45 + FUNC(GLOBAL(ashiftrt_r4_6))
46 + FUNC(GLOBAL(ashiftrt_r4_7))
47 + FUNC(GLOBAL(ashiftrt_r4_8))
48 + FUNC(GLOBAL(ashiftrt_r4_9))
49 + FUNC(GLOBAL(ashiftrt_r4_10))
50 + FUNC(GLOBAL(ashiftrt_r4_11))
51 + FUNC(GLOBAL(ashiftrt_r4_12))
52 + FUNC(GLOBAL(ashiftrt_r4_13))
53 + FUNC(GLOBAL(ashiftrt_r4_14))
54 + FUNC(GLOBAL(ashiftrt_r4_15))
55 + FUNC(GLOBAL(ashiftrt_r4_16))
56 + FUNC(GLOBAL(ashiftrt_r4_17))
57 + FUNC(GLOBAL(ashiftrt_r4_18))
58 + FUNC(GLOBAL(ashiftrt_r4_19))
59 + FUNC(GLOBAL(ashiftrt_r4_20))
60 + FUNC(GLOBAL(ashiftrt_r4_21))
61 + FUNC(GLOBAL(ashiftrt_r4_22))
62 + FUNC(GLOBAL(ashiftrt_r4_23))
63 + FUNC(GLOBAL(ashiftrt_r4_24))
64 + FUNC(GLOBAL(ashiftrt_r4_25))
65 + FUNC(GLOBAL(ashiftrt_r4_26))
66 + FUNC(GLOBAL(ashiftrt_r4_27))
67 + FUNC(GLOBAL(ashiftrt_r4_28))
68 + FUNC(GLOBAL(ashiftrt_r4_29))
69 + FUNC(GLOBAL(ashiftrt_r4_30))
70 + FUNC(GLOBAL(ashiftrt_r4_31))
71 + FUNC(GLOBAL(ashiftrt_r4_32))
74 GLOBAL(ashiftrt_r4_32):
75 GLOBAL(ashiftrt_r4_31):
77 GLOBAL(ashiftrt_r4_0):
81 + ENDFUNC(GLOBAL(ashiftrt_r4_0))
82 + ENDFUNC(GLOBAL(ashiftrt_r4_1))
83 + ENDFUNC(GLOBAL(ashiftrt_r4_2))
84 + ENDFUNC(GLOBAL(ashiftrt_r4_3))
85 + ENDFUNC(GLOBAL(ashiftrt_r4_4))
86 + ENDFUNC(GLOBAL(ashiftrt_r4_5))
87 + ENDFUNC(GLOBAL(ashiftrt_r4_6))
88 + ENDFUNC(GLOBAL(ashiftrt_r4_7))
89 + ENDFUNC(GLOBAL(ashiftrt_r4_8))
90 + ENDFUNC(GLOBAL(ashiftrt_r4_9))
91 + ENDFUNC(GLOBAL(ashiftrt_r4_10))
92 + ENDFUNC(GLOBAL(ashiftrt_r4_11))
93 + ENDFUNC(GLOBAL(ashiftrt_r4_12))
94 + ENDFUNC(GLOBAL(ashiftrt_r4_13))
95 + ENDFUNC(GLOBAL(ashiftrt_r4_14))
96 + ENDFUNC(GLOBAL(ashiftrt_r4_15))
97 + ENDFUNC(GLOBAL(ashiftrt_r4_16))
98 + ENDFUNC(GLOBAL(ashiftrt_r4_17))
99 + ENDFUNC(GLOBAL(ashiftrt_r4_18))
100 + ENDFUNC(GLOBAL(ashiftrt_r4_19))
101 + ENDFUNC(GLOBAL(ashiftrt_r4_20))
102 + ENDFUNC(GLOBAL(ashiftrt_r4_21))
103 + ENDFUNC(GLOBAL(ashiftrt_r4_22))
104 + ENDFUNC(GLOBAL(ashiftrt_r4_23))
105 + ENDFUNC(GLOBAL(ashiftrt_r4_24))
106 + ENDFUNC(GLOBAL(ashiftrt_r4_25))
107 + ENDFUNC(GLOBAL(ashiftrt_r4_26))
108 + ENDFUNC(GLOBAL(ashiftrt_r4_27))
109 + ENDFUNC(GLOBAL(ashiftrt_r4_28))
110 + ENDFUNC(GLOBAL(ashiftrt_r4_29))
111 + ENDFUNC(GLOBAL(ashiftrt_r4_30))
112 + ENDFUNC(GLOBAL(ashiftrt_r4_31))
113 + ENDFUNC(GLOBAL(ashiftrt_r4_32))
120 .global GLOBAL(ashrsi3)
121 + FUNC(GLOBAL(ashrsi3))
129 + ENDFUNC(GLOBAL(ashrsi3))
136 .global GLOBAL(ashlsi3)
137 + FUNC(GLOBAL(ashlsi3))
145 + ENDFUNC(GLOBAL(ashlsi3))
152 .global GLOBAL(lshrsi3)
153 + FUNC(GLOBAL(lshrsi3))
161 + ENDFUNC(GLOBAL(lshrsi3))
165 @@ -645,76 +724,113 @@
168 .global GLOBAL(movstrSI64)
169 + FUNC(GLOBAL(movstrSI64))
173 .global GLOBAL(movstrSI60)
174 + FUNC(GLOBAL(movstrSI60))
178 .global GLOBAL(movstrSI56)
179 + FUNC(GLOBAL(movstrSI56))
183 .global GLOBAL(movstrSI52)
184 + FUNC(GLOBAL(movstrSI52))
188 .global GLOBAL(movstrSI48)
189 + FUNC(GLOBAL(movstrSI48))
193 .global GLOBAL(movstrSI44)
194 + FUNC(GLOBAL(movstrSI44))
198 .global GLOBAL(movstrSI40)
199 + FUNC(GLOBAL(movstrSI40))
203 .global GLOBAL(movstrSI36)
204 + FUNC(GLOBAL(movstrSI36))
208 .global GLOBAL(movstrSI32)
209 + FUNC(GLOBAL(movstrSI32))
213 .global GLOBAL(movstrSI28)
214 + FUNC(GLOBAL(movstrSI28))
218 .global GLOBAL(movstrSI24)
219 + FUNC(GLOBAL(movstrSI24))
223 .global GLOBAL(movstrSI20)
224 + FUNC(GLOBAL(movstrSI20))
228 .global GLOBAL(movstrSI16)
229 + FUNC(GLOBAL(movstrSI16))
233 .global GLOBAL(movstrSI12)
234 + FUNC(GLOBAL(movstrSI12))
238 .global GLOBAL(movstrSI8)
239 + FUNC(GLOBAL(movstrSI8))
243 .global GLOBAL(movstrSI4)
244 + FUNC(GLOBAL(movstrSI4))
248 + .global GLOBAL(movstrSI0)
249 + FUNC(GLOBAL(movstrSI0))
254 + ENDFUNC(GLOBAL(movstrSI64))
255 + ENDFUNC(GLOBAL(movstrSI60))
256 + ENDFUNC(GLOBAL(movstrSI56))
257 + ENDFUNC(GLOBAL(movstrSI52))
258 + ENDFUNC(GLOBAL(movstrSI48))
259 + ENDFUNC(GLOBAL(movstrSI44))
260 + ENDFUNC(GLOBAL(movstrSI40))
261 + ENDFUNC(GLOBAL(movstrSI36))
262 + ENDFUNC(GLOBAL(movstrSI32))
263 + ENDFUNC(GLOBAL(movstrSI28))
264 + ENDFUNC(GLOBAL(movstrSI24))
265 + ENDFUNC(GLOBAL(movstrSI20))
266 + ENDFUNC(GLOBAL(movstrSI16))
267 + ENDFUNC(GLOBAL(movstrSI12))
268 + ENDFUNC(GLOBAL(movstrSI8))
269 + ENDFUNC(GLOBAL(movstrSI4))
270 + ENDFUNC(GLOBAL(movstrSI0))
274 .global GLOBAL(movstr)
275 + FUNC(GLOBAL(movstr))
284 + FUNC(GLOBAL(movstr))
289 .global GLOBAL(movstr_i4_odd)
290 .global GLOBAL(movstrSI12_i4)
292 + FUNC(GLOBAL(movstr_i4_even))
293 + FUNC(GLOBAL(movstr_i4_odd))
294 + FUNC(GLOBAL(movstrSI12_i4))
303 +GLOBAL(movstr_i4_even):
305 + bra L_movstr_start_even
308 GLOBAL(movstr_i4_odd):
315 -GLOBAL(movstr_i4_even):
317 - bra L_movstr_start_even
319 + ENDFUNC(GLOBAL(movstr_i4_even))
320 + ENDFUNC(GLOBAL(movstr_i4_odd))
323 GLOBAL(movstrSI12_i4):
324 @@ -827,12 +952,15 @@
329 + ENDFUNC(GLOBAL(movstrSI12_i4))
335 .global GLOBAL(mulsi3)
336 + FUNC(GLOBAL(mulsi3))
345 + FUNC(GLOBAL(mulsi3))
347 #endif /* ! __SH5__ */
350 !! args in r4 and r5, result in fpul, clobber dr0, dr2
352 .global GLOBAL(sdivsi3_i4)
353 + FUNC(GLOBAL(sdivsi3_i4))
361 + ENDFUNC(GLOBAL(sdivsi3_i4))
362 #elif defined(__SH4_SINGLE__) || defined(__SH4_SINGLE_ONLY__) || (defined (__SH5__) && ! defined __SH4_NOFPU__)
363 !! args in r4 and r5, result in fpul, clobber r2, dr0, dr2
368 .global GLOBAL(sdivsi3_i4)
369 + FUNC(GLOBAL(sdivsi3_i4))
377 + ENDFUNC(GLOBAL(sdivsi3_i4))
378 #endif /* ! __SH5__ || __SH5__ == 32 */
379 #endif /* ! __SH4__ */
381 @@ -920,9 +1052,10 @@
385 -!! args in r4 and r5, result in r0 clobber r1,r2,r3
386 +!! args in r4 and r5, result in r0 clobber r1, r2, r3, and t bit
388 .global GLOBAL(sdivsi3)
389 + FUNC(GLOBAL(sdivsi3))
392 .section .text..SHmedia32,"ax"
393 @@ -1166,6 +1299,7 @@
397 + ENDFUNC(GLOBAL(sdivsi3))
398 #endif /* ! __SHMEDIA__ */
399 #endif /* ! __SH4__ */
401 @@ -1174,9 +1308,11 @@
403 !! 4 byte integer Divide code for the Hitachi SH
405 -!! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4
406 +!! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4,
409 .global GLOBAL(udivsi3_i4)
410 + FUNC(GLOBAL(udivsi3_i4))
414 @@ -1217,11 +1353,13 @@
418 + ENDFUNC(GLOBAL(udivsi3_i4))
419 #elif defined (__SH5__) && ! defined (__SH4_NOFPU__)
420 #if ! __SH5__ || __SH5__ == 32
421 !! args in r4 and r5, result in fpul, clobber r20, r21, dr0, fr33
423 .global GLOBAL(udivsi3_i4)
424 + FUNC(GLOBAL(udivsi3_i4))
428 @@ -1234,6 +1372,8 @@
433 + ENDFUNC(GLOBAL(udivsi3_i4))
434 #endif /* ! __SH5__ || __SH5__ == 32 */
435 #elif defined(__SH4_SINGLE__) || defined(__SH4_SINGLE_ONLY__)
436 !! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4
437 @@ -1287,6 +1427,7 @@
441 + ENDFUNC(GLOBAL(udivsi3_i4))
442 #endif /* ! __SH4__ */
445 @@ -1297,6 +1438,7 @@
447 !! args in r4 and r5, result in r0, clobbers r4, pr, and t bit
448 .global GLOBAL(udivsi3)
449 + FUNC(GLOBAL(udivsi3))
453 @@ -1485,6 +1627,7 @@
457 + ENDFUNC(GLOBAL(udivsi3))
458 #endif /* ! __SHMEDIA__ */
460 #endif /* L_udivsi3 */
461 @@ -1790,6 +1933,7 @@
464 .global GLOBAL(set_fpscr)
465 + FUNC(GLOBAL(set_fpscr))
468 mov.l LOCAL(set_fpscr_L1),r1
469 @@ -1822,6 +1966,8 @@
472 .long GLOBAL(fpscr_values)
474 + ENDFUNC(GLOBAL(set_fpscr))
476 .comm GLOBAL(fpscr_values),8,4
478 @@ -1860,6 +2006,7 @@
480 #elif defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__)
481 .global GLOBAL(ic_invalidate)
482 + FUNC(GLOBAL(ic_invalidate))
483 GLOBAL(ic_invalidate):
486 @@ -1882,6 +2029,8 @@
491 + ENDFUNC(GLOBAL(ic_invalidate))
493 #endif /* L_ic_invalidate */
495 @@ -1940,6 +2089,7 @@
496 will be expanded into r2/r3 upon return. */
498 .global GLOBAL(GCC_shcompact_call_trampoline)
499 + FUNC(GLOBAL(GCC_shcompact_call_trampoline))
500 GLOBAL(GCC_shcompact_call_trampoline):
501 ptabs/l r0, tr0 /* Prepare to call the actual function. */
502 movi ((datalabel LOCAL(ct_main_table) - 31 * 2) >> 16) & 65535, r0
503 @@ -2290,6 +2440,8 @@
508 + ENDFUNC(GLOBAL(GCC_shcompact_call_trampoline))
509 #endif /* L_shcompact_call_trampoline */
511 #ifdef L_shcompact_return_trampoline
512 @@ -2302,6 +2454,7 @@
513 .section .text..SHmedia32, "ax"
515 .global GLOBAL(GCC_shcompact_return_trampoline)
516 + FUNC(GLOBAL(GCC_shcompact_return_trampoline))
517 GLOBAL(GCC_shcompact_return_trampoline):
519 #if __LITTLE_ENDIAN__
520 @@ -2313,6 +2466,8 @@
525 + ENDFUNC(GLOBAL(GCC_shcompact_return_trampoline))
526 #endif /* L_shcompact_return_trampoline */
528 #ifdef L_shcompact_incoming_args
529 @@ -2367,6 +2522,7 @@
530 actual bit pattern. */
532 .global GLOBAL(GCC_shcompact_incoming_args)
533 + FUNC(GLOBAL(GCC_shcompact_incoming_args))
534 GLOBAL(GCC_shcompact_incoming_args):
535 ptabs/l r18, tr0 /* Prepare to return. */
536 shlri r17, 32, r0 /* Load the cookie. */
537 @@ -2519,6 +2675,7 @@
538 LOCAL(ia_return): /* Return. */
540 LOCAL(ia_end_of_push_seq): /* Label used to compute the first push instruction. */
541 + ENDFUNC(GLOBAL(GCC_shcompact_incoming_args))
542 #endif /* L_shcompact_incoming_args */
545 @@ -2530,6 +2687,7 @@
547 .align 3 /* It is copied in units of 8 bytes in SHmedia mode. */
548 .global GLOBAL(GCC_nested_trampoline)
549 + FUNC(GLOBAL(GCC_nested_trampoline))
550 GLOBAL(GCC_nested_trampoline):
553 @@ -2546,6 +2704,8 @@
558 + ENDFUNC(GLOBAL(GCC_nested_trampoline))
559 #endif /* L_nested_trampoline */
562 @@ -2555,6 +2715,7 @@
564 #ifndef __SH4_NOFPU__
565 .global GLOBAL(GCC_push_shmedia_regs)
566 + FUNC(GLOBAL(GCC_push_shmedia_regs))
567 GLOBAL(GCC_push_shmedia_regs):
568 addi.l r15, -14*8, r15
569 fst.d r15, 13*8, dr62
570 @@ -2573,6 +2734,7 @@
573 .global GLOBAL(GCC_push_shmedia_regs_nofpu)
574 + FUNC(GLOBAL(GCC_push_shmedia_regs_nofpu))
575 GLOBAL(GCC_push_shmedia_regs_nofpu):
577 addi.l r15, -27*8, r15
578 @@ -2608,8 +2770,13 @@
582 +#ifndef __SH4_NOFPU__
583 + ENDFUNC(GLOBAL(GCC_push_shmedia_regs))
585 + ENDFUNC(GLOBAL(GCC_push_shmedia_regs_nofpu))
586 #ifndef __SH4_NOFPU__
587 .global GLOBAL(GCC_pop_shmedia_regs)
588 + FUNC(GLOBAL(GCC_pop_shmedia_regs))
589 GLOBAL(GCC_pop_shmedia_regs):
592 @@ -2630,6 +2797,7 @@
595 .global GLOBAL(GCC_pop_shmedia_regs_nofpu)
596 + FUNC(GLOBAL(GCC_pop_shmedia_regs_nofpu))
597 GLOBAL(GCC_pop_shmedia_regs_nofpu):
600 @@ -2666,5 +2834,10 @@
605 +#ifndef __SH4_NOFPU__
606 + ENDFUNC(GLOBAL(GCC_pop_shmedia_regs))
608 + ENDFUNC(GLOBAL(GCC_pop_shmedia_regs_nofpu))
609 #endif /* __SH5__ == 32 */
610 #endif /* L_push_pop_shmedia_regs */