1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
llvm-mirror/tools/llvm-objcopy
Fangrui Song 83bc3d5d9f [llvm-objcopy] Ignore -B --binary-architecture=
GNU objcopy documents that -B is only useful with architecture-less
input (i.e. "binary" or "ihex"). After D67144, -O defaults to -I, and
-B is essentially a NOP.

* If -O is binary/ihex, GNU objcopy ignores -B.
* If -O is elf*, -B provides the e_machine field in GNU objcopy.

So to convert a blob to an ELF, `-I binary -B i386:x86-64 -O elf64-x86-64` has to be specified.

`-I binary -B i386:x86-64 -O elf64-x86-64` creates an ELF with its
e_machine field set to EM_NONE in GNU objcopy, but a regular x86_64 ELF
in elftoolchain elfcopy. Follow the elftoolchain approach (ignoring -B)
to simplify code. Users that expect their command line portable should
specify -B.

Reviewed By: jhenderson

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

llvm-svn: 371914
2019-09-14 01:36:31 +00:00
..
COFF [llvm-objcopy] Allow the visibility of symbols created by --binary and 2019-08-30 10:17:16 +00:00
ELF [llvm-objcopy] Ignore -B --binary-architecture= 2019-09-14 01:36:31 +00:00
MachO [Alignment] Move OffsetToAlignment to Alignment.h 2019-09-12 15:20:36 +00:00
Buffer.cpp [llvm-objcopy][NFC] Remove unnecessary llvm-objcopy.h #includes 2019-03-13 23:40:16 +00:00
Buffer.h [llvm-objcopy] Fix crash when writing empty binary output 2019-01-28 15:02:40 +00:00
CMakeLists.txt Recommit "[llvm-objcopy][MachO] Support load commands used in executables/shared libraries" 2019-08-19 21:05:31 +00:00
CommonOpts.td [llvm-objcopy] Move duplicate tablegen from objcopy and strip into one file 2019-08-15 04:45:41 +00:00
CopyConfig.cpp [llvm-objcopy] Ignore -B --binary-architecture= 2019-09-14 01:36:31 +00:00
CopyConfig.h [llvm-objcopy] Ignore -B --binary-architecture= 2019-09-14 01:36:31 +00:00
llvm-objcopy.cpp [llvm-objcopy] Add support for response files in llvm-strip and llvm-objcopy 2019-09-14 01:14:43 +00:00
llvm-objcopy.h Small refactoring of FileError. NFC. 2019-02-11 09:49:37 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ObjcopyOpts.td [llvm-objcopy] Ignore -B --binary-architecture= 2019-09-14 01:36:31 +00:00
StripOpts.td [llvm-objcopy] Move duplicate tablegen from objcopy and strip into one file 2019-08-15 04:45:41 +00:00