Injecting data declarations?

Reuben Harris reuben.harris@gmail.com
Thu Mar 6 16:15:00 GMT 2008


Hi,

I would like to modify GCC to inject a link-once word-sized data
declaration into the object file, i.e. to behave AS IF there were
extra declarations in the source code, e.g.:

    void* __secret__Foo = &Foo;

(Where Foo is some piece of static data that was defined in source.)

Can someone give me a pointer?  I imagine I need to call 'start_decl'
and 'finish_decl', but how do I create the declarator tree for
start_decl? How do I specify the type?

Many thanks,


-- Reuben



More information about the Gcc mailing list