[PATCH] D77844: [ObjectYAML][MachO] Add support for relocations

Alexander Shaposhnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 14 20:08:07 PDT 2020


alexshap marked an inline comment as done.
alexshap added inline comments.
Herald added a subscriber: wuzish.


================
Comment at: llvm/test/ObjectYAML/MachO/relocations_arm64.yaml:93
+# CHECK-NEXT:         relocations:
+# CHECK-NEXT:           - address:         0x0000002C
+# CHECK-NEXT:             symbolnum:       2
----------------
MaskRay wrote:
> Among these relocation fields, does any one have a default value and can be omitted? For example, if `scattered` is almost always false (I don't know if that is true), it can be omitted for simpler output.
it depends on the target, for x86_64 OSX - yeah, to the best of my knowledge scattered relocations are not used, 
for ARMv7 - there are quite a lot of them. Honestly I find it easier to understand the test when the format is the same / all the fields are reported.
These tests are based on a (real-world) tiny code snippet compiled for various targets (for ppc-apple-darwin I had to use clang-5.0)

   int x = 1;
   int y = 2;
   long z = (long)&x;
   long w = (long)&x - (long)&y;

   int main() {
     return z + w;
   }


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77844





More information about the llvm-commits mailing list