https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121569
--- Comment #7 from Frank Ch. Eigler <fche at redhat dot com> ---
> The problem is in STAP_PROBE1 really:
> .ascii "ti(%rip)" # ti
> That is valid for that TU only.
> So the bug is in STAP_PROBE1 and nothing else.
Sort of. The gcc operand expression refers to a local symbol, which normally
the assembler would disambiguate. But these STAP_PROBE* expressions are
not processed by the assembler, for runtime evaluation.
This is not a "bug" as far as I can tell, and not with the STAP_PROBE* macros
per se. When consumer tools find such expressions, they'd have to emulate
assembler/CU-type logic to find the appropriate instance of the symbol to map
to.
By the way, a workaround could be referring to the variable some other way,
for example
STAP_PROBE1(foo, bar, &ti);
which would likely get gcc to load the address into a register and pass that.