[PATCH] D129062: [lld-macho] Handle user-provided dtrace symbols to avoid linking failure

Daniel Bertalan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 5 12:59:56 PDT 2022


BertalanD added inline comments.


================
Comment at: lld/MachO/Arch/X86_64.cpp:222
+    // loc[3] = 0x00;
+    write32le(loc - 4, (read32le(loc - 4) & 0x00ffffff) | 0x90000000);
+    write32le(loc, 0x00401F0F);
----------------



================
Comment at: lld/MachO/Dtrace.cpp:17-22
+bool lld::macho::isDtraceSym(StringRef name) {
+  if (name.substr(0, 10) == "___dtrace_") {
+    return true;
+  }
+  return false;
+}
----------------
It looks like this function might be quite hot. Do you think it would make sense for it to be an inline function in the header file?


================
Comment at: lld/test/MachO/arm-dtrace.ll:1
+; RUN: rm -rf %t; split-file %s %t
+
----------------
`llvm-as` can only be run for this test case if the ARM backend is enabled.


================
Comment at: lld/test/MachO/arm64-32-dtrace.ll:1
+; RUN: rm -rf %t; split-file %s %t
+
----------------



================
Comment at: lld/test/MachO/arm64-dtrace.ll:1
+; RUN: rm -rf %t; split-file %s %t
+
----------------



================
Comment at: lld/test/MachO/x86_64-dtrace.ll:1
+; RUN: rm -rf %t; split-file %s %t
+
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129062



More information about the llvm-commits mailing list