This is the mail archive of the gcc@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]

Re: libgcc problems


On 15-Jan-98 David Edelsohn wrote:
>>>>>> Jeffrey A Law writes:
> 
>>> Understand. Uphh! After long debugging I found a problem! This is because
>>> in current exception handling implementation __sjthrow() code can not
>>> be in shared library. Otherwise, no operation to restore original TOC
>>> anchor pointer is performed.
> 
>       I guess I do not understand if this is a general problem and
> nonlocal_goto_receiver needs to be fixed regardless.  Is the issue that
> __sjthrow() must have local copies for each module or __sjthrow() cannot
> throw through a shared library?  If the former, isn't this yet another
> reason not to make libgcc.a shared -- at least on AIX?

I agree that it is better to have local copies of __sjthrow() and
other exception handling functions - this avoid overhead with
glink code. But __terminate_func is rare used and can go to
shared library. More difficult to decide what to do with
top_elt and get_eh_context, which are static variables and *must*
have only one instance. I didn't looked if there is any overhead
accessing non-local variables (as with non-local functions). If no,
they also can be shared.

>       The general answer is to find someone who has the time to
> correctly implement exception handling on AIX.  The PowerOpen ABI adds an
> epilogue to each function which specifically provides the information
> necessary to walk the stack.  This will save the sjlj space, be compatible
> with C-Set++, and be more efficient.  Someone just needs to take the time
> to teach the GCC exception handling code about this -- I can provide
> guidance but do not have the time to implement it myself.

Interesting, is there some code reserved for exception handling
in AIX libc (or all C++ specific code is in xlC's libC), and if yes,
can this code be used for gcc's purposes. E.g. if libc already
containes pointer to terminate handler, we can use it instead
of __terminate_func.
David, do you have any references to mentioned PowerOpen ABI?
This is very interesting in any case...

> 
>       I would think that implementing exception handling correctly for
> AIX would be a better way to spend the time than fixing something that
> only is broken because of the sjlj implementation of exception handling.

I'm not sure that AIX native tools don't use some global variables,
but these tools are not limited by a condition of static libgcc.
So, exception handling implementations other than sjlj may also cause
problems on AIX unless we make some of libgcc code shared.

Andrey.



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