[PATCH] D80857: [lld-macho] Handle GOT relocations of non-dylib symbols

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 31 15:26:14 PDT 2020


MaskRay added inline comments.


================
Comment at: lld/MachO/SyntheticSections.cpp:91
+  for (size_t i = 0, n = entries.size(); i < n; ++i) {
+    if (auto *defined = dyn_cast<Defined>(entries[i])) {
+      write64le(&buf[i * WordSize], defined->getVA());
----------------
You can drop braces.


================
Comment at: lld/test/MachO/local-got.s:1
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
----------------
`test/ELF/local-got.s` may not be the best name

If you can think of a better name, use that.


================
Comment at: lld/test/MachO/local-got.s:9
+## --match-full-lines to make sure we match on the right thing.
+# CHECK: Contents of section __cstring:
+# CHECK-NEXT: 100000378 {{.*}}
----------------
Align `Contents` like you did below


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80857





More information about the llvm-commits mailing list