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ška <mli...@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 make > > gcc emit this variable? > > > > > > Thanks, > > Harshit > > > >