[PATCH] D133974: [objcopy] Fix order of Mach-O LINKEDIT pieces during layout

Daniel Rodríguez Troitiño via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 26 17:30:56 PDT 2022


drodriguez marked an inline comment as done.
drodriguez added inline comments.


================
Comment at: llvm/test/tools/llvm-objcopy/MachO/linkedit-order.test:31
+# CHECK: cmd:             LC_DYSYMTAB
+## FIXME: FileCheck does not support multiplication. 48 = SYMTAB_NSYMS * 16
+# CHECK: indirectsymoff:  [[#DYSYMTAB_INDIRECTSYMOFF: SYMTAB_SYMOFF + 48]]
----------------
jhenderson wrote:
> FWIW, I don't think it would be too difficult to get FileCheck to support multiplication. If memory serves me rightly, it would just require adding another binop support, so could easily follow the existing addition support.
I think the operator `*` might not implemented because of the precedence rules. I looked a little bit into it, but I wasn't sure that my implementation was going to be good. But thanks for the clue because I saw that there was some function-like alternatives like `mul` and `div` that allows doing the multiplication and also allows me to not have to be careful with the alignment of the last piece of linkedit (I can code the alignment in the test).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133974



More information about the llvm-commits mailing list