[PATCH] D28122: RuntimeDyldELF: implement R_AARCH64_PREL64 reloc

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 28 09:43:42 PST 2016


davide added a comment.

In https://reviews.llvm.org/D28122#631780, @davide wrote:

> In https://reviews.llvm.org/D28122#631779, @evgeny777 wrote:
>
> > > is it possible for this to be big-endian?
> >
> > Looks like **aarch64_be** is one of the targets supported by LLVM. 
> >  Are you saying that reloc values should still be written as little-endian on aarch64_be? If so who will convert them back to host byte order? CPU?
>
>
> No, on aarch64-be we should write the bytes in big-endian order. But you should add a test for aarch64_be (for this, and all the other untested BE


untested relocations on BE, if any (please add the tests in a separate commit/review to keep the diff readable).

In https://reviews.llvm.org/D28122#631787, @evgeny777 wrote:

> Ah, got it. Let's stick to LE then


ehm, that's not quite what I meant, sorry if it wasn't clear enough.What I'm suggesting is adding a test for BE for this relocation, and then audit all the other relocations not tested in aarch64-be configuration and add test for those.

The reason why lld uses write64le is that (I think) it supports only `aarch64le` so any `aarch64be` object will be rejected (or it's supposed to).
With your change you end up with a mix of endian-agnostic relocations and a relocation which will assume little-endian independently from the input.
If somebody passes a BE input that could result in a silent misapplication of a relocation, very painful to track down.


https://reviews.llvm.org/D28122





More information about the llvm-commits mailing list