[all-commits] [llvm/llvm-project] 11443e: [llvm-objdump] Support dumping segment information...

Daniel Bertalan via All-commits all-commits at lists.llvm.org
Thu Aug 18 00:39:28 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 11443ef85dbe4f3930f726b1be4d7f90f99d1021
  Author: Daniel Bertalan <dani at danielbertalan.dev>
  Date:   2022-08-18 (Thu, 18 Aug 2022)

  Changed paths:
    M llvm/include/llvm/BinaryFormat/MachO.h
    M llvm/include/llvm/Object/MachO.h
    M llvm/lib/Object/MachOObjectFile.cpp
    A llvm/test/tools/llvm-objdump/MachO/Inputs/chained-fixups.macho-x86_64
    A llvm/test/tools/llvm-objdump/MachO/chained-fixups.test
    R llvm/test/tools/llvm-objdump/MachO/chained-fixups.yaml
    M llvm/tools/llvm-objdump/MachODump.cpp

  Log Message:
  [llvm-objdump] Support dumping segment information with -chained_fixups

This commit adds the definitions for `dyld_chained_starts_in_image`,
`dyld_chained_starts_in_segment`, and related enums. Dumping their
contents is possible with the -chained_fixups flag of llvm-otool.

The chained-fixups.yaml test was changed to cover bindings/rebases, as
well as weak imports, weak symbols and flat namespace symbols. Now that
we have actual fixup entries, the __DATA segment contains data that
would need to be hexdumped in YAML. We also test empty pages (to look
for the "DYLD_CHAINED_PTR_START_NONE" annotation), so the YAML would end
up quite large. So instead, this commit includes a binary file.

When Apple's effort to upstream their chained fixups code continues,
we'll replace this code with the then-upstreamed code. But we need
something in the meantime for testing ld64.lld's chained fixups code.

Differential Revision: https://reviews.llvm.org/D131961

More information about the All-commits mailing list