[PATCH] D98305: [JITLink] Introduce generic x86-64 support by refactoring MachO/x86-64.

Stefan Gränitz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 11 09:06:01 PST 2021


sgraenitz added a comment.

Factoring out architecture specific code sounds like a reasonable approach to reduce code duplication across the JITLink backends. As far as I can see, the patch only ports the MachOJITLinker_x86_64 to use the generic functionality. The ELFJITLinker_x86_64 mostly remains unchanged. Is there a conceptual reason for it or would that be a rather straightforward next step?

What I am not sure I understand yet is how endianness is handled in this scheme. The new applyFixup() function is using hard casts to little-endian when writing fixup values into memory. Is that because addRelocations() is supposed to populate the fixup values with the correct endian already? I think the ELF implementation didn't consider it at all so far, so there is no loss of functionality. Just asking for interest.

Great documentation for the edge kinds!



================
Comment at: llvm/include/llvm/ExecutionEngine/JITLink/x86_64.h:206
+  ///
+  /// If the TLVP entry target is in-range of the fixup then the load frmo the
+  /// TLVP may be replaced with a direct memory address calculation.
----------------
Typo: from


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98305/new/

https://reviews.llvm.org/D98305



More information about the llvm-commits mailing list