[PATCH] D88629: [lld-macho] Add ARM64 target arch
    Greg McGary via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Wed Jan 27 17:54:35 PST 2021
    
    
  
gkm marked 6 inline comments as done.
gkm added inline comments.
================
Comment at: lld/MachO/Arch/ARM64.cpp:260-261
+  uint32_t instruction = read32le(loc);
+  // C6.2.131 LDR (immediate)
+  // LDR <Xt>, [<Xn|SP>{, #<pimm>}]
+  if ((instruction & 0xffc00000) != 0xf9400000)
----------------
int3 wrote:
> nit: can we have `ldr` in lowercase? since it's also in lowercase in e.g. `stubHelperEntryCode` above.
> 
> I also have a slight preference that the error messages have them in lowercase as well, but I guess it doesn't matter as much as long as things are consistent, and all-caps saves us from having to quote them for clarity
The comment lines are copied directly and unaltered from the ARM manual.
================
Comment at: lld/MachO/InputSection.h:36
   uint64_t addend;
-  llvm::PointerUnion<Symbol *, InputSection *> referent;
+  llvm::PointerUnion<Defined *, Symbol *, InputSection *> referent;
 };
----------------
int3 wrote:
> what's the motivation behind this change?
That's a leftover from an aborted experiment.
================
Comment at: lld/MachO/SyntheticSections.cpp:383
       in.weakBinding->addEntry(sym, section, offset, addend);
-  } else if (isa<DSOHandle>(sym)) {
-    error("cannot bind to " + DSOHandle::name);
-  } else {
+  } else if (!isa<DSOHandle>(sym)) {
     // Undefined symbols are filtered out in scanRelocations(); we should never
----------------
int3 wrote:
> so we can actually bind to `__dso_handle`?
Yes, we do for arm64
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88629/new/
https://reviews.llvm.org/D88629
    
    
More information about the llvm-commits
mailing list