[PATCH] D28552: [ELF] - Ignore R_386_NONE.
Rafael Avila de Espindola via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 11 11:27:18 PST 2017
Davide Italiano via Phabricator <reviews at reviews.llvm.org> writes:
> davide added a comment.
>
> In https://reviews.llvm.org/D28552#643063, @ruiu wrote:
>
>> How does dtrace use that? I was thinking that the semantics of the relocation is pretty clear -- that is a relocation which doesn't change the target values.
>
>
> Then why you need to emit a reloc in the first place (if that reloc is de facto a nop)?
I *think* the way dtrace works is:
* A call to a magic function name is emitted via a macro.
* An dtrace utility scans the .o looking for that. It needs the location
for doing whatever it wants to do. It then patches the call into a
nop and the relocation to R_X86_64_NONE.
* The linker proceeds as normal.
Needless to say that is quite convoluted and I hope to improve it once
freebsd switches, but supporting the various _NONE relocations as nops
seems like a reasonable thing to do and supports the current way.
Cheers,
Rafael
More information about the llvm-commits
mailing list