[PATCH] D27609: Fix R_AARCH64_MOVW_UABS_G3 relocation

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 14 15:53:28 PST 2016


davide added inline comments.


================
Comment at: lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp:466-467
     // from bits 11:2 of X
-    *TargetPtr |= ((Result & 0xffc) << (10 - 2));
+    TargetValue |= ((Result & 0xffc) << (10 - 2));
+    support::ulittle32_t::ref{TargetPtr} = TargetValue;
     break;
----------------
`(10 - 2)` -> `8`


================
Comment at: lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp:480-481
     // from bits 11:3 of X
-    *TargetPtr |= ((Result & 0xff8) << (10 - 3));
+    TargetValue |= ((Result & 0xff8) << (10 - 3));
+    support::ulittle32_t::ref{TargetPtr} = TargetValue;
     break;
----------------
any reason why `(10 - 3)` is not spelled `7` (here and everywhere else)


================
Comment at: test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_relocations.s:1-2
+# RUN: llvm-mc -triple=arm64-none-linux-gnu -filetype=obj -o %T/reloc.o %s
+# RUN: llvm-rtdyld -triple=arm64-none-linux-gnu -verify -dummy-extern f=0x0123456789abcdef -check=%s %T/reloc.o
+
----------------
We need tests for both little and big endian, no?


================
Comment at: test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_relocations.s:9-15
+        movz    x0, #:abs_g3:f
+        movk    x0, #:abs_g2_nc:f
+        movk    x0, #:abs_g1_nc:f
+        movk    x0, #:abs_g0_nc:f
+        ret
+        .Lfunc_end0:
+        .size   g, .Lfunc_end0-g
----------------
Can you add comments pointing out the relocations emitted?


https://reviews.llvm.org/D27609





More information about the llvm-commits mailing list