[all-commits] [llvm/llvm-project] 8bd8dd: Extend obj2yaml to optionally preserve raw __LINKE...

adrian-prantl via All-commits all-commits at lists.llvm.org
Mon Nov 8 11:30:26 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8bd8dd16e22b7a8f4df0f51ae3511b887629be57
      https://github.com/llvm/llvm-project/commit/8bd8dd16e22b7a8f4df0f51ae3511b887629be57
  Author: Adrian Prantl <aprantl at apple.com>
  Date:   2021-11-08 (Mon, 08 Nov 2021)

  Changed paths:
    M llvm/include/llvm/Object/MachO.h
    M llvm/include/llvm/ObjectYAML/MachOYAML.h
    M llvm/lib/Object/MachOObjectFile.cpp
    M llvm/lib/ObjectYAML/MachOEmitter.cpp
    M llvm/lib/ObjectYAML/MachOYAML.cpp
    A llvm/test/tools/obj2yaml/MachO/raw-linkedit.yaml
    M llvm/tools/obj2yaml/macho2yaml.cpp
    M llvm/tools/obj2yaml/obj2yaml.cpp
    M llvm/tools/obj2yaml/obj2yaml.h

  Log Message:
  -----------
  Extend obj2yaml to optionally preserve raw __LINKEDIT/__DATA segments.

I am planning to upstream MachOObjectFile code to support Darwin
chained fixups. In order to test the new parser features we need a way
to produce correct (and incorrect) chained fixups. Right now the only
tool that can produce them is the Darwin linker. To avoid having to
check in binary files, this patch allows obj2yaml to print a hexdump
of the raw LINKEDIT and DATA segment, which both allows to
bootstrap the parser and enables us to easily create malformed inputs
to test error handling in the parser.

This patch adds two new options to obj2yaml:

  -raw-data-segment
  -raw-linkedit-segment

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




More information about the All-commits mailing list