This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: How to insert external global variable declarations and pointer assignment statements through GCC plugin GIMPLE pass
- From: Ian Lance Taylor <iant at google dot com>
- To: "Abhijit Nandy" <abhijit dot nandy at gmail dot com>
- Cc: "gcc" <gcc-help at gcc dot gnu dot org>
- Date: Tue, 14 Jun 2011 10:18:53 -0700
- Subject: Re: How to insert external global variable declarations and pointer assignment statements through GCC plugin GIMPLE pass
- References: <68C14D8B8C1E48DC8FE5F9DAB722DB7A@abhiPC> <mcrzkmbehqp.fsf@coign.corp.google.com> <E3044324D6DE4D22AAD744F98CFCBE17@abhiPC> <mcrr57fq6my.fsf@coign.corp.google.com> <F619BDBA45C7469FB092874D6CC9C6BB@abhiPC>
"Abhijit Nandy" <abhijit.nandy@gmail.com> writes:
> I get the following output from it :
>
> ;; Function main (main)
>
> main ()
> {
> char * p.1;
>
> <bb 2>:
> .....
> p.1 = &_binary_ccu_start;
> molen_elfset (p.1);
> ....
> }
> ------------------------------------------------------------------------------------
>
> To recall I am trying to insert the following in a C program :
>
> extern char _binary_ccu_start;
>
> int main (int argc, char **argv)
> {
> ....
> char *p = &_binary_ccu_start;
> molen_elfset(p);
> ...
> }
If you are looking at a dump file, then it seems to me that you are
getting what you want. A dump file is not a C file; it doesn't list the
extern declarations explicitly.
Let me know if I'm missing something.
Ian