This is the mail archive of the libc-alpha@sourceware.cygnus.com 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]

Re: Problems with exception handling in glibc and gcc.


> Date: Sun, 2 Jul 2000 08:41:38 -0700
> From: "H . J . Lu" <hjl@lucon.org>

> I'd like to get it fixed. Should I investigaten it? I think we
> should not export the default version, only the old one for binary
> compatibility. We then make sure the main binary always export them
> if they are used.

This causes problems with new shared libraries (like new versions of
glibc) and old applications.  Don't do it.


Anyway, I believe that any problems you're seeing are most likely
caused by the new dwarf opcode, DW_CFA_def_cfa_expression, being used
by mistake on an existing target (like x86).  You could place a
breakpoint in this chunk of code in dwarf2out.c:

      /* If the src is our current CFA, and it isn't the SP or FP, then we're
         going to have to use an indrect mechanism.  */
      if (REGNO (src) != STACK_POINTER_REGNUM 
	  && REGNO (src) != HARD_FRAME_POINTER_REGNUM 
	  && (unsigned) REGNO (src) == cfa.reg)
	{
	  /* We currently allow this to be ONLY a MEM or MEM + offset.  */
	  rtx x = XEXP (dest, 0);
	  int offset = 0;
	  if (GET_CODE (x) == PLUS || GET_CODE (x) ==  MINUS)
	    {
	      offset = INTVAL (XEXP (x, 1));
	      if (GET_CODE (x) == MINUS)
		offset = -offset;
	      x = XEXP (x, 0);
	    }
	  if (GET_CODE (x) != REG)
	    abort ();
	  cfa.reg = (unsigned) REGNO (x);
	  cfa.base_offset = offset;
	  cfa.indirect = 1;
	  def_cfa_1 (label, &cfa);
	  break;
	}

put a breakpoint or an abort() before the 'break;' and see if it
triggers.  For backwards compatibility, it should never trigger on any
linux target (like x86, sparc, mips, alpha, etc.).  If it does, and
it's supposed to, then the release notes for gcc need to be updated to
advise that on linux systems glibc must be built with the new gcc
before exception-handling will work.  I expect though that it's just a
bug in the new code, since EH worked fine on these targets before
without needing this opcode.

I believe that this change can't cause problems on powerpc, because of
the way rs6000_frame_related is used, but I may be wrong.

-- 
- Geoffrey Keating <geoffk@cygnus.com>

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