This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH roland/arm] ARM: Consolidate with generic unwinder wrapper code

On Wed, 17 Dec 2014, Roland McGrath wrote:

> This cleans up the ARM-specific unwinder wrappers to accomplish these things:
> 1. Move out of sysdeps/unix/sysv/linux/arm/ code that is not actually
>    Linux-specific.
> 2. Eliminate duplication of the wrapper code between ARM-specific and
>    generic code, with attendant skew.  To wit, this makes the ARM code
>    use pointer mangling for the stored function pointers, as the generic
>    code already does.  (The other difference is using LIBGCC_S_SO rather
>    than hard-coded strings.)
> 3. Don't duplicate the ARM assembly code in two source files.
> 4. Move ARM assembly code from asm(...) into .S files, where it can take
>    advantage of all our handy assembly macros.  In particular, being able
>    to use PTR_DEMANGLE makes the pointer mangling support tractable, and
>    being able to use LDR_HIDDEN is both an optimization from what was there
>    before and makes this assembly code compatible with ARM_NO_INDEX_REGISTER
>    configurations without any extra work.
> While I was there, I also took the opportunity to rewrite the assembly stub
> altogether.  Now it avoids frame setup for the fast path.
> Verified no significant changes in generated code on x86_64-linux-gnu.
> Tested no 'make check' regressions on armv7-linux-gnueabihf.
> OK?

OK with a comment fixed as noted.

> +ENTRY (_Unwind_Resume)
> +	LDR_HIDDEN (ip, ip, __libgcc_s_resume, 0)
> +	cmp	ip, #0
> +	beq	1f
> +0:	PTR_DEMANGLE (ip, ip, r2, r3)
> +	bx	ip
> +
> +	/* We only really need to save and restore LR, but
> +	   the ABI requires the stack be kept aligned to 8 bytes,
> +	   so we push and pop r0 as well just to even out the stack.  */

r0 *does* need to be saved and restored, because it contains the argument 
being passed to _Unwind_Resume, and so needs to be preserved across the 
call to __libgcc_s_init which could clobber it.

Joseph S. Myers

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]