This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH roland/arm] ARM: Consolidate with generic unwinder wrapper code
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: "GNU C. Library" <libc-alpha at sourceware dot org>
- Date: Thu, 18 Dec 2014 18:12:40 +0000
- Subject: Re: [PATCH roland/arm] ARM: Consolidate with generic unwinder wrapper code
- Authentication-results: sourceware.org; auth=none
- References: <20141218000551 dot EF87B2C3ABF at topped-with-meat dot com>
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
> 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 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