[PATCH] fix bz #16169 - CFI directives missing from AArch64 clone.S
Marcus Shawcroft
marcus.shawcroft@gmail.com
Fri Jan 17 18:55:00 GMT 2014
Hi
On 16 January 2014 20:31, Tom Tromey <tromey@redhat.com> wrote:
> svc 0x0
> + cfi_endproc
The cfi_endproc placement looks sensible to me.
> + cfi_startproc
> + cfi_undefined lr
The cfi_undefined is missing () and the convenience name 'lr' is not
known to GAS, therefore this line should be:
cfi_undefined (x30)
In the ticket Tom points out that the implementation does not honour
the AAPCS, the fix is to insert:
mov x29, 0
> #ifdef RESET_PID
> tbnz x5, #CLONE_THREAD_BIT, 3f
> mov x0, #-1
> @@ -93,7 +96,9 @@ ENTRY(__clone)
>
> /* We are done, pass the return value through x0. */
> b HIDDEN_JUMPTARGET(_exit)
> + cfi_endproc
>
> + cfi_startproc
This part looks fine.
Attached is a revised version of your patch including the two changes
listed above. If there are no further comments in the next 24hrs or so
I'll commit this and address Joseph's comment w.r.t ChangeLog and
NEWS.
Cheers
/Marcus
-------------- next part --------------
diff --git a/ports/sysdeps/unix/sysv/linux/aarch64/clone.S b/ports/sysdeps/unix/sysv/linux/aarch64/clone.S
index 2ca8021..f2964f4 100644
--- a/ports/sysdeps/unix/sysv/linux/aarch64/clone.S
+++ b/ports/sysdeps/unix/sysv/linux/aarch64/clone.S
@@ -63,6 +63,7 @@ ENTRY(__clone)
mov x8, #SYS_ify(clone)
/* X0:flags, x1:newsp, x2:parenttidptr, x3:newtls, x4:childtid. */
svc 0x0
+ cfi_endproc
cmp x0, #0
beq 2f
blt 3f
@@ -72,6 +73,9 @@ ENTRY(__clone)
b syscall_error
2:
+ cfi_startproc
+ cfi_undefined (x30)
+ mov x29, 0
#ifdef RESET_PID
tbnz x5, #CLONE_THREAD_BIT, 3f
mov x0, #-1
@@ -93,7 +97,8 @@ ENTRY(__clone)
/* We are done, pass the return value through x0. */
b HIDDEN_JUMPTARGET(_exit)
-
+ cfi_endproc
+ cfi_startproc
PSEUDO_END (__clone)
weak_alias (__clone, clone)
More information about the Libc-alpha
mailing list