This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Marking the end of a function
- From: Andrew Haley <aph at redhat dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 2 Oct 2002 17:42:41 +0100 (BST)
- Subject: Re: Marking the end of a function
- References: <200209251742.g8PHgjR12976@cuddles.cambridge.redhat.com><20020926001346.GK8492@redhat.com><15762.51664.377932.591774@cuddles.cambridge.redhat.com><20020926234744.GE17927@redhat.com><15764.6319.942777.657613@cuddles.cambridge.redhat.com><20020927162736.GD19327@redhat.com><15764.35805.598709.261477@cuddles.cambridge.redhat.com><20020927203013.GB19608@redhat.com>
Richard Henderson writes:
> On Fri, Sep 27, 2002 at 05:48:29PM +0100, Andrew Haley wrote:
> > .word foo
> > .word foo_end
> >
> > and both are put in a DSO, these will not be fixed up to point
> > directly to the code but to PLT entries?
>
> No, but they'll get runtime relocations. And a dynamic symbol
> lookup, so they may point to symbols in a different DSO.
>
> > I don't want to do it again for IA-64, mostly! In any case, is
> > _Unwind_Find_FDE and the structures it uses public?
>
> No, not really, since the data is in a different form for IA-64.
> But it would be easy enough to add a function that returns the
> beginning (and end?) of a function that contains a particular PC.
Like this?
Andrew.
2002-10-02 Andrew Haley <aph@redhat.com>
* config/ia64/unwind-ia64.c (_Unwind_Find_Enclosing_Function): New.
* unwind-sjlj.c (_Unwind_Find_Enclosing_Function): Likewise.
* unwind-dw2.c (_Unwind_Find_Enclosing_Function): Likewise.
Index: unwind.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/unwind.h,v
retrieving revision 1.6
diff -p -2 -c -r1.6 unwind.h
*** unwind.h 15 Aug 2002 18:01:30 -0000 1.6
--- unwind.h 2 Oct 2002 16:38:42 -0000
*************** extern void *_Unwind_GetLanguageSpecific
*** 136,139 ****
--- 136,141 ----
extern _Unwind_Ptr _Unwind_GetRegionStart (struct _Unwind_Context *);
+ /* Given a PC, return the address of the function it's in. */
+ extern void * _Unwind_Find_Enclosing_Function (void *);
/* The personality routine is the function in the C++ (or other language)
Index: unwind-dw2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/unwind-dw2.c,v
retrieving revision 1.20
diff -p -2 -c -r1.20 unwind-dw2.c
*** unwind-dw2.c 31 May 2002 22:15:39 -0000 1.20
--- unwind-dw2.c 2 Oct 2002 16:38:41 -0000
*************** _Unwind_GetRegionStart (struct _Unwind_C
*** 203,206 ****
--- 203,217 ----
}
+ void *
+ _Unwind_Find_Enclosing_Function (void *pc)
+ {
+ struct dwarf_eh_bases bases;
+ struct dwarf_fde *fde = _Unwind_Find_FDE (pc-1, &bases);
+ if (fde)
+ return bases.func;
+ else
+ return NULL;
+ }
+
#ifndef __ia64__
_Unwind_Ptr
Index: unwind-sjlj.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/unwind-sjlj.c,v
retrieving revision 1.9
diff -p -2 -c -r1.9 unwind-sjlj.c
*** unwind-sjlj.c 15 Sep 2002 22:48:02 -0000 1.9
--- unwind-sjlj.c 2 Oct 2002 16:38:41 -0000
*************** _Unwind_GetRegionStart (struct _Unwind_C
*** 209,212 ****
--- 209,218 ----
}
+ void *
+ _Unwind_Find_Enclosing_Function (void *pc)
+ {
+ return NULL;
+ }
+
#ifndef __ia64__
_Unwind_Ptr
cvs server: I know nothing about gengtype-yacc.h
Index: config/ia64/unwind-ia64.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/unwind-ia64.c,v
retrieving revision 1.10
diff -p -2 -c -r1.10 unwind-ia64.c
*** config/ia64/unwind-ia64.c 1 Apr 2002 23:28:46 -0000 1.10
--- config/ia64/unwind-ia64.c 2 Oct 2002 16:38:42 -0000
*************** _Unwind_GetRegionStart (struct _Unwind_C
*** 1643,1646 ****
--- 1643,1651 ----
}
+ void *
+ _Unwind_Find_Enclosing_Function (void *pc)
+ {
+ return NULL;
+ }
static _Unwind_Reason_Code