From: Andreas Schwab Date: Thu, 5 Jan 2012 13:52:48 +0000 (+0100) Subject: m68k: add cfi directives X-Git-Tag: upstream/2.30~10627^2~322 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=50e73d1379b4ed494f733ab699c638f8587a4137;p=external%2Fglibc.git m68k: add cfi directives --- diff --git a/ChangeLog.m68k b/ChangeLog.m68k index a234cfa..8f62c71 100644 --- a/ChangeLog.m68k +++ b/ChangeLog.m68k @@ -1,3 +1,32 @@ +2012-01-05 Andreas Schwab + + * sysdeps/m68k/dl-trampoline.S: Add cfi directives. + * sysdeps/m68k/memchr.S: Likewise. + * sysdeps/m68k/rawmemchr.S: Likewise. + * sysdeps/m68k/strchr.S: Likewise. + * sysdeps/m68k/strchrnul.S: Likewise. + * sysdeps/m68k/m680x0/add_n.S: Likewise. + * sysdeps/m68k/m680x0/lshift.S: Likewise. + * sysdeps/m68k/m680x0/rshift.S: Likewise. + * sysdeps/m68k/m680x0/sub_n.S: Likewise. + * sysdeps/m68k/m680x0/m68020/addmul_1.S: Likewise. + * sysdeps/m68k/m680x0/m68020/mul_1.S: Likewise. + * sysdeps/m68k/m680x0/m68020/submul_1.S: Likewise. + * sysdeps/unix/sysv/linux/m68k/clone.S: Likewise. + * sysdeps/unix/sysv/linux/m68k/semtimedop.S: Likewise. + * sysdeps/unix/sysv/linux/m68k/socket.S: Likewise. + * sysdeps/unix/sysv/linux/m68k/sysdep.S: Likewise. + * sysdeps/unix/sysv/linux/m68k/sysdep.h: Likewise. + * sysdeps/unix/sysv/linux/m68k/vfork.S: Likewise. + * sysdeps/m68k/sysdep.h (CALL_MCOUNT): Likewise. + (ENTRY): Add cfi_startproc. + (END): Add cfi_endproc. + * sysdeps/unix/sysv/linux/m68k/coldfire/m68k-helpers.S: Remove + cfi_startproc/cfi_endproc. + * sysdeps/unix/sysv/linux/m68k/m680x0/m68k-helpers.S: Likewise. + * sysdeps/unix/sysv/linux/m68k/nptl/sysdep-cancel.h (PSEUDO): + Likewise. + 2011-12-23 Andreas Schwab * sysdeps/m68k/bits/byteswap.h (__bswap_constant_64): Protect long diff --git a/sysdeps/m68k/dl-trampoline.S b/sysdeps/m68k/dl-trampoline.S index 0f4148b..bdf3974 100644 --- a/sysdeps/m68k/dl-trampoline.S +++ b/sysdeps/m68k/dl-trampoline.S @@ -1,5 +1,5 @@ /* PLT trampolines. m68k version. - Copyright (C) 2005, 2011 Free Software Foundation, Inc. + Copyright (C) 2005, 2011, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -23,54 +23,81 @@ .globl _dl_runtime_resolve .type _dl_runtime_resolve, @function _dl_runtime_resolve: + cfi_startproc + cfi_adjust_cfa_offset (8) | Save %a0 (struct return address) and %a1. move.l %a0, -(%sp) + cfi_adjust_cfa_offset (4) move.l %a1, -(%sp) + cfi_adjust_cfa_offset (4) | Call the real address resolver. jbsr _dl_fixup | Restore register %a0 and %a1. move.l (%sp)+, %a1 + cfi_adjust_cfa_offset (-4) move.l (%sp)+, %a0 + cfi_adjust_cfa_offset (-4) | Pop parameters addq.l #8, %sp + cfi_adjust_cfa_offset (-8) | Call real function. #ifdef __mcoldfire__ move.l %d0,-(%sp) + cfi_adjust_cfa_offset (4) rts #else jmp (%d0) #endif + cfi_endproc .size _dl_runtime_resolve, . - _dl_runtime_resolve .text .globl _dl_runtime_profile .type _dl_runtime_profile, @function _dl_runtime_profile: + cfi_startproc + cfi_adjust_cfa_offset (8) pea 8(%sp) + cfi_adjust_cfa_offset (4) move.l %a1, -(%sp) + cfi_adjust_cfa_offset (4) move.l %a0, -(%sp) + cfi_adjust_cfa_offset (4) pea -1.w + cfi_adjust_cfa_offset (4) | Push parameters for _dl_profile_fixup pea (%sp) + cfi_adjust_cfa_offset (4) pea 8(%sp) + cfi_adjust_cfa_offset (4) move.l 32(%sp), -(%sp) + cfi_adjust_cfa_offset (4) move.l 32(%sp), -(%sp) + cfi_adjust_cfa_offset (4) move.l 32(%sp), -(%sp) + cfi_adjust_cfa_offset (4) subq.l #8, %sp + cfi_adjust_cfa_offset (8) | Call the real address resolver. jbsr _dl_profile_fixup | Pop parameters lea 28(%sp), %sp + cfi_adjust_cfa_offset (-28) move.l (%sp), %d1 jpl 1f addq.l #4, %sp + cfi_adjust_cfa_offset (-4) | Restore register %a0 and %a1. move.l (%sp)+, %a0 + cfi_adjust_cfa_offset (-4) move.l (%sp)+, %a1 + cfi_adjust_cfa_offset (-4) lea 12(%sp), %sp + cfi_adjust_cfa_offset (-12) | Call real function. #ifdef __mcoldfire__ move.l %d0,-(%sp) + cfi_adjust_cfa_offset (4) rts #else jmp (%d0) @@ -85,7 +112,13 @@ _dl_runtime_profile: +4 %a0 %sp free */ +#ifdef __mcoldfire__ + cfi_adjust_cfa_offset (20) +#else + cfi_adjust_cfa_offset (24) +#endif 1: move.l %a2, (%sp) + cfi_rel_offset (%a2, 0) move.l %sp, %a2 move.l %sp, %a0 lea 28(%sp), %a1 @@ -94,6 +127,7 @@ _dl_runtime_profile: and.l #-3, %d1 sub.l %d1, %a0 move.l %a0, %sp + cfi_def_cfa_register (%a2) #ifdef __mcoldfire__ tst.l %d1 beq 2f @@ -129,7 +163,10 @@ _dl_runtime_profile: jsr (%d0) #endif move.l %a2, %sp + cfi_def_cfa_register (%sp) move.l (%sp)+, %a2 + cfi_adjust_cfa_offset (4) + cfi_restore (%a2) /* +20 return address +16 PLT1 @@ -140,32 +177,52 @@ _dl_runtime_profile: */ #ifdef __mcoldfire__ fmove.d %fp0, -(%sp) + cfi_adjust_cfa_offset (8) #else fmove.x %fp0, -(%sp) + cfi_adjust_cfa_offset (12) #endif move.l %a0, -(%sp) + cfi_adjust_cfa_offset (4) move.l %d1, -(%sp) + cfi_adjust_cfa_offset (4) move.l %d0, -(%sp) + cfi_adjust_cfa_offset (4) pea (%sp) + cfi_adjust_cfa_offset (4) #ifdef __mcoldfire__ pea 24(%sp) + cfi_adjust_cfa_offset (4) move.l 40(%sp), -(%sp) + cfi_adjust_cfa_offset (4) move.l 40(%sp), -(%sp) + cfi_adjust_cfa_offset (4) #else pea 28(%sp) + cfi_adjust_cfa_offset (4) move.l 44(%sp), -(%sp) + cfi_adjust_cfa_offset (4) move.l 44(%sp), -(%sp) + cfi_adjust_cfa_offset (4) #endif jbsr _dl_call_pltexit lea 16(%sp), %sp + cfi_adjust_cfa_offset (-16) move.l (%sp)+, %d0 + cfi_adjust_cfa_offset (-4) move.l (%sp)+, %d1 + cfi_adjust_cfa_offset (-4) move.l (%sp)+, %a0 + cfi_adjust_cfa_offset (-4) #ifdef __mcoldfire__ fmove.d (%sp)+, %fp0 + cfi_adjust_cfa_offset (-8) #else fmove.x (%sp)+, %fp0 + cfi_adjust_cfa_offset (-12) #endif lea 20(%sp), %sp + cfi_adjust_cfa_offset (-20) rts + cfi_endproc .size _dl_runtime_profile, . - _dl_runtime_profile diff --git a/sysdeps/m68k/m680x0/add_n.S b/sysdeps/m68k/m680x0/add_n.S index a955849..3011de6 100644 --- a/sysdeps/m68k/m680x0/add_n.S +++ b/sysdeps/m68k/m680x0/add_n.S @@ -1,7 +1,7 @@ /* mc68020 __mpn_add_n -- Add two limb vectors of the same length > 0 and store sum in a third limb vector. -Copyright (C) 1992, 1994, 1996, 1998 Free Software Foundation, Inc. +Copyright (C) 1992, 1994, 1996, 1998, 2012 Free Software Foundation, Inc. This file is part of the GNU MP Library. @@ -35,7 +35,11 @@ MA 02111-1307, USA. */ ENTRY(__mpn_add_n) /* Save used registers on the stack. */ movel R(d2),MEM_PREDEC(sp) + cfi_adjust_cfa_offset (4) movel R(a2),MEM_PREDEC(sp) + cfi_adjust_cfa_offset (4) + cfi_rel_offset (R(d2), 4) + cfi_rel_offset (R(a2), 0) /* Copy the arguments to registers. Better use movem? */ movel MEM_DISP(sp,12),R(a2) @@ -70,7 +74,11 @@ L(L2:) /* Restore used registers from stack frame. */ movel MEM_POSTINC(sp),R(a2) + cfi_adjust_cfa_offset (-4) + cfi_restore (R(a2)) movel MEM_POSTINC(sp),R(d2) + cfi_adjust_cfa_offset (-4) + cfi_restore (R(d2)) rts END(__mpn_add_n) diff --git a/sysdeps/m68k/m680x0/lshift.S b/sysdeps/m68k/m680x0/lshift.S index 434b344..047241f 100644 --- a/sysdeps/m68k/m680x0/lshift.S +++ b/sysdeps/m68k/m680x0/lshift.S @@ -1,6 +1,6 @@ /* mc68020 __mpn_lshift -- Shift left a low-level natural-number integer. -Copyright (C) 1996, 1998 Free Software Foundation, Inc. +Copyright (C) 1996, 1998, 2012 Free Software Foundation, Inc. This file is part of the GNU MP Library. @@ -40,6 +40,13 @@ ENTRY(__mpn_lshift) /* Save used registers on the stack. */ moveml R(d2)-R(d6)/R(a2),MEM_PREDEC(sp) + cfi_adjust_cfa_offset (6*4) + cfi_rel_offset (R(d2), 0) + cfi_rel_offset (R(d3), 4) + cfi_rel_offset (R(d4), 8) + cfi_rel_offset (R(d5), 12) + cfi_rel_offset (R(d6), 16) + cfi_rel_offset (R(a2), 20) /* Copy the arguments to registers. */ movel MEM_DISP(sp,28),R(res_ptr) @@ -111,12 +118,21 @@ L(Lend:) /* Restore used registers from stack frame. */ moveml MEM_POSTINC(sp),R(d2)-R(d6)/R(a2) + cfi_remember_state + cfi_adjust_cfa_offset (-6*4) + cfi_restore (R(d2)) + cfi_restore (R(d3)) + cfi_restore (R(d4)) + cfi_restore (R(d5)) + cfi_restore (R(d6)) + cfi_restore (R(a2)) rts /* We loop from least significant end of the arrays, which is only permissible if the source and destination don't overlap, since the function is documented to work for overlapping source and destination. */ + cfi_restore_state L(Lspecial:) clrl R(d0) /* initialize carry */ eorw #1,R(s_size) @@ -143,5 +159,12 @@ L(LL1:) L(LLend:) /* Restore used registers from stack frame. */ moveml MEM_POSTINC(sp),R(d2)-R(d6)/R(a2) + cfi_adjust_cfa_offset (-6*4) + cfi_restore (R(d2)) + cfi_restore (R(d3)) + cfi_restore (R(d4)) + cfi_restore (R(d5)) + cfi_restore (R(d6)) + cfi_restore (R(a2)) rts END(__mpn_lshift) diff --git a/sysdeps/m68k/m680x0/m68020/addmul_1.S b/sysdeps/m68k/m680x0/m68020/addmul_1.S index 05d1d8a..478bff3 100644 --- a/sysdeps/m68k/m680x0/m68020/addmul_1.S +++ b/sysdeps/m68k/m680x0/m68020/addmul_1.S @@ -1,7 +1,7 @@ /* mc68020 __mpn_addmul_1 -- Multiply a limb vector with a limb and add the result to a second limb vector. -Copyright (C) 1992, 1994, 1996, 1998 Free Software Foundation, Inc. +Copyright (C) 1992, 1994, 1996, 1998, 2012 Free Software Foundation, Inc. This file is part of the GNU MP Library. @@ -41,6 +41,11 @@ ENTRY(__mpn_addmul_1) /* Save used registers on the stack. */ moveml R(d2)-R(d5),MEM_PREDEC(sp) + cfi_adjust_cfa_offset (4*4) + cfi_rel_offset (R(d2), 0) + cfi_rel_offset (R(d3), 4) + cfi_rel_offset (R(d4), 8) + cfi_rel_offset (R(d5), 12) /* Copy the arguments to registers. Better use movem? */ movel MEM_DISP(sp,20),R(res_ptr) @@ -75,6 +80,11 @@ L(L1:) movel MEM_POSTINC(s1_ptr),R(d3) /* Restore used registers from stack frame. */ moveml MEM_POSTINC(sp),R(d2)-R(d5) + cfi_adjust_cfa_offset (-4*4) + cfi_restore (R(d2)) + cfi_restore (R(d3)) + cfi_restore (R(d4)) + cfi_restore (R(d5)) rts END(__mpn_addmul_1) diff --git a/sysdeps/m68k/m680x0/m68020/mul_1.S b/sysdeps/m68k/m680x0/m68020/mul_1.S index f3e450e..6f68500 100644 --- a/sysdeps/m68k/m680x0/m68020/mul_1.S +++ b/sysdeps/m68k/m680x0/m68020/mul_1.S @@ -1,7 +1,7 @@ /* mc68020 __mpn_mul_1 -- Multiply a limb vector with a limb and store the result in a second limb vector. -Copyright (C) 1992, 1994, 1996, 1998 Free Software Foundation, Inc. +Copyright (C) 1992, 1994, 1996, 1998, 2012 Free Software Foundation, Inc. This file is part of the GNU MP Library. @@ -41,11 +41,10 @@ ENTRY(__mpn_mul_1) /* Save used registers on the stack. */ moveml R(d2)-R(d4),MEM_PREDEC(sp) -#if 0 - movel R(d2),MEM_PREDEC(sp) - movel R(d3),MEM_PREDEC(sp) - movel R(d4),MEM_PREDEC(sp) -#endif + cfi_adjust_cfa_offset (3*4) + cfi_rel_offset (R(d2), 0) + cfi_rel_offset (R(d3), 4) + cfi_rel_offset (R(d4), 8) /* Copy the arguments to registers. Better use movem? */ movel MEM_DISP(sp,16),R(res_ptr) @@ -78,10 +77,9 @@ L(L1:) movel MEM_POSTINC(s1_ptr),R(d3) /* Restore used registers from stack frame. */ moveml MEM_POSTINC(sp),R(d2)-R(d4) -#if 0 - movel MEM_POSTINC(sp),R(d4) - movel MEM_POSTINC(sp),R(d3) - movel MEM_POSTINC(sp),R(d2) -#endif + cfi_adjust_cfa_offset (-3*4) + cfi_restore (R(d2)) + cfi_restore (R(d3)) + cfi_restore (R(d4)) rts END(__mpn_mul_1) diff --git a/sysdeps/m68k/m680x0/m68020/submul_1.S b/sysdeps/m68k/m680x0/m68020/submul_1.S index 7522046..bc1fd3a 100644 --- a/sysdeps/m68k/m680x0/m68020/submul_1.S +++ b/sysdeps/m68k/m680x0/m68020/submul_1.S @@ -1,7 +1,7 @@ /* mc68020 __mpn_submul_1 -- Multiply a limb vector with a limb and subtract the result from a second limb vector. -Copyright (C) 1992, 1994, 1996, 1998 Free Software Foundation, Inc. +Copyright (C) 1992, 1994, 1996, 1998, 2012 Free Software Foundation, Inc. This file is part of the GNU MP Library. @@ -41,6 +41,11 @@ ENTRY(__mpn_submul_1) /* Save used registers on the stack. */ moveml R(d2)-R(d5),MEM_PREDEC(sp) + cfi_adjust_cfa_offset (4*4) + cfi_rel_offset (R(d2), 0) + cfi_rel_offset (R(d3), 4) + cfi_rel_offset (R(d4), 8) + cfi_rel_offset (R(d5), 12) /* Copy the arguments to registers. Better use movem? */ movel MEM_DISP(sp,20),R(res_ptr) @@ -75,6 +80,11 @@ L(L1:) movel MEM_POSTINC(s1_ptr),R(d3) /* Restore used registers from stack frame. */ moveml MEM_POSTINC(sp),R(d2)-R(d5) + cfi_adjust_cfa_offset (-4*4) + cfi_restore (R(d2)) + cfi_restore (R(d3)) + cfi_restore (R(d4)) + cfi_restore (R(d5)) rts END(__mpn_submul_1) diff --git a/sysdeps/m68k/m680x0/rshift.S b/sysdeps/m68k/m680x0/rshift.S index 5e6abce..c6c720a 100644 --- a/sysdeps/m68k/m680x0/rshift.S +++ b/sysdeps/m68k/m680x0/rshift.S @@ -1,6 +1,6 @@ /* mc68020 __mpn_rshift -- Shift right a low-level natural-number integer. -Copyright (C) 1996, 1998 Free Software Foundation, Inc. +Copyright (C) 1996, 1998, 2012 Free Software Foundation, Inc. This file is part of the GNU MP Library. @@ -39,6 +39,13 @@ MA 02111-1307, USA. */ ENTRY(__mpn_rshift) /* Save used registers on the stack. */ moveml R(d2)-R(d6)/R(a2),MEM_PREDEC(sp) + cfi_adjust_cfa_offset (6*4) + cfi_rel_offset (R(d2), 0) + cfi_rel_offset (R(d3), 4) + cfi_rel_offset (R(d4), 8) + cfi_rel_offset (R(d5), 12) + cfi_rel_offset (R(d6), 16) + cfi_rel_offset (R(a2), 20) /* Copy the arguments to registers. */ movel MEM_DISP(sp,28),R(res_ptr) @@ -100,12 +107,21 @@ L(Lend:) /* Restore used registers from stack frame. */ moveml MEM_POSTINC(sp),R(d2)-R(d6)/R(a2) + cfi_remember_state + cfi_adjust_cfa_offset (-6*4) + cfi_restore (R(d2)) + cfi_restore (R(d3)) + cfi_restore (R(d4)) + cfi_restore (R(d5)) + cfi_restore (R(d6)) + cfi_restore (R(a2)) rts /* We loop from most significant end of the arrays, which is only permissible if the source and destination don't overlap, since the function is documented to work for overlapping source and destination. */ + cfi_restore_state L(Lspecial:) #if (defined (__mc68020__) || defined (__NeXT__) || defined(mc68020)) lea MEM_INDX1(s_ptr,s_size,l,4),R(s_ptr) @@ -142,5 +158,12 @@ L(LL1:) L(LLend:) /* Restore used registers from stack frame. */ moveml MEM_POSTINC(sp),R(d2)-R(d6)/R(a2) + cfi_adjust_cfa_offset (-6*4) + cfi_restore (R(d2)) + cfi_restore (R(d3)) + cfi_restore (R(d4)) + cfi_restore (R(d5)) + cfi_restore (R(d6)) + cfi_restore (R(a2)) rts END(__mpn_rshift) diff --git a/sysdeps/m68k/m680x0/sub_n.S b/sysdeps/m68k/m680x0/sub_n.S index 5833dd2..ab42743 100644 --- a/sysdeps/m68k/m680x0/sub_n.S +++ b/sysdeps/m68k/m680x0/sub_n.S @@ -1,7 +1,7 @@ /* mc68020 __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and store difference in a third limb vector. -Copyright (C) 1992, 1994, 1996, 1998 Free Software Foundation, Inc. +Copyright (C) 1992, 1994, 1996, 1998, 2012 Free Software Foundation, Inc. This file is part of the GNU MP Library. @@ -35,7 +35,11 @@ MA 02111-1307, USA. */ ENTRY(__mpn_sub_n) /* Save used registers on the stack. */ movel R(d2),MEM_PREDEC(sp) + cfi_adjust_cfa_offset (4) movel R(a2),MEM_PREDEC(sp) + cfi_adjust_cfa_offset (4) + cfi_rel_offset (R(d2), 4) + cfi_rel_offset (R(a2), 0) /* Copy the arguments to registers. Better use movem? */ movel MEM_DISP(sp,12),R(a2) @@ -70,7 +74,11 @@ L(L2:) /* Restore used registers from stack frame. */ movel MEM_POSTINC(sp),R(a2) + cfi_adjust_cfa_offset (-4) + cfi_restore (R(a2)) movel MEM_POSTINC(sp),R(d2) + cfi_adjust_cfa_offset (-4) + cfi_restore (R(d2)) rts END(__mpn_sub_n) diff --git a/sysdeps/m68k/memchr.S b/sysdeps/m68k/memchr.S index 77e86a3..e5c7677 100644 --- a/sysdeps/m68k/memchr.S +++ b/sysdeps/m68k/memchr.S @@ -1,7 +1,7 @@ /* memchr (str, ch, n) -- Return pointer to first occurrence of CH in the first N bytes of STR. For Motorola 68000. - Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2003, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Schwab . @@ -28,10 +28,20 @@ ENTRY(__memchr) /* Save the callee-saved registers we use. */ #ifdef __mcoldfire__ movel R(d2),MEM_PREDEC(sp) + cfi_adjust_cfa_offset (4) movel R(d3),MEM_PREDEC(sp) + cfi_adjust_cfa_offset (4) movel R(d4),MEM_PREDEC(sp) + cfi_adjust_cfa_offset (4) + cfi_rel_offset (R(d2), 8) + cfi_rel_offset (R(d3), 4) + cfi_rel_offset (R(d4), 0) #else moveml R(d2)-R(d4),MEM_PREDEC(sp) + cfi_adjust_cfa_offset (3*4) + cfi_rel_offset (R(d2), 0) + cfi_rel_offset (R(d3), 4) + cfi_rel_offset (R(d4), 8) #endif /* Get string pointer, character and length. */ @@ -234,13 +244,26 @@ L(L7:) movel R(d0),R(a0) #ifdef __mcoldfire__ movel MEM_POSTINC(sp),R(d4) + cfi_remember_state + cfi_adjust_cfa_offset (-4) + cfi_restore (R(d4)) movel MEM_POSTINC(sp),R(d3) + cfi_adjust_cfa_offset (-4) + cfi_restore (R(d3)) movel MEM_POSTINC(sp),R(d2) + cfi_adjust_cfa_offset (-4) + cfi_restore (R(d2)) #else moveml MEM_POSTINC(sp),R(d2)-R(d4) + cfi_remember_state + cfi_adjust_cfa_offset (-3*4) + cfi_restore (R(d2)) + cfi_restore (R(d3)) + cfi_restore (R(d4)) #endif rts + cfi_restore_state L(L8:) /* We have a hit. Check to see which byte it was. First compensate for the autoincrement in the loop. */ @@ -263,10 +286,20 @@ L(L9:) movel R(a0),R(d0) #ifdef __mcoldfire__ movel MEM_POSTINC(sp),R(d4) + cfi_adjust_cfa_offset (-4) + cfi_restore (R(d4)) movel MEM_POSTINC(sp),R(d3) + cfi_adjust_cfa_offset (-4) + cfi_restore (R(d3)) movel MEM_POSTINC(sp),R(d2) + cfi_adjust_cfa_offset (-4) + cfi_restore (R(d2)) #else moveml MEM_POSTINC(sp),R(d2)-R(d4) + cfi_adjust_cfa_offset (-3*4) + cfi_restore (R(d2)) + cfi_restore (R(d3)) + cfi_restore (R(d4)) #endif rts END(__memchr) diff --git a/sysdeps/m68k/rawmemchr.S b/sysdeps/m68k/rawmemchr.S index 97735f6..dd446cf 100644 --- a/sysdeps/m68k/rawmemchr.S +++ b/sysdeps/m68k/rawmemchr.S @@ -1,6 +1,6 @@ /* rawmemchr (str, ch) -- Return pointer to first occurrence of CH in STR. For Motorola 68000. - Copyright (C) 1999, 2002 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Schwab . @@ -26,7 +26,11 @@ ENTRY(__rawmemchr) /* Save the callee-saved registers we use. */ movel R(d2),MEM_PREDEC(sp) + cfi_adjust_cfa_offset (4) movel R(d3),MEM_PREDEC(sp) + cfi_adjust_cfa_offset (4) + cfi_rel_offset (R(d2), 4) + cfi_rel_offset (R(d3), 0) /* Get string pointer and character. */ movel MEM_DISP(sp,12),R(a0) @@ -182,7 +186,11 @@ L(L8:) L(L9:) movel R(a0),R(d0) movel MEM_POSTINC(sp),R(d3) + cfi_adjust_cfa_offset (-4) + cfi_restore (R(d3)) movel MEM_POSTINC(sp),R(d2) + cfi_adjust_cfa_offset (-4) + cfi_restore (R(d2)) rts END(__rawmemchr) diff --git a/sysdeps/m68k/strchr.S b/sysdeps/m68k/strchr.S index 2e1e324..6c6a08f 100644 --- a/sysdeps/m68k/strchr.S +++ b/sysdeps/m68k/strchr.S @@ -1,6 +1,6 @@ /* strchr (str, ch) -- Return pointer to first occurrence of CH in STR. For Motorola 68000. - Copyright (C) 1999, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2003, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Schwab . @@ -26,7 +26,11 @@ ENTRY(strchr) /* Save the callee-saved registers we use. */ movel R(d2),MEM_PREDEC(sp) + cfi_adjust_cfa_offset (4) movel R(d3),MEM_PREDEC(sp) + cfi_adjust_cfa_offset (4) + cfi_rel_offset (R(d2),4) + cfi_rel_offset (R(d3),0) /* Get string pointer and character. */ movel MEM_DISP(sp,12),R(a0) @@ -227,9 +231,15 @@ L(L3:) clrl R(d0) movel R(d0),R(a0) movel MEM_POSTINC(sp),R(d3) + cfi_remember_state + cfi_adjust_cfa_offset (-4) + cfi_restore (R(d3)) movel MEM_POSTINC(sp),R(d2) + cfi_adjust_cfa_offset (-4) + cfi_restore (R(d2)) rts + cfi_restore_state L(L8:) /* We have a hit. Check to see which byte it was. First compensate for the autoincrement in the loop. */ @@ -260,7 +270,11 @@ L(L8:) L(L9:) movel R(a0),R(d0) movel MEM_POSTINC(sp),R(d3) + cfi_adjust_cfa_offset (-4) + cfi_restore (R(d3)) movel MEM_POSTINC(sp),R(d2) + cfi_adjust_cfa_offset (-4) + cfi_restore (R(d2)) rts END(strchr) diff --git a/sysdeps/m68k/strchrnul.S b/sysdeps/m68k/strchrnul.S index 9d13ec1..e31cb0c 100644 --- a/sysdeps/m68k/strchrnul.S +++ b/sysdeps/m68k/strchrnul.S @@ -27,7 +27,11 @@ ENTRY(__strchrnul) /* Save the callee-saved registers we use. */ movel R(d2),MEM_PREDEC(sp) + cfi_adjust_cfa_offset (4) movel R(d3),MEM_PREDEC(sp) + cfi_adjust_cfa_offset (4) + cfi_rel_offset (R(d2), 4) + cfi_rel_offset (R(d3), 0) /* Get string pointer and character. */ movel MEM_DISP(sp,12),R(a0) @@ -253,7 +257,11 @@ L(L8:) L(L9:) movel R(a0),R(d0) movel MEM_POSTINC(sp),R(d3) + cfi_adjust_cfa_offset (-4) + cfi_restore (R(d3)) movel MEM_POSTINC(sp),R(d2) + cfi_adjust_cfa_offset (-4) + cfi_restore (R(d2)) rts END(__strchrnul) diff --git a/sysdeps/m68k/sysdep.h b/sysdeps/m68k/sysdep.h index ce70a0d..2b0e936 100644 --- a/sysdeps/m68k/sysdep.h +++ b/sysdeps/m68k/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for m68k. - Copyright (C) 1998, 2003, 2010 Free Software Foundation, Inc. + Copyright (C) 1998, 2003, 2010, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -54,10 +54,13 @@ ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function); \ .align ALIGNARG(2); \ C_LABEL(name) \ + cfi_startproc; \ CALL_MCOUNT # undef END -# define END(name) ASM_SIZE_DIRECTIVE(name) +# define END(name) \ + cfi_endproc; \ + ASM_SIZE_DIRECTIVE(name) /* If compiled for profiling, call `_mcount' at the start of each function. */ @@ -65,9 +68,12 @@ /* The mcount code relies on a normal frame pointer being on the stack to locate our caller, so push one just for its benefit. */ # define CALL_MCOUNT \ - move.l %fp, -(%sp); move.l %sp, %fp; \ + move.l %fp, -(%sp); \ + cfi_adjust_cfa_offset (4); cfi_rel_offset (%fp, 0); \ + move.l %sp, %fp; \ jbsr JUMPTARGET (mcount); \ - move.l (%sp)+, %fp; + move.l (%sp)+, %fp; \ + cfi_adjust_cfa_offset (-4); cfi_restore (%fp); # else # define CALL_MCOUNT /* Do nothing. */ # endif diff --git a/sysdeps/unix/sysv/linux/m68k/clone.S b/sysdeps/unix/sysv/linux/m68k/clone.S index 401e2ef..fa1b6b3 100644 --- a/sysdeps/unix/sysv/linux/m68k/clone.S +++ b/sysdeps/unix/sysv/linux/m68k/clone.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1996,97,98,2002,2010 Free Software Foundation, Inc. +/* Copyright (C) 1996,97,98,2002,2010,2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Schwab (schwab@issan.informatik.uni-dortmund.de) @@ -52,22 +52,36 @@ ENTRY (__clone) movel 12+0(%sp), %d1 /* get flags */ movel %d3, -(%a1) /* save %d3 and get parent_tidptr */ movel %d3, -(%sp) + cfi_adjust_cfa_offset (4) + cfi_rel_offset (%d3, 0) movel 20+4(%sp), %d3 movel %d4, -(%a1) /* save %d4 and get child_tidptr */ movel %d4, -(%sp) + cfi_adjust_cfa_offset (4) + cfi_rel_offset (%d4, 0) movel 28+8(%sp), %d4 movel %d5, -(%a1) /* save %d5 and get tls */ movel %d5, -(%sp) + cfi_adjust_cfa_offset (4) + cfi_rel_offset (%d5, 0) movel 24+12(%sp), %d5 /* save %d2 and get stack pointer */ #ifdef __mcoldfire__ movel %d2, -(%a1) movel %d2, -(%sp) + cfi_adjust_cfa_offset (4) + cfi_rel_offset (%d2, 0) movel %a1, %d2 #else exg %d2, %a1 /* save %d2 and get stack pointer */ + cfi_register (%d2, %a1) #endif movel #SYS_ify (clone), %d0 + + /* End FDE now, because in the child the unwind info will be + wrong. */ + cfi_endproc + trap #0 #ifdef __mcoldfire__ movel (%sp)+, %d2 @@ -115,6 +129,7 @@ donepid: trap #0 cfi_endproc + cfi_startproc PSEUDO_END (__clone) weak_alias (__clone, clone) diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/m68k-helpers.S b/sysdeps/unix/sysv/linux/m68k/coldfire/m68k-helpers.S index 242d23d..91f697b 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/m68k-helpers.S +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/m68k-helpers.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Free Software Foundation, Inc. +/* Copyright (C) 2010, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Maxim Kuvyrkov , 2010. @@ -41,12 +41,10 @@ .hidden __vdso_read_tp_stub ENTRY (__vdso_read_tp_stub) - cfi_startproc move.l #__NR_get_thread_area, %d0 trap #0 move.l %d0, %a0 rts - cfi_endproc END (__vdso_read_tp_stub) # ifdef SHARED @@ -59,13 +57,11 @@ END (__vdso_read_tp_stub) .hidden __m68k_read_tp # endif ENTRY (__m68k_read_tp) - cfi_startproc move.l #_GLOBAL_OFFSET_TABLE_@GOTPC, %a0 lea (-6, %pc, %a0), %a0 move.l M68K_VDSO_SYMBOL (__vdso_read_tp)@GOT(%a0), %a0 move.l (%a0), %a0 jmp (%a0) - cfi_endproc END (__m68k_read_tp) /* The following two stubs are for macros in atomic.h, they can't @@ -73,7 +69,6 @@ END (__m68k_read_tp) .hidden __vdso_atomic_cmpxchg_32_stub ENTRY (__vdso_atomic_cmpxchg_32_stub) - cfi_startproc move.l %d2, -(%sp) cfi_adjust_cfa_offset (4) cfi_rel_offset (%d2, 0) @@ -84,12 +79,10 @@ ENTRY (__vdso_atomic_cmpxchg_32_stub) cfi_adjust_cfa_offset (-4) cfi_restore (%d2) rts - cfi_endproc END (__vdso_atomic_cmpxchg_32_stub) .hidden __vdso_atomic_barrier_stub ENTRY (__vdso_atomic_barrier_stub) - cfi_startproc move.l %d0, -(%sp) cfi_adjust_cfa_offset (4) move.l #SYS_ify (atomic_barrier), %d0 @@ -97,7 +90,6 @@ ENTRY (__vdso_atomic_barrier_stub) move.l (%sp)+, %d0 cfi_adjust_cfa_offset (-4) rts - cfi_endproc END (__vdso_atomic_barrier_stub) # else /* !SHARED */ /* If the vDSO is not available, use a syscall to get TP. */ diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/m68k-helpers.S b/sysdeps/unix/sysv/linux/m68k/m680x0/m68k-helpers.S index 83ce564..46e1176 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/m68k-helpers.S +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/m68k-helpers.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Free Software Foundation, Inc. +/* Copyright (C) 2010, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Maxim Kuvyrkov , 2010. @@ -41,12 +41,10 @@ .hidden __vdso_read_tp_stub ENTRY (__vdso_read_tp_stub) - cfi_startproc move.l #__NR_get_thread_area, %d0 trap #0 move.l %d0, %a0 rts - cfi_endproc END (__vdso_read_tp_stub) # ifdef SHARED @@ -59,11 +57,9 @@ END (__vdso_read_tp_stub) .hidden __m68k_read_tp # endif ENTRY (__m68k_read_tp) - cfi_startproc lea _GLOBAL_OFFSET_TABLE_@GOTPC(%pc), %a0 move.l M68K_VDSO_SYMBOL (__vdso_read_tp)@GOT(%a0), %a0 jmp ([%a0]) - cfi_endproc END (__m68k_read_tp) /* The following two stubs are for macros in atomic.h, they can't @@ -71,7 +67,6 @@ END (__m68k_read_tp) .hidden __vdso_atomic_cmpxchg_32_stub ENTRY (__vdso_atomic_cmpxchg_32_stub) - cfi_startproc move.l %d2, -(%sp) cfi_adjust_cfa_offset (4) cfi_rel_offset (%d2, 0) @@ -82,12 +77,10 @@ ENTRY (__vdso_atomic_cmpxchg_32_stub) cfi_adjust_cfa_offset (-4) cfi_restore (%d2) rts - cfi_endproc END (__vdso_atomic_cmpxchg_32_stub) .hidden __vdso_atomic_barrier_stub ENTRY (__vdso_atomic_barrier_stub) - cfi_startproc move.l %d0, -(%sp) cfi_adjust_cfa_offset (4) move.l #SYS_ify (atomic_barrier), %d0 @@ -95,7 +88,6 @@ ENTRY (__vdso_atomic_barrier_stub) move.l (%sp)+, %d0 cfi_adjust_cfa_offset (-4) rts - cfi_endproc END (__vdso_atomic_barrier_stub) # else /* !SHARED */ /* If the vDSO is not available, use a syscall to get TP. */ diff --git a/sysdeps/unix/sysv/linux/m68k/nptl/sysdep-cancel.h b/sysdeps/unix/sysv/linux/m68k/nptl/sysdep-cancel.h index 87e2d55..f52b0fe 100644 --- a/sysdeps/unix/sysv/linux/m68k/nptl/sysdep-cancel.h +++ b/sysdeps/unix/sysv/linux/m68k/nptl/sysdep-cancel.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Free Software Foundation, Inc. +/* Copyright (C) 2010, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Maxim Kuvyrkov , 2010. @@ -40,7 +40,6 @@ rts; \ .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \ .Lpseudo_cancel: \ - cfi_startproc; \ CENABLE; \ DOCARGS_##args \ move.l %d0, -(%sp); /* Save result of CENABLE. */ \ @@ -54,8 +53,7 @@ move.l %d2, %d0; \ UNDOCARGS_##args \ cmp.l &-4095, %d0; \ - jcc SYSCALL_ERROR_LABEL; \ - cfi_endproc + jcc SYSCALL_ERROR_LABEL /* Note: we use D2 to save syscall's return value as D0 will be clobbered in CDISABLE. */ diff --git a/sysdeps/unix/sysv/linux/m68k/semtimedop.S b/sysdeps/unix/sysv/linux/m68k/semtimedop.S index 2775c12..9da88b9 100644 --- a/sysdeps/unix/sysv/linux/m68k/semtimedop.S +++ b/sysdeps/unix/sysv/linux/m68k/semtimedop.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2003 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Schwab , 2003. @@ -34,7 +34,12 @@ ENTRY (semtimedop) /* Save registers. */ move.l %d2, %a1 move.l %d3, -(%sp) + cfi_adjust_cfa_offset (4) move.l %d5, -(%sp) + cfi_adjust_cfa_offset (4) + cfi_register (%d2, %a1) + cfi_rel_offset (%d3, 0) + cfi_rel_offset (%d5, 4) move.l #SYSOP_semtimedop, %d1 move.l SEMID(%sp), %d2 @@ -47,8 +52,13 @@ ENTRY (semtimedop) /* Restore registers. */ move.l (%sp)+, %d5 + cfi_adjust_cfa_offset (-4) + cfi_restore (%d5) move.l (%sp)+, %d3 + cfi_adjust_cfa_offset (-4) + cfi_restore (%d3) move.l %a1, %d2 + cfi_restore (%d2) /* Check for error. */ tst.l %d0 diff --git a/sysdeps/unix/sysv/linux/m68k/socket.S b/sysdeps/unix/sysv/linux/m68k/socket.S index 147a3b2..38aaa17 100644 --- a/sysdeps/unix/sysv/linux/m68k/socket.S +++ b/sysdeps/unix/sysv/linux/m68k/socket.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 1998, 2010 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 1998, 2010, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -51,6 +51,7 @@ ENTRY (__socket) /* Save registers. */ move.l %d2, %a0 + cfi_register (%d2, %a0) move.l #SYS_ify (socketcall), %d0 /* System call number in %d0. */ @@ -64,6 +65,7 @@ ENTRY (__socket) /* Restore registers. */ move.l %a0, %d2 + cfi_restore (%d2) /* %d0 is < 0 if there was an error. */ tst.l %d0 @@ -73,8 +75,7 @@ ENTRY (__socket) rts #ifdef NEED_CANCELLATION -1: cfi_startproc - /* Enable asynchronous cancellation. */ +1: /* Enable asynchronous cancellation. */ CENABLE /* Save D2. */ @@ -110,7 +111,6 @@ ENTRY (__socket) /* %d0 is < 0 if there was an error. */ tst.l %d0 jmi SYSCALL_ERROR_LABEL - cfi_endproc /* Successful; return the syscall's value. */ rts diff --git a/sysdeps/unix/sysv/linux/m68k/sysdep.S b/sysdeps/unix/sysv/linux/m68k/sysdep.S index e4ec92d..2277aab 100644 --- a/sysdeps/unix/sysv/linux/m68k/sysdep.S +++ b/sysdeps/unix/sysv/linux/m68k/sysdep.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1996, 2002, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -37,8 +37,10 @@ ENTRY (__syscall_error) move.l %d0, errno #else move.l %d0, -(%sp) + cfi_adjust_cfa_offset (4) jbsr __errno_location move.l (%sp)+, (%a0) + cfi_adjust_cfa_offset (-4) #endif move.l #-1, %d0 /* Copy return value to %a0 for syscalls that are declared to diff --git a/sysdeps/unix/sysv/linux/m68k/sysdep.h b/sysdeps/unix/sysv/linux/m68k/sysdep.h index 28113ac..1e27554 100644 --- a/sysdeps/unix/sysv/linux/m68k/sysdep.h +++ b/sysdeps/unix/sysv/linux/m68k/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 1998, 2000, 2003, 2004, 2006, 2010 +/* Copyright (C) 1996, 1997, 1998, 2000, 2003, 2004, 2006, 2010, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Andreas Schwab, , @@ -116,10 +116,12 @@ SYSCALL_ERROR_LABEL: \ SYSCALL_ERROR_LABEL: \ neg.l %d0; \ move.l %d0, -(%sp); \ + cfi_adjust_cfa_offset (4); \ jbsr __m68k_read_tp@PLTPC; \ SYSCALL_ERROR_LOAD_GOT (%a1); \ add.l (SYSCALL_ERROR_ERRNO@TLSIE, %a1), %a0; \ move.l (%sp)+, (%a0); \ + cfi_adjust_cfa_offset (-4); \ move.l &-1, %d0; \ /* Copy return value to %a0 for syscalls that are declared to return \ a pointer (e.g., mmap). */ \ @@ -184,24 +186,35 @@ SYSCALL_ERROR_LABEL: \ #define UNDOARGS_1 UNDOARGS_0 #define DOARGS_2 _DOARGS_2 (8) -#define _DOARGS_2(n) move.l %d2, %a0; move.l n(%sp), %d2; _DOARGS_1 (n-4) -#define UNDOARGS_2 UNDOARGS_1; move.l %a0, %d2 +#define _DOARGS_2(n) move.l %d2, %a0; cfi_register (%d2, %a0); \ + move.l n(%sp), %d2; _DOARGS_1 (n-4) +#define UNDOARGS_2 UNDOARGS_1; move.l %a0, %d2; cfi_restore (%d2) #define DOARGS_3 _DOARGS_3 (12) -#define _DOARGS_3(n) move.l %d3, %a1; move.l n(%sp), %d3; _DOARGS_2 (n-4) -#define UNDOARGS_3 UNDOARGS_2; move.l %a1, %d3 +#define _DOARGS_3(n) move.l %d3, %a1; cfi_register (%d3, %a1); \ + move.l n(%sp), %d3; _DOARGS_2 (n-4) +#define UNDOARGS_3 UNDOARGS_2; move.l %a1, %d3; cfi_restore (%d3) #define DOARGS_4 _DOARGS_4 (16) -#define _DOARGS_4(n) move.l %d4, -(%sp); move.l n+4(%sp), %d4; _DOARGS_3 (n) -#define UNDOARGS_4 UNDOARGS_3; move.l (%sp)+, %d4 +#define _DOARGS_4(n) move.l %d4, -(%sp); \ + cfi_adjust_cfa_offset (4); cfi_rel_offset (%d4, 0); \ + move.l n+4(%sp), %d4; _DOARGS_3 (n) +#define UNDOARGS_4 UNDOARGS_3; move.l (%sp)+, %d4; \ + cfi_adjust_cfa_offset (-4); cfi_restore (%d4) #define DOARGS_5 _DOARGS_5 (20) -#define _DOARGS_5(n) move.l %d5, -(%sp); move.l n+4(%sp), %d5; _DOARGS_4 (n) -#define UNDOARGS_5 UNDOARGS_4; move.l (%sp)+, %d5 +#define _DOARGS_5(n) move.l %d5, -(%sp); \ + cfi_adjust_cfa_offset (4); cfi_rel_offset (%d5, 0); \ + move.l n+4(%sp), %d5; _DOARGS_4 (n) +#define UNDOARGS_5 UNDOARGS_4; move.l (%sp)+, %d5; \ + cfi_adjust_cfa_offset (-4); cfi_restore (%d5) #define DOARGS_6 _DOARGS_6 (24) -#define _DOARGS_6(n) _DOARGS_5 (n-4); move.l %a0, -(%sp); move.l n+12(%sp), %a0; -#define UNDOARGS_6 move.l (%sp)+, %a0; UNDOARGS_5 +#define _DOARGS_6(n) _DOARGS_5 (n-4); move.l %a0, -(%sp); \ + cfi_adjust_cfa_offset (4); \ + move.l n+12(%sp), %a0; +#define UNDOARGS_6 move.l (%sp)+, %a0; cfi_adjust_cfa_offset (-4); \ + UNDOARGS_5 #define ret rts diff --git a/sysdeps/unix/sysv/linux/m68k/vfork.S b/sysdeps/unix/sysv/linux/m68k/vfork.S index 4def7e3..9747302 100644 --- a/sysdeps/unix/sysv/linux/m68k/vfork.S +++ b/sysdeps/unix/sysv/linux/m68k/vfork.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2002, 2003, 2010 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2002, 2003, 2010, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Schwab . @@ -46,6 +46,8 @@ ENTRY (__vfork) /* Pop the return PC value into A0. */ movel %sp@+, %a0 + cfi_adjust_cfa_offset (-4) + cfi_register (%pc, %a0) /* Stuff the syscall number in D0 and trap into the kernel. */ movel #SYS_ify (vfork), %d0 @@ -62,6 +64,8 @@ ENTRY (__vfork) .Lerror: /* Push back the return PC. */ movel %a0,%sp@- + cfi_adjust_cfa_offset (4) + cfi_rel_offset (%pc, 0) # ifdef __ASSUME_VFORK_SYSCALL # ifndef PIC