[PATCH] D12436: [ELFv2] Implement R_X86_64_32 relocation

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 28 11:06:37 PDT 2015


Please check the symbol value of bar to see that it matches.

Please factor the base + offset expression.  Every relocation is likely to
use it.

Lgtm with that.
On Aug 28, 2015 12:30 PM, "Davide Italiano" <dccitaliano at gmail.com> wrote:

> davide created this revision.
> davide added reviewers: rafael, Bigcheese.
> davide added a subscriber: llvm-commits.
>
> More to come.
>
> http://reviews.llvm.org/D12436
>
> Files:
>   ELF/Writer.cpp
>   test/elf2/relocation.s
>
> Index: test/elf2/relocation.s
> ===================================================================
> --- test/elf2/relocation.s
> +++ test/elf2/relocation.s
> @@ -14,4 +14,13 @@
>  .global lulz
>  lulz:
>
> +.global bar
> +.text
> +bar:
> +  movl $bar, %edx // R_X86_64_32
> +
> +// R_X86_64_32
> +// CHECK: bar:
> +// CHECK:    1000: ba 00 10 00 00 movl $4096, %edx
> +
>  // CHECK: e8 04 00 00 00  callq   4
> Index: ELF/Writer.cpp
> ===================================================================
> --- ELF/Writer.cpp
> +++ ELF/Writer.cpp
> @@ -259,6 +259,9 @@
>            support::endian::write32le(Base + Offset,
>                                       SymVA + (RI.r_addend - (P +
> Offset)));
>            break;
> +        case llvm::ELF::R_X86_64_32:
> +          support::endian::write32le(Base + Offset, SymVA + RI.r_addend);
> +          break;
>          default:
>            llvm::errs() << Twine("unrecognized reloc ") + Twine(Type) <<
> '\n';
>            break;
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150828/26d9fbb5/attachment-0001.html>


More information about the llvm-commits mailing list