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

Kaining Zhong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 6 07:55:46 PDT 2022


PRESIDENT810 updated this revision to Diff 442574.
PRESIDENT810 added a comment.

Pass reloc by reference instead of by value. Remove the unnecessary assertion. Use toString(Symbol *) instead of getName().

I'm not sure about the magic number part. ld64 just uses these numbers directly to overwrite the original instructions, and they are not actually "magic numbers", but rather assembly instructions corresponding to different architectures, I think? Also, the comments above could give illustrations about what assembly instructions these numbers represent. So I'm not very certain if it's necessary to use constants instead.


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

https://reviews.llvm.org/D129062

Files:
  lld/MachO/Arch/ARM.cpp
  lld/MachO/Arch/ARM64Common.cpp
  lld/MachO/Arch/ARM64Common.h
  lld/MachO/Arch/X86_64.cpp
  lld/MachO/InputSection.cpp
  lld/MachO/SymbolTable.cpp
  lld/MachO/Target.h
  lld/test/MachO/arm-dtrace.s
  lld/test/MachO/arm64-32-dtrace.s
  lld/test/MachO/arm64-dtrace.s
  lld/test/MachO/x86_64-dtrace.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129062.442574.patch
Type: text/x-patch
Size: 12388 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220706/9db2fe3f/attachment.bin>


More information about the llvm-commits mailing list