This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: RFA: Fix MIPS/Linux unwinding for big-endian


On Fri, Jan 19, 1996 at 08:33:02PM +0000, Maciej W. Rozycki wrote:
> On Thu, 3 Feb 2005, Daniel Jacobowitz wrote:
> 
> > For mips-linux (o32 ABI), the signal frame layout is a little odd.  The
> > registers are all saved as eight-byte quantities even though they are 32-bit
> > values.  For little-endian, we don't need to do anything; but for big-endian
> > we need to bias all the CFA offsets by four bytes, or we can't unwind
> > through signal frames.
> [...]
> > @@ -78,6 +78,13 @@ mips_fallback_frame_state (struct _Unwin
> >    fs->cfa_reg = STACK_POINTER_REGNUM;
> >    fs->cfa_offset = new_cfa - (_Unwind_Ptr) context->cfa;
> >  
> > +#if defined _ABIO32 && _MIPS_SIM == _ABIO32 && defined __MIPSEB__
> > +  /* On o32 Linux, the register save slots in the sigcontext are
> > +     eight bytes.  We need the lower half of each register slot,
> > +     so slide our view of the structure back four bytes.  */
> > +  new_cfa -= 4;
> > +#endif
> > +
> 
>  Hmm, shouldn't it depend on run-time configuration?  Will it still work 
> correctly if I invoke GCC in the other endianness or with a non-default 
> ABI, like `mips-linux-gcc -mel' or `mips64el-linux-gcc -mabi=32'?

Yes, it will work.  This code is included in libgcc.  If your libgcc
doesn't have the same ABI and endianness as your application, you've
got bigger problems :-)

-- 
Daniel Jacobowitz


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