OSDN Git Service

[llvm-objcopy] Handle -O <format> flag.
authorJordan Rupprecht <rupprecht@google.com>
Mon, 7 Jan 2019 16:59:12 +0000 (16:59 +0000)
committerJordan Rupprecht <rupprecht@google.com>
Mon, 7 Jan 2019 16:59:12 +0000 (16:59 +0000)
commitf570c1cad568650389710d60e265e3289a0db186
tree4215ed3bafcedabd599dfde5e88e26a32f19db51
parente410b0a76b062eeabf406f97b69730b34601e1ff
[llvm-objcopy] Handle -O <format> flag.

Summary:
The -O flag is currently being mostly ignored; it's only checked whether or not the output format is "binary". This adds support for a few formats (e.g. elf64-x86-64), so that when specified, the output can change between 32/64 bit and sizes/alignments are updated accordingly.

This fixes PR39135

Reviewers: jakehehrlich, jhenderson, alexshap, espindola

Reviewed By: jhenderson

Subscribers: emaste, arichardson, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350541 91177308-0d34-0410-b5e6-96231b3b80d8
test/tools/llvm-objcopy/ELF/bad-output-format.test [new file with mode: 0644]
test/tools/llvm-objcopy/ELF/binary-input-with-arch.test [new file with mode: 0644]
test/tools/llvm-objcopy/ELF/cross-arch-headers.test [new file with mode: 0644]
test/tools/llvm-objcopy/ELF/cross-arch-sections-symbols.test [new file with mode: 0644]
tools/llvm-objcopy/CopyConfig.cpp
tools/llvm-objcopy/CopyConfig.h
tools/llvm-objcopy/ELF/ELFObjcopy.cpp