[PATCH] RuntimeDyldElf: Add (trivial) support for R_X86_64_NONE, it's a no-op

Will Dietz via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 13 06:45:43 PDT 2016


Ping?

To help explain/motivate:

Files with these relocations can be given to RuntimeDyld through an object
or archive,
and without this fix RuntimeDyld hits the "Relocation type not implemented"
unreachable/assertion failure.
(Not sure if any of our JIT's would produce the need for these, but maybe
them too)


Why this is correct:

Searching the same file you can see how the equivalent relocation is
handled on other architectures (R_ARM_NONE, R_MIPS_NONE), which is the
same: do nothing :).

I don't have a useful way to craft a test for this, but if that's a blocker
please let me know and I'll see what I can do.

Thanks! :)

~Will

On Wed, Sep 21, 2016 at 9:28 AM Will Dietz <wdietz2 at illinois.edu> wrote:

> Patch attached and reproduced below inline:
> ----------------------
> From 91f56e48e0d267c8647410652be57dd7ab69200b Mon Sep 17 00:00:00 2001
> From: Will Dietz <w at wdtz.org>
> Date: Wed, 27 Jul 2016 07:20:37 -0500
> Subject: [PATCH] RuntimeDyldELF: Don't abort on R_X86_64_NONE, they're
> no-ops.
>
> ---
>  lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
> b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
> index 9cbdb13..ec8fe3a 100644
> --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
> +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
> @@ -231,6 +231,8 @@ void RuntimeDyldELF::resolveX86_64Relocation(const
> SectionEntry &Section,
>    default:
>      llvm_unreachable("Relocation type not implemented yet!");
>      break;
> +  case ELF::R_X86_64_NONE:
> +    break;
>    case ELF::R_X86_64_64: {
>      support::ulittle64_t::ref(Section.getAddressWithOffset(Offset)) =
>          Value + Addend;
> --
> 1.7.1
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161013/d3d5de77/attachment.html>


More information about the llvm-commits mailing list