This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix ____longjmp_chk for ppc(64)


On Wed, Jun 24, 2009 at 10:28:39AM -0700, Richard Henderson wrote:
> On 06/24/2009 10:15 AM, Jakub Jelinek wrote:
>>   	bl	HIDDEN_JUMPTARGET (__fortify_fail);	\
>>   .Lok:							\
>> 	mr	r1, reg;				\
>> +	cfi_adjust_cfa_offset (-112);			\
>> +	cfi_same_value (lr)
>>
>> and remove the mr r1, r14 resp. mr r1, r22 from __longjmp-common.S?
>> Then you don't need to add any extra insn.
>
> The cfa is incorrect for the duration of the mr r1 insn.

Ah, but in that case can't be the cfi directives be right after bl?
The unwinders subtract one when looking for which cfi directives to apply,
unless in signal frame:
  /* The comparison with the return address uses < rather than <= because
     we are only interested in the effects of code before the call; for a
     noreturn function, the return address may point to unrelated code with
     a different stack configuration that we are not interested in.  We
     assume that the call itself is unwind info-neutral; if not, or if
     there are delay instructions that adjust the stack, these must be
     reflected at the point immediately before the call insn.
     In signal frames, return address is after last completed instruction,
     so we add 1 to return address to make the comparison <=.  */
  while (insn_ptr < insn_end
         && fs->pc < context->ra + _Unwind_IsSignalFrame (context))
...

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]