[DTrace-devel] [PATCH 2/2] usdt: remove relocations rather than changing their type to R_*_NONE

Nick Alcock nick.alcock at oracle.com
Mon Oct 30 10:24:35 UTC 2023


On 26 Oct 2023, Kris Van Hees told this:

> So, the side effect of this removal of relocs is that a re-processing of
> object files no longer works.  That is unfortunate, but it is not really
> a deal breaker I think.  But sad, because 'dtrace -G' being safe to be
> done multiple times on the same object file is really useful in terms of
> not requiring people to be careful with how they write their makefiles.
> I *think* mysql depended on that (but that is working from emmory so I
> may be wrong).
>
> But the alternative is to be able to have a reloc that gets ignored by
> the linker.  It needs to be ignored because otherwise the linker will
> overwrite the NOPs we placed with an address and that is exactly what we
> do not want.
>
> So...  this solution of removing the relocs that are so-called no longer
> needed is not a long term solution.

Other possible options include moving the relocs we would have NONEd
into a new (non-loaded) section, then rescanning that first. That way we
get to keep the relocs we wanted to NONEify without exposing them to the
linker. This approach is actually more efficient if you have enough
probes, but the overhead if you only have a few is nontrivial (at least
a page), so I can see why it wasn't done.

(But it looks like we're hoping to repair the linker instead.)

-- 
NULL && (void)



More information about the DTrace-devel mailing list