[llvm] r267309 - [RuntimeDyldELF] Handle GOTPCRELX/REX_GOTPCRELX.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 25 13:28:12 PDT 2016


Cool! Thanks Davide. :)

- Lang.

On Sat, Apr 23, 2016 at 6:36 PM, Davide Italiano via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: davide
> Date: Sat Apr 23 20:36:37 2016
> New Revision: 267309
>
> URL: http://llvm.org/viewvc/llvm-project?rev=267309&view=rev
> Log:
> [RuntimeDyldELF] Handle GOTPCRELX/REX_GOTPCRELX.
>
> Added:
>     llvm/trunk/test/ExecutionEngine/RuntimeDyld/X86/ELF-relaxed.s
> Modified:
>     llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
>
> Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp?rev=267309&r1=267308&r2=267309&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
> (original)
> +++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp Sat Apr
> 23 20:36:37 2016
> @@ -1708,7 +1708,9 @@ relocation_iterator RuntimeDyldELF::proc
>                    Value.Offset);
>          addRelocationForSection(RE, Value.SectionID);
>        }
> -    } else if (RelType == ELF::R_X86_64_GOTPCREL) {
> +    } else if (RelType == ELF::R_X86_64_GOTPCREL ||
> +               RelType == ELF::R_X86_64_GOTPCRELX ||
> +               RelType == ELF::R_X86_64_REX_GOTPCRELX) {
>        uint64_t GOTOffset = allocateGOTEntries(SectionID, 1);
>        resolveGOTOffsetRelocation(SectionID, Offset, GOTOffset + Addend);
>
> @@ -1869,6 +1871,8 @@ bool RuntimeDyldELF::relocationNeedsStub
>
>
>    case ELF::R_X86_64_GOTPCREL:
> +  case ELF::R_X86_64_GOTPCRELX:
> +  case ELF::R_X86_64_REX_GOTPCRELX:
>    case ELF::R_X86_64_PC32:
>    case ELF::R_X86_64_PC64:
>    case ELF::R_X86_64_64:
>
> Added: llvm/trunk/test/ExecutionEngine/RuntimeDyld/X86/ELF-relaxed.s
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/RuntimeDyld/X86/ELF-relaxed.s?rev=267309&view=auto
>
> ==============================================================================
> --- llvm/trunk/test/ExecutionEngine/RuntimeDyld/X86/ELF-relaxed.s (added)
> +++ llvm/trunk/test/ExecutionEngine/RuntimeDyld/X86/ELF-relaxed.s Sat Apr
> 23 20:36:37 2016
> @@ -0,0 +1,8 @@
> +# RUN: llvm-mc -triple=x86_64-pc-linux -relocation-model=pic
> -filetype=obj -o %T/file.o %p/Inputs/ELF_STT_FILE_GLOBAL.s
> +# RUN: llvm-mc -triple=x86_64-pc-linux -relax-relocations
> -relocation-model=pic -filetype=obj -o %T/relaxed.o %s
> +# RUN: llvm-rtdyld -triple=x86_64-pc-linux -verify %T/file.o %T/relaxed.o
> +
> +# Test that RTDyldELF does not crash with 'unimplemented relocation'
> +
> +_main:
> +    movq    foo.c at GOTPCREL(%rip), %rax
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160425/3fbca536/attachment.html>


More information about the llvm-commits mailing list