[PATCH] D27629: Fix unwind info relocation with large code model on AArch64

Yichao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 13 05:20:35 PST 2016


yuyichao added inline comments.


================
Comment at: lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp:342
+    uint64_t Result = Value + Addend - FinalAddress;
+    support::ulittle64_t::ref{TargetPtr} = Result;
+    break;
----------------
peter.smith wrote:
> Why is this ulittle64_t? I see a comment in D27609 about causing trouble on big-endian systems, but that doesn't explain why.
> 
> On aarch64 big-endian instructions are little-endian but data is big-endian. Relocations that are applied to instructions are always written little endian, but relocations that are written to data should be written in the target endianness. The R_AARCH64_PREL64 is only applied to data so I am not expecting to see ulittle64_t here.  
I actually did not think about the support of `aarch64_be` in relocation (even though I added it to the FDE encoding condition....).

Ref https://reviews.llvm.org/rL284789
The reason for the `ulittle*_t` is to support running the JIT on big endian system (for tests and for remote JIT). This is also why the x86 relocations above also have the `ulittle*_t` in them even though there isn't any big endian x86 systems.

I'll check and use `ubig*_t` on the data part conditionally for aarch64_be in both PR if necessary.



https://reviews.llvm.org/D27629





More information about the llvm-commits mailing list