SuccessChanges

Summary

  1. [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
  2. [llvm-objcopy] Default --output-target to --input-target when unspecified Fixes PR42171. In GNU objcopy, if -O (--output-target) is not specified, the value is copied from -I (--input-target). ``` objcopy -I binary -B i386:x86-64 a.txt b # b is copied from a.txt llvm-objcopy -I binary -B i386:x86-64 a.txt b # b is an x86-64 object file ``` This patch changes our behavior to match GNU. With this change, we can delete code related to -B handling (D67215). Reviewed By: jakehehrlich Differential Revision: https://reviews.llvm.org/D67144
  3. [llvm-ar] Uncapitalize error messages and delete full stop Most GNU binutils don't append full stops in error messages. This convention has been adopted by a bunch of LLVM binary utilities. Make llvm-ar follow the convention as well. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D67558
  4. [llvm-objcopy] Add support for response files in llvm-strip and llvm-objcopy Summary: Addresses https://bugs.llvm.org/show_bug.cgi?id=42671 Reviewers: jhenderson, espindola, alexshap, rupprecht Reviewed By: jhenderson Subscribers: seiya, emaste, arichardson, jakehehrlich, MaskRay, abrachet, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65372
Revision 371914 by maskray:
[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
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/docs/CommandGuide/llvm-objcopy.rst (diff)llvm.src/docs/CommandGuide/llvm-objcopy.rst
The file was modified/llvm/trunk/test/tools/llvm-objcopy/ELF/binary-input-error.test (diff)llvm.src/test/tools/llvm-objcopy/ELF/binary-input-error.test
The file was modified/llvm/trunk/tools/llvm-objcopy/CopyConfig.cpp (diff)llvm.src/tools/llvm-objcopy/CopyConfig.cpp
The file was modified/llvm/trunk/tools/llvm-objcopy/CopyConfig.h (diff)llvm.src/tools/llvm-objcopy/CopyConfig.h
The file was modified/llvm/trunk/tools/llvm-objcopy/ELF/ELFObjcopy.cpp (diff)llvm.src/tools/llvm-objcopy/ELF/ELFObjcopy.cpp
The file was modified/llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp (diff)llvm.src/tools/llvm-objcopy/ELF/Object.cpp
The file was modified/llvm/trunk/tools/llvm-objcopy/ELF/Object.h (diff)llvm.src/tools/llvm-objcopy/ELF/Object.h
The file was modified/llvm/trunk/tools/llvm-objcopy/ObjcopyOpts.td (diff)llvm.src/tools/llvm-objcopy/ObjcopyOpts.td
Revision 371913 by maskray:
[llvm-objcopy] Default --output-target to --input-target when unspecified

Fixes PR42171.

In GNU objcopy, if -O (--output-target) is not specified, the value is
copied from -I (--input-target).

```
objcopy -I binary -B i386:x86-64 a.txt b       # b is copied from a.txt
llvm-objcopy -I binary -B i386:x86-64 a.txt b  # b is an x86-64 object file
```

This patch changes our behavior to match GNU. With this change, we can
delete code related to -B handling (D67215).

Reviewed By: jakehehrlich

Differential Revision: https://reviews.llvm.org/D67144
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/test/tools/llvm-objcopy/ELF/binary-input-and-output.test (diff)llvm.src/test/tools/llvm-objcopy/ELF/binary-input-and-output.test
The file was removed/llvm/trunk/test/tools/llvm-objcopy/ELF/binary-input-arch.testllvm.src/test/tools/llvm-objcopy/ELF/binary-input-arch.test
The file was modified/llvm/trunk/test/tools/llvm-objcopy/ELF/binary-input-error.test (diff)llvm.src/test/tools/llvm-objcopy/ELF/binary-input-error.test
The file was modified/llvm/trunk/test/tools/llvm-objcopy/ELF/binary-input.test (diff)llvm.src/test/tools/llvm-objcopy/ELF/binary-input.test
The file was added/llvm/trunk/test/tools/llvm-objcopy/ELF/binary-output-target.testllvm.src/test/tools/llvm-objcopy/ELF/binary-output-target.test
The file was modified/llvm/trunk/test/tools/llvm-objcopy/ELF/new-symbol-visibility.test (diff)llvm.src/test/tools/llvm-objcopy/ELF/new-symbol-visibility.test
The file was modified/llvm/trunk/tools/llvm-objcopy/CopyConfig.cpp (diff)llvm.src/tools/llvm-objcopy/CopyConfig.cpp
Revision 371912 by maskray:
[llvm-ar] Uncapitalize error messages and delete full stop

Most GNU binutils don't append full stops in error messages. This
convention has been adopted by a bunch of LLVM binary utilities. Make
llvm-ar follow the convention as well.

Reviewed By: grimar

Differential Revision: https://reviews.llvm.org/D67558
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/test/Object/archive-extract.test (diff)llvm.src/test/Object/archive-extract.test
The file was modified/llvm/trunk/test/Object/archive-format.test (diff)llvm.src/test/Object/archive-format.test
The file was modified/llvm/trunk/test/Object/archive-update.test (diff)llvm.src/test/Object/archive-update.test
The file was modified/llvm/trunk/test/Object/mri2.test (diff)llvm.src/test/Object/mri2.test
The file was modified/llvm/trunk/test/Object/mri3.test (diff)llvm.src/test/Object/mri3.test
The file was modified/llvm/trunk/test/Object/mri4.test (diff)llvm.src/test/Object/mri4.test
The file was modified/llvm/trunk/test/Object/mri5.test (diff)llvm.src/test/Object/mri5.test
The file was modified/llvm/trunk/test/tools/llvm-ar/count.test (diff)llvm.src/test/tools/llvm-ar/count.test
The file was modified/llvm/trunk/test/tools/llvm-ar/insert-after.test (diff)llvm.src/test/tools/llvm-ar/insert-after.test
The file was modified/llvm/trunk/test/tools/llvm-ar/insert-before.test (diff)llvm.src/test/tools/llvm-ar/insert-before.test
The file was modified/llvm/trunk/test/tools/llvm-ar/invalid-command-line.test (diff)llvm.src/test/tools/llvm-ar/invalid-command-line.test
The file was modified/llvm/trunk/test/tools/llvm-ar/move-after.test (diff)llvm.src/test/tools/llvm-ar/move-after.test
The file was modified/llvm/trunk/test/tools/llvm-ar/move-before.test (diff)llvm.src/test/tools/llvm-ar/move-before.test
The file was modified/llvm/trunk/test/tools/llvm-ar/move.test (diff)llvm.src/test/tools/llvm-ar/move.test
The file was modified/llvm/trunk/test/tools/llvm-ar/mri-addlib.test (diff)llvm.src/test/tools/llvm-ar/mri-addlib.test
The file was modified/llvm/trunk/test/tools/llvm-ar/print.test (diff)llvm.src/test/tools/llvm-ar/print.test
The file was modified/llvm/trunk/test/tools/llvm-ar/quick-append.test (diff)llvm.src/test/tools/llvm-ar/quick-append.test
The file was modified/llvm/trunk/test/tools/llvm-ar/read-only-archive.test (diff)llvm.src/test/tools/llvm-ar/read-only-archive.test
The file was modified/llvm/trunk/test/tools/llvm-ar/replace.test (diff)llvm.src/test/tools/llvm-ar/replace.test
The file was modified/llvm/trunk/tools/llvm-ar/llvm-ar.cpp (diff)llvm.src/tools/llvm-ar/llvm-ar.cpp
Revision 371911 by pozulp:
[llvm-objcopy] Add support for response files in llvm-strip and llvm-objcopy

Summary: Addresses https://bugs.llvm.org/show_bug.cgi?id=42671

Reviewers: jhenderson, espindola, alexshap, rupprecht

Reviewed By: jhenderson

Subscribers: seiya, emaste, arichardson, jakehehrlich, MaskRay, abrachet, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65372
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/docs/CommandGuide/llvm-objcopy.rst (diff)llvm.src/docs/CommandGuide/llvm-objcopy.rst
The file was modified/llvm/trunk/docs/CommandGuide/llvm-strip.rst (diff)llvm.src/docs/CommandGuide/llvm-strip.rst
The file was modified/llvm/trunk/test/tools/llvm-objcopy/ELF/help-message.test (diff)llvm.src/test/tools/llvm-objcopy/ELF/help-message.test
The file was added/llvm/trunk/test/tools/llvm-objcopy/ELF/response-file.testllvm.src/test/tools/llvm-objcopy/ELF/response-file.test
The file was modified/llvm/trunk/tools/llvm-objcopy/CopyConfig.cpp (diff)llvm.src/tools/llvm-objcopy/CopyConfig.cpp
The file was modified/llvm/trunk/tools/llvm-objcopy/llvm-objcopy.cpp (diff)llvm.src/tools/llvm-objcopy/llvm-objcopy.cpp