[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc
Subject:    Re: Emit a variable defined in gcc
From:       Harshit Sharma via Gcc <gcc () gcc ! gnu ! org>
Date:       2020-06-30 16:52:37
Message-ID: CAAAgQ1_VeWAPdL2dri=9pCM=4qvM-y8V2RADXngs4h8qKCQPMQ () mail ! gmail ! com
[Download RAW message or body]

Hey Martin,

Thanks for your reply. Actually I am trying to have a callback function
allowing gcc to fetch shadow offset from runtime code.

In order to make sure that my users have applied this patch before using
asan feature, I want to define a variable in gcc (could be an integer)
which will be referenced by the asan library in our source code. I think I
used the wrong word 'emit' in my previous post. The variable say
"__asan_gccpatch_present" needs to be defined in gcc and then referenced by
our code (just like we do with functions such as __builtin_expect).


Thanks,
Harshit

On Tue, Jun 30, 2020 at 12:34 AM Martin Li=C5=A1ka <mliska@suse.cz> wrote:

> On 6/30/20 7:55 AM, Harshit Sharma via Gcc wrote:
> > Hello,
> > I am working on a gcc patch for asan.
>
> Hey.
>
> Good to hear, what kind of feature is that?
>
> > The patch is almost ready except one
> > thing. To make sure that the user has applied this patch before using
> asan
> > feature, I want to declare an additional variable in gcc which is
> reference
> > by our source code so that if this patch is missing, the user gets an
> error
> > compiling the code because the reference to this variable will not be
> > resolved.
>
> A nice example can be emission of global variables that are used for
> -fprofile-generate:
> see gcc/tree-profile.c:194-202.
>
> Let me know if it helps?
> Martin
>
> >
> > I am still new to gcc development. So, can anyone tell me how can I mak=
e
> > gcc emit this variable?
> >
> >
> > Thanks,
> > Harshit
> >
>
>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic