From 2f519d7072bf48a81985fadc2dc145296d612223 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sat, 14 Sep 2019 01:36:31 +0000 Subject: [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 --- llvm/docs/CommandGuide/llvm-objcopy.rst | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'llvm/docs/CommandGuide') diff --git a/llvm/docs/CommandGuide/llvm-objcopy.rst b/llvm/docs/CommandGuide/llvm-objcopy.rst index 401bc5bd4bd..f3926805c44 100644 --- a/llvm/docs/CommandGuide/llvm-objcopy.rst +++ b/llvm/docs/CommandGuide/llvm-objcopy.rst @@ -43,6 +43,10 @@ multiple file formats. starts with ".note". Otherwise, it will have type `SHT_PROGBITS`. Can be specified multiple times to add multiple sections. +.. option:: --binary-architecture , -B + + Ignored for compatibility. + .. option:: --disable-deterministic-archives, -U Use real values for UIDs, GIDs and timestamps when updating archive member @@ -181,23 +185,6 @@ them. Allow llvm-objcopy to remove sections even if it would leave invalid section references. Any invalid sh_link fields will be set to zero. -.. option:: --binary-architecture , -B - - Specify the architecture to use, when transforming an architecture-less format - (e.g. binary) to another format. Valid options are: - - - `aarch64` - - `arm` - - `i386` - - `i386:x86-64` - - `mips` - - `powerpc:common64` - - `riscv:rv32` - - `riscv:rv64` - - `sparc` - - `sparcel` - - `x86-64` - .. option:: --build-id-link-dir Set the directory used by :option:`--build-id-link-input` and -- cgit v1.2.3