[PATCH] D94935: [lld-macho] Fix alignment & layout to match ld64 and satisfy codesign

Greg McGary via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 18 15:06:38 PST 2021


gkm created this revision.
gkm added a reviewer: lld-macho.
Herald added a subscriber: kristof.beyls.
gkm requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Dyld on arm64 macOS has strict requirements for alignment and sequence of segments and sections.

I developed this diff by incrementally changing alignments & sequences to match the output of ld64. I stopped when arm64 macOS began executing my test programs rather than immediately rejecting them in execve(2) with `errno == EBADMACHO` `"Malformed Mach-O file"`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D94935

Files:
  lld/MachO/SyntheticSections.cpp
  lld/MachO/SyntheticSections.h
  lld/MachO/Target.h
  lld/MachO/UnwindInfoSection.cpp
  lld/MachO/Writer.cpp
  lld/test/MachO/bss.s
  lld/test/MachO/dylib-stub.yaml
  lld/test/MachO/entry-symbol.s
  lld/test/MachO/indirect-symtab.s
  lld/test/MachO/lc-build-version.s
  lld/test/MachO/relocations.s
  lld/test/MachO/symtab.s
  lld/test/MachO/weak-binding.s
  lld/test/MachO/weak-reference.s
  lld/test/MachO/x86-64-reloc-signed.s
  lld/test/MachO/x86-64-reloc-unsigned.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94935.317425.patch
Type: text/x-patch
Size: 17260 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210118/9dfd8391/attachment.bin>


More information about the llvm-commits mailing list