This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/2] Fast tracepoint for powerpc64le
- From: Wei-cheng Wang <cole945 at gmail dot com>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 30 Mar 2015 03:36:12 +0800
- Subject: Re: [PATCH 2/2] Fast tracepoint for powerpc64le
- Authentication-results: sourceware.org; auth=none
- References: <201503171829 dot t2HIT1kc016415 at d06av02 dot portsmouth dot uk dot ibm dot com>
On 2015/3/18 äå 02:29, Ulrich Weigand wrote:
Power8, we might be able to use a bctar, but we may not be able to rely
on the TAR register being available.)
If I clobbered TAR register, won't it affect the user code?
As a first implementation, I guess I'd be fine with those) restriction,
but we should be thinking of how we could lift (some of) them. We might
want to, for example,
- determine the actual mapping base of the main executable and place
the jump pad close even if it is not at the default address
How about this? AT_PHDR should be at the very beginning of the first
loadable segment of the executable. This should work for PIE.
uintptr_t
jump_pad_area_hint (void)
{
/* Use AT_PHDR address to guess where the main executable is mapped,
and try to map the jump pad before it. The jump pad should be
closed enough to the executable for unconditional branch (+/- 32MB). */
uintptr_t base = getauxval (AT_PHDR);
uintptr_t pagesz = sysconf (_SC_PAGE_SIZE);
uintptr_t hint = (base & ~(pagesz - 1)) - 1 * 1024 * 1024;
/* Is wrap around? */
if (hint > base)
hint = pagesz;
return hint;
}
Thanks,
Wei-cheng