Re: How to insert external global variable declarations and pointer assignment statements through GCC plugin GIMPLE pass

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Abhijit Nandy" <abhijit.nandy@xxxxxxxxx> writes:

> This is ok but I am unable to figure out how to insert a statement
> like the following in global scope:
> extern char _binary_ccu_start;
>
> or to make an assigment like the following inside main :
> char *p = &_binary_ccu_start;
>
> Is this possible to do using a plugin ?

You need to create a VAR_DECL with TREE_STATIC set to 1 and pass it to
rest_of_decl_compilation.  Then you can get an expression which takes it
address by passing the decl to build_fold_addr_expr.

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux