This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


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

Re: initializing eh


>> I'm interested in the exception handling. I'm writing in C++ for the linux
>> kernel therefore I have to bring all components with me. Some of the gcc code
>> related to exceptions, rtti I have collected to a package. The problem is how
>> to initlialize the eh. For global CTors/DTors I have to call
>> __do_global_Xtor_aux(). This does initialize some of the eh as well but, it
>> seems not to be enough. I can't catch exceptions. The problem is that I can't
>> use the .init / .finit section of the elf format - I have to call it by hand.
>> What are the requiered functions. In the code there are some helper functions.
>> Some I can't call explicit.

>> What is the way of initializing eh per hand (no elf .init section etc.) so I can
>> emulate this for linux kernel? 

I assume you are using dwarf2 unwind info. ie when you look at your .s file
for a routine with a throw, you have both frame information and
exception table information at the bottom.  (Data tables with __EXCEPTION_TABLE
label and __FRAME_BEGIN__). These are usually in sections labeled
.gcc_except_table and .eh_frame.

You need to call __register_frame_info with  the address of the beginning
of the .eh_frame section, and a pointer to a small hunk of memory 
for the frame objec (struct object in frame.h). You should do this just before
calling your static constructors. 
__deregister_frame_info should be called with the address of the beginning 
of .eh_frame section after all the static destructors have been run.

Both are declared in frame.c.

Andrew

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