Hooking of CFG

Lasse Bigum Lasse@hardwareonline.dk
Wed Aug 9 09:17:00 GMT 2006


Hi,

I'm working on the project along with Egon, and thank you in advance for
your help.

On 14:43, Tue 08 Aug, Ian Lance Taylor wrote:
> gunman@cs.aau.dk writes:
> > We are wondering if it is possible to hook when the CFG is built in
> > GCC, i.e. like it is done with lsm and the linux kernel. We are only
> > aware of the GEM framework for doing this, but as we understand it, it
> > is only possible to hook the preprocessor, AST, and the assembly code
> > generation components of GCC.
> > 
> > This is because we want to build a CFG which only include system calls
> > to the kernel, i.e. we only want a CFG with basis-blocks containing
> > system calls.
> 
> You can, of course, edit the source code to do whatever you like.

Of course, which is also an option we are considering.

> If you mean: is there an API for adding CFG hooks such as you
> describe, then the answer is no.

We have, however, been thinking about just implementing another pass on
the GIMPLE tree representation, once the Control Flow Graph have been
created.

Creating another pass is also an option, right? Or have I misunderstood
something. Adding another pass just seems a lot easier than having to
modify the GCC code in more complex ways.

Regards,
Lasse Bigum
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3168 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20060809/d47a8d0c/attachment.bin>


More information about the Gcc-help mailing list