[PATCH] D50343: [llvm-objcopy] Add support for -I binary -B <arch>.

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 6 11:34:07 PDT 2018


rupprecht created this revision.
rupprecht added reviewers: jakehehrlich, alexshap, jhenderson.
Herald added a reviewer: javed.absar.
Herald added a subscriber: kristof.beyls.

The -I (--input-target) and -B (--binary-architecture) flags exist but are currently silently ignored. This adds support for -I binary for architectures i386, x86-64 (and alias i386:x86-64), arm, and aarch64. This is largely based on https://reviews.llvm.org/D41687.

This is done by implementing an additional subclass of Reader, BinaryReader, which works by interpreting the input file as contents for .data field, sets up a synthetic header, and adds additional sections/symbols (e.g. _binary__tmp_data_txt_start). Additionally, change the symbol table to own symbols, by changing StringRef to std::string, as the synthetic symbols added are otherwise unowned.


Repository:
  rL LLVM

https://reviews.llvm.org/D50343

Files:
  test/tools/llvm-objcopy/binary-input-aarch64.test
  test/tools/llvm-objcopy/binary-input-arm.test
  test/tools/llvm-objcopy/binary-input-error.test
  test/tools/llvm-objcopy/binary-input-i386.test
  test/tools/llvm-objcopy/binary-input-reconstitute.test
  test/tools/llvm-objcopy/binary-input-x86-64.test
  test/tools/llvm-objcopy/binary-input.test
  tools/llvm-objcopy/Object.cpp
  tools/llvm-objcopy/Object.h
  tools/llvm-objcopy/llvm-objcopy.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50343.159343.patch
Type: text/x-patch
Size: 24000 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180806/4678ea60/attachment-0001.bin>


More information about the llvm-commits mailing list