This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Re: [PATCH v2] ARM: Add SystemTap probes to longjmp and setjmp.
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: Will Newton <will dot newton at linaro dot org>, Roland McGrath <roland at hack dot frob dot com>, "libc-ports at sourceware dot org" <libc-ports at sourceware dot org>, Patch Tracking <patches at linaro dot org>
- Date: Fri, 7 Feb 2014 17:03:59 +0000
- Subject: Re: [PATCH v2] ARM: Add SystemTap probes to longjmp and setjmp.
- Authentication-results: sourceware.org; auth=none
- References: <1391594162-22269-1-git-send-email-will dot newton at linaro dot org> <20140206221127 dot 6E28974443 at topped-with-meat dot com> <CANu=DmjAG8zxFOwWeJZuEFLXEcSTROVZsR1oRZc9qx=Zcn9T-w at mail dot gmail dot com> <8761orknyz dot fsf at igel dot home>
On Fri, 7 Feb 2014, Andreas Schwab wrote:
> Will Newton <will.newton@linaro.org> writes:
>
> > In order to have the correct registers live I need to free up a temp
> > register which involves loading lr and sp earlier than the
> > call-preserved register set. I could do this by offsetting into the
> > jmpbuf but it seems more natural just to move lr and sp to the front
> > of the jmp_buf and load registers in ascending order. As far as I am
> > aware the layout of jmp_buf is completely opaque so I don't see why
> > this would cause any problems?
>
> According to ports/sysdeps/arm/bits/setjmp.h the layout of jmp_buf is
> part of the ABI.
No, it's not. The ABI requirement is 8-byte alignment. I'm not sure
where "recommends that the buffer contain 64 words" comes from; it doesn't
seem to be in the current version of CLIBABI, or any version I checked
back to 2005, but maybe it was in some prerelease version. "The first 27
words are occupied by" is a statement of fact[*], that any patch changing
the layout needs to update, not a statement of an ABI requirement.
CLIBABI says "The type and size of jmp_buf are defined by setjmp.h. Its
contents are opaque, so setjmp and longjmp must be from the same library,
and called out of line.", and that opaqueness leaves us free to change the
layout between releases, if there is some reason to do so - setjmp and
longjmp always need to come from the same library.
[*] The references to 27 and 17 are inaccurate - we haven't been using
fstmx since:
2009-10-22 Andrew Stubbs <ams@codesourcery.com>
Julian Brown <julian@codesourcery.com>
* sysdeps/arm/eabi/setjmp.S (__sigsetjmp): Replace deprecated
instruction fstmiax with vstmia.
Correct register conflict and comment.
* sysdeps/arm/eabi/__longjmp.S (__longjmp): Use vldmia not fldmiax.
Don't clobber r1/a2 register before testing IWMMXT hwcap.
--
Joseph S. Myers
joseph@codesourcery.com