>
> You can create a lookup table at run time.  What would change if you 
> could do it at link time?  Can you show us the code you want to write? 
>

This is actually linked to my remark on build-time source instrumentation 
on https://github.com/golang/go/issues/35204 : I insert hooks into 
functions and then use a lookup table to find them at run time. Currently, 
they are created using a function which adds the newly created pointer into 
a global map, thus done at "Go init time". But if we say that I shouldn't 
add new dependencies when from a -toolexec tool, I need to create this same 
lookup table differently.

TBH, I just would like to know if getting a symbol address at link time is 
possible. Because I actually found today a workaround to be able to add new 
dependencies my -toolexec tool. But I may need to do this later on.

The other idea I had in mind was using the gosymtab to find function 
adresses but it looks like this section is not always present and I am not 
sure how long it will be supported.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/e3c50e8b-f1d0-47a2-ae03-53b2ae4f00db%40googlegroups.com.

Reply via email to