This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Re: [PATCH] [AARCH64]: Pointer mangling support for Aarch64
- From: Venkataramanan Kumar <venkataramanan dot kumar at linaro dot org>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: libc-ports at sourceware dot org, Marcus Shawcroft <marcus dot shawcroft at gmail dot com>, Marcus Shawcroft <marcus dot shawcroft at arm dot com>, "Carlos O'Donell" <carlos at redhat dot com>, Patch Tracking <patch at linaro dot org>
- Date: Tue, 7 Jan 2014 16:35:25 +0530
- Subject: Re: [PATCH] [AARCH64]: Pointer mangling support for Aarch64
- Authentication-results: sourceware.org; auth=none
- References: <CAJK_mQ0EoE+_JQvSL+5=C_+Q6JgsV8hvXipy8OgR8+GYyYgt3A at mail dot gmail dot com> <87iotxm15i dot fsf at fleche dot redhat dot com>
Hi,
The mangling patch is already up streamed. So I will include this
addition as a separate patch.
I looked at x86 and powerpc ports. So for Aarch64
longjmp/longjmp_target probe expects
* first argument 8@address of jmpbuf in x0.
* second argument -4@return val in x1.
* third argument 8@ address of target in LR/X30.
The patch below does that.
(--snip--)
--- a/ports/sysdeps/aarch64/__longjmp.S
+++ b/ports/sysdeps/aarch64/__longjmp.S
@@ -18,6 +18,7 @@
#include <sysdep.h>
#include <jmpbuf-offsets.h>
+#include <stap-probe.h>
/* __longjmp(jmpbuf, val) */
@@ -56,6 +57,7 @@ ENTRY (__longjmp)
#else
ldp x29, x30, [x0, #JB_X29<<3]
#endif
+ LIBC_PROBE (longjmp, 3, 8@x0, -4@x1, 8@x30)
ldp d8, d9, [x0, #JB_D8<<3]
ldp d10, d11, [x0, #JB_D10<<3]
ldp d12, d13, [x0, #JB_D12<<3]
@@ -97,6 +99,7 @@ ENTRY (__longjmp)
#else
ldr x5, [x0, #JB_SP<<3]
#endif
+ LIBC_PROBE (longjmp_target, 3, 8@x0, -4@x1, 8@x30)
mov sp, x5
cmp x1, #0
mov x0, #1
(--snip--)
Please let me know if this is fine, I will start doing the testing.
regards,
Venkat.
On 6 January 2014 23:40, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> ">" == Venkataramanan Kumar <venkataramanan.kumar@linaro.org> writes:
>
>>> This patch adds pointer mangling support for Aarch64.
>
> IIRC the Aarch64 longjmp code doesn't have the sdt.h probes in place.
> If you add pointer mangling without also adding the sdt.h probes, then
> gdb's longjmp support will break. You should be able to see this easily
> in the gdb test suite.
>
> Adding the probes is quite easy to do, so I encourage you to add that
> to the patch.
>
> thanks,
> Tom