This is the part I was trying to get right with the macros:

> __asm__(
>     // Data to be placed at start of .text section
>     "\t.section .init\n"
>     "\t.word eh_handler\n"
>     "\t.word 0\n"
>     "start_eh_text:\n"
> 

This is documented to having to be placed immediately before the function it
corresponds to ...


>     // Data for exception handler
>     "\t.section .pdata\n"
>     "\t.word start_eh_text\n"
>     "\t.word 0xc0000002 | (0xFFFFF << 8)\n" // max 22 bits for number of 
> instructions
> 
>     "\t.text\n"
>     );


The 0xFFFFF hack (function size in n of insns) seems to be enough to cover
most cases.  The OS should be crawling the stack and looking at the
.pdata table for a corresponding entry.  If start_eh_text ends up being
too high in the map (like the highest function in .text), the OS will not
find it, ... unless there is a special case for an entry with 0xfffff size.

(me thinks - please don't take anything I say as granted, there is
much guesswork involved on my part too :) )

Anyway,
Looks nice and simple,  I'll give it a try tomorrow too.  Thanks.

Cheers,
Pedro Alves



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to