#
c2a84771 |
| 03-Feb-2021 |
Jian Cai <jiancai@google.com> |
[llvm-objcopy] preserve file ownership when overwritten by root
As of binutils 2.36, GNU strip calls chown(2) for "sudo strip foo" and "sudo strip foo -o foo", but no "sudo strip foo -o bar" or "sud
[llvm-objcopy] preserve file ownership when overwritten by root
As of binutils 2.36, GNU strip calls chown(2) for "sudo strip foo" and "sudo strip foo -o foo", but no "sudo strip foo -o bar" or "sudo strip foo -o ./foo". In other words, while "sudo strip foo -o bar" creates a new file bar with root access, "sudo strip foo" will keep the owner and group of foo unchanged. Currently llvm-objcopy and llvm-strip behave differently, always changing the owner and gropu to root. The discrepancy prevents Chrome OS from migrating to llvm-objcopy and llvm-strip as they change file ownership and cause intended users/groups to lose access when invoked by sudo with the following sequence (recommended in man page of GNU strip).
1.<Link the executable as normal.> 1.<Copy "foo" to "foo.full"> 1.<Run "strip --strip-debug foo"> 1.<Run "objcopy --add-gnu-debuglink=foo.full foo">
This patch makes llvm-objcopy and llvm-strip follow GNU's behavior.
Link: crbug.com/1108880
show more ...
|
#
310a8e1d |
| 23-Oct-2020 |
Keith Smiley <keithbsmiley@gmail.com> |
[llvm-objcopy][NFC] Extract arg parsing logic into a helper function
This diff refactors the code which determines the tool type based on how llvm-objcopy is invoked (objcopy vs strip vs bitcode-str
[llvm-objcopy][NFC] Extract arg parsing logic into a helper function
This diff refactors the code which determines the tool type based on how llvm-objcopy is invoked (objcopy vs strip vs bitcode-strip vs install-name-tool). NFC.
Test plan: make check-all
Differential revision: https://reviews.llvm.org/D89713
show more ...
|
Revision tags: llvmorg-11.0.0, llvmorg-11.0.0-rc6 |
|
#
315970de |
| 06-Oct-2020 |
Alexander Shaposhnikov <alexshap@fb.com> |
[llvm-objcopy][MachO] Add support for universal binaries
This diff adds support for universal binaries to llvm-objcopy. This is a recommit of 32c8435ef70031 with the asan issue fixed.
Test plan: ma
[llvm-objcopy][MachO] Add support for universal binaries
This diff adds support for universal binaries to llvm-objcopy. This is a recommit of 32c8435ef70031 with the asan issue fixed.
Test plan: make check-all
Differential revision: https://reviews.llvm.org/D88400
show more ...
|
#
80f66ac0 |
| 06-Oct-2020 |
Dmitri Gribenko <gribozavr@gmail.com> |
Revert "[llvm-objcopy][MachO] Add support for universal binaries"
This reverts commit 32c8435ef70031d7bd3dce48e41bdce65747e123. It fails ASan, details in https://reviews.llvm.org/D88400.
|
#
8ed7946a |
| 06-Oct-2020 |
Dmitri Gribenko <gribozavr@gmail.com> |
Revert "[llvm-objcopy][MachO] Add missing std::move."
This reverts commit 6e25586990b93e2c9eaaa4f473b6720ccd646c46. It depends on 32c8435ef70031d7bd3dce48e41bdce65747e123, which I'm reverting due to
Revert "[llvm-objcopy][MachO] Add missing std::move."
This reverts commit 6e25586990b93e2c9eaaa4f473b6720ccd646c46. It depends on 32c8435ef70031d7bd3dce48e41bdce65747e123, which I'm reverting due to ASan failures. Details in https://reviews.llvm.org/D88400.
show more ...
|
#
6e255869 |
| 05-Oct-2020 |
Alexander Shaposhnikov <alexshap@fb.com> |
[llvm-objcopy][MachO] Add missing std::move.
This change fixes the build issue introduced by 32c8435ef7 (detected by the buildbot fuchsia-x86_64-linux).
Test plan: make check-all
|
Revision tags: llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4 |
|
#
32c8435e |
| 28-Sep-2020 |
Alexander Shaposhnikov <alexshap@fb.com> |
[llvm-objcopy][MachO] Add support for universal binaries
This diff adds support for universal binaries to llvm-objcopy.
Test plan: make check-all
Differential revision: https://reviews.llvm.org/D8
[llvm-objcopy][MachO] Add support for universal binaries
This diff adds support for universal binaries to llvm-objcopy.
Test plan: make check-all
Differential revision: https://reviews.llvm.org/D88400
show more ...
|
Revision tags: llvmorg-11.0.0-rc3 |
|
#
0373c768 |
| 19-Sep-2020 |
Alexey Lapshin <a.v.lapshin@mail.ru> |
[llvm-objcopy][NFC] refactor error handling. part 3.
Remove usages of special error reporting functions(error(), reportError()). Errors are reported as Expected<>/Error returning values. This part i
[llvm-objcopy][NFC] refactor error handling. part 3.
Remove usages of special error reporting functions(error(), reportError()). Errors are reported as Expected<>/Error returning values. This part is for ELF subfolder of llvm-objcopy.
Testing: check-all.
Differential Revision: https://reviews.llvm.org/D87987
show more ...
|
#
5495b691 |
| 19-Sep-2020 |
Alexander Shaposhnikov <alexshap@fb.com> |
[llvm-objcopy][MachO] Add llvm-bitcode-strip driver
This diff adds llvm-bitcode-strip driver to llvm-objcopy. In the future this will enable us to build a replacement for the tool bitcode_strip.
Te
[llvm-objcopy][MachO] Add llvm-bitcode-strip driver
This diff adds llvm-bitcode-strip driver to llvm-objcopy. In the future this will enable us to build a replacement for the tool bitcode_strip.
Test plan: make check-all
Differential revision: https://reviews.llvm.org/D87212
show more ...
|
Revision tags: llvmorg-11.0.0-rc2, llvmorg-11.0.0-rc1, llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3, llvmorg-10.0.1-rc2, llvmorg-10.0.1-rc1, llvmorg-10.0.0, llvmorg-10.0.0-rc6 |
|
#
f2f96eb6 |
| 22-Mar-2020 |
Fangrui Song <maskray@google.com> |
[llvm-objcopy] Improve tool selection logic to recognize llvm-strip-$major as strip
Debian and some other distributions install llvm-strip as llvm-strip-$major (e.g. `/usr/bin/llvm-strip-9`)
D54193
[llvm-objcopy] Improve tool selection logic to recognize llvm-strip-$major as strip
Debian and some other distributions install llvm-strip as llvm-strip-$major (e.g. `/usr/bin/llvm-strip-9`)
D54193 made it work with llvm-strip-$major but did not add a test. The behavior was regressed by D69146.
Fixes https://github.com/ClangBuiltLinux/linux/issues/940
Reviewed By: alexshap
Differential Revision: https://reviews.llvm.org/D76562
show more ...
|
Revision tags: llvmorg-10.0.0-rc5, llvmorg-10.0.0-rc4 |
|
#
213aea4c |
| 11-Mar-2020 |
Reid Kleckner <rnk@google.com> |
Remove unused Endian.h includes, NFC
Mainly avoids including Host.h everywhere:
$ diff -u <(sort thedeps-before.txt) <(sort thedeps-after.txt) \ | grep '^[-+] ' | sort | uniq -c | sort -nr 3
Remove unused Endian.h includes, NFC
Mainly avoids including Host.h everywhere:
$ diff -u <(sort thedeps-before.txt) <(sort thedeps-after.txt) \ | grep '^[-+] ' | sort | uniq -c | sort -nr 3141 - /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/Support/Host.h
show more ...
|
Revision tags: llvmorg-10.0.0-rc3, llvmorg-10.0.0-rc2, llvmorg-10.0.0-rc1 |
|
#
f2af0607 |
| 30-Jan-2020 |
Derek Schuff <dschuff@chromium.org> |
[llvm-objcopy] Initial support for wasm in llvm-objcopy
Currently only supports simple copying, other operations to follow.
Reviewers: sbc100, alexshap, jhenderson
Differential Revision: https://r
[llvm-objcopy] Initial support for wasm in llvm-objcopy
Currently only supports simple copying, other operations to follow.
Reviewers: sbc100, alexshap, jhenderson
Differential Revision: https://reviews.llvm.org/D70930
This is a reland of a928d127a with a one-line fix to ensure that the wasm version number is written as little-endian (it's the only field in all of the binary format that's not a single byte or an LEB, but we may have to watch out more when we start handling the linking section).
show more ...
|
#
5ea83eef |
| 29-Jan-2020 |
Derek Schuff <dschuff@chromium.org> |
Revert "[llvm-objcopy] Initial support for wasm in llvm-objcopy"
This reverts commit a928d127a52a061733d2e42c4c9159a267f7dbd4.
It seems to cause issues with big-endian architectures.
|
Revision tags: llvmorg-11-init, llvmorg-9.0.1, llvmorg-9.0.1-rc3, llvmorg-9.0.1-rc2, llvmorg-9.0.1-rc1 |
|
#
a928d127 |
| 23-Nov-2019 |
Derek Schuff <dschuff@chromium.org> |
[llvm-objcopy] Initial support for wasm in llvm-objcopy
Currently only supports simple copying, other operations to follow.
Reviewers: sbc100, alexshap, jhenderson
Differential Revision: https://r
[llvm-objcopy] Initial support for wasm in llvm-objcopy
Currently only supports simple copying, other operations to follow.
Reviewers: sbc100, alexshap, jhenderson
Differential Revision: https://reviews.llvm.org/D70930
show more ...
|
#
c54959c0 |
| 20-Nov-2019 |
Alexander Shaposhnikov <alexshap@fb.com> |
Introduce llvm-install-name-tool
This diff adds a new "driver" for llvm-objcopy which is supposed to emulate the behavior of install-name-tool. This is a recommit of b5913e6 with ubsan, test depende
Introduce llvm-install-name-tool
This diff adds a new "driver" for llvm-objcopy which is supposed to emulate the behavior of install-name-tool. This is a recommit of b5913e6 with ubsan, test dependencies issues fixed.
Differential revision: https://reviews.llvm.org/D69146
Test plan: make check-all
show more ...
|
#
2cea161b |
| 20-Nov-2019 |
Alexander Shaposhnikov <alexshap@fb.com> |
Revert "Introduce llvm-install-name-tool"
This temporarily reverts the commit 88f00aef684ff84a6494e1f17d5466c5678f703d. The change broke the buildbot http://lab.llvm.org:8011/builders/sanitizer-x86_
Revert "Introduce llvm-install-name-tool"
This temporarily reverts the commit 88f00aef684ff84a6494e1f17d5466c5678f703d. The change broke the buildbot http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/36836
show more ...
|
#
88f00aef |
| 18-Nov-2019 |
Alexander Shaposhnikov <alexshap@fb.com> |
Introduce llvm-install-name-tool
This diff adds a new "driver" for llvm-objcopy which is supposed to emulate the behavior of install-name-tool. This is a recommit of b5913e6d2 with ubsan issues fixe
Introduce llvm-install-name-tool
This diff adds a new "driver" for llvm-objcopy which is supposed to emulate the behavior of install-name-tool. This is a recommit of b5913e6d2 with ubsan issues fixed.
Differential revision: https://reviews.llvm.org/D69146
Test plan: make check-all
show more ...
|
#
7d83c298 |
| 07-Nov-2019 |
Alexander Shaposhnikov <alexshap@fb.com> |
Revert "Introduce llvm-install-name-tool"
This reverts commit b5913e6d2f6d13fb753df701619731ca11936316.
|
#
b5913e6d |
| 17-Oct-2019 |
Alexander Shaposhnikov <alexshap@fb.com> |
Introduce llvm-install-name-tool
This diff adds a new "driver" for llvm-objcopy which is supposed to emulate the behavior of install-name-tool.
Differential revision: https://reviews.llvm.org/D6914
Introduce llvm-install-name-tool
This diff adds a new "driver" for llvm-objcopy which is supposed to emulate the behavior of install-name-tool.
Differential revision: https://reviews.llvm.org/D69146
Test plan: make check-all
show more ...
|
#
edeebad7 |
| 17-Oct-2019 |
Jordan Rupprecht <rupprecht@google.com> |
[llvm-objcopy] Add support for shell wildcards
Summary: GNU objcopy accepts the --wildcard flag to allow wildcard matching on symbol-related flags. (Note: it's implicitly true for section flags).
T
[llvm-objcopy] Add support for shell wildcards
Summary: GNU objcopy accepts the --wildcard flag to allow wildcard matching on symbol-related flags. (Note: it's implicitly true for section flags).
The basic syntax is to allow *, ?, \, and [] which work similarly to how they work in a shell. Additionally, starting a wildcard with ! causes that wildcard to prevent it from matching a flag.
Use an updated GlobPattern in libSupport to handle these patterns. It does not fully match the `fnmatch` used by GNU objcopy since named character classes (e.g. `[[:digit:]]`) are not supported, but this should support most existing use cases (mostly just `*` is what's used anyway).
Reviewers: jhenderson, MaskRay, evgeny777, espindola, alexshap
Reviewed By: MaskRay
Subscribers: nickdesaulniers, emaste, arichardson, hiraditya, jakehehrlich, abrachet, seiya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66613
llvm-svn: 375169
show more ...
|
#
c83eefcf |
| 24-Sep-2019 |
Seiya Nuta <nuta@seiya.me> |
[llvm-objcopy] Refactor ELF-specific config out to ELFCopyConfig. NFC.
Summary: This patch splits the command-line parsing into two phases:
First, parse cross-platform options and leave ELF-specifi
[llvm-objcopy] Refactor ELF-specific config out to ELFCopyConfig. NFC.
Summary: This patch splits the command-line parsing into two phases:
First, parse cross-platform options and leave ELF-specific options unparsed.
Second, in the ELF implementation, parse ELF-specific options and construct ELFCopyConfig.
Reviewers: espindola, alexshap, rupprecht, jhenderson, jakehehrlich, MaskRay
Reviewed By: alexshap, jhenderson, jakehehrlich, MaskRay
Subscribers: mgorny, emaste, arichardson, jakehehrlich, MaskRay, abrachet, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67139
llvm-svn: 372712
show more ...
|
Revision tags: llvmorg-9.0.0, llvmorg-9.0.0-rc6 |
|
#
c45fd0ca |
| 14-Sep-2019 |
Michael Pozulp <pozulp.llvm@gmail.com> |
[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
Re
[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
llvm-svn: 371911
show more ...
|
Revision tags: llvmorg-9.0.0-rc5, llvmorg-9.0.0-rc4, llvmorg-9.0.0-rc3 |
|
#
ebd50291 |
| 20-Aug-2019 |
Fangrui Song <maskray@google.com> |
[llvm-objcopy] Append '\n' to warning messages
Currently the warning message of `llvm-strip %t.o %t.o` does not include the trailing newline. Fix this by appending a '\n'.
This is the only warning
[llvm-objcopy] Append '\n' to warning messages
Currently the warning message of `llvm-strip %t.o %t.o` does not include the trailing newline. Fix this by appending a '\n'.
This is the only warning llvm-objcopy and llvm-strip can issue.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D66475
llvm-svn: 369391
show more ...
|
Revision tags: llvmorg-9.0.0-rc2, llvmorg-9.0.0-rc1, llvmorg-10-init |
|
#
6dc59629 |
| 11-Jul-2019 |
Fangrui Song <maskray@google.com> |
[llvm-objcopy] Don't change permissions of non-regular output files
There is currently an EPERM error when a regular user executes `llvm-objcopy a.o /dev/null`. Worse, root can even change the mode
[llvm-objcopy] Don't change permissions of non-regular output files
There is currently an EPERM error when a regular user executes `llvm-objcopy a.o /dev/null`. Worse, root can even change the mode bits of /dev/null.
Fix it by checking if the output file is special.
A new overload of llvm::sys::fs::setPermissions with FD as the parameter is added. Users should provide `perm & ~umask` as the parameter if they intend to respect umask.
The existing overload of llvm::sys::fs::setPermissions may be deleted if we can find an implementation of fchmod() on Windows. fchmod() is usually better than chmod() because it saves syscalls and can avoid race condition.
Reviewed By: jakehehrlich, jhenderson
Differential Revision: https://reviews.llvm.org/D64236
llvm-svn: 365753
show more ...
|
Revision tags: llvmorg-8.0.1, llvmorg-8.0.1-rc4 |
|
#
ecb60b7e |
| 05-Jul-2019 |
Seiya Nuta <nuta@seiya.me> |
[llvm-objcopy][NFC] Refactor output target parsing v2
Summary: Use an enum instead of string to hold the output file format in Config.InputFormat and Config.OutputFormat. It's essential to support o
[llvm-objcopy][NFC] Refactor output target parsing v2
Summary: Use an enum instead of string to hold the output file format in Config.InputFormat and Config.OutputFormat. It's essential to support other output file formats other than ELF.
This patch originally has been submitted as D63239. However, there was an use-of-uninitialized-value bug and reverted in r364379 (git commit 4ee933c).
This patch includes the fix for the bug by setting Config.InputFormat/Config.OutputFormat in parseStripOptions.
Reviewers: espindola, alexshap, rupprecht, jhenderson
Reviewed By: jhenderson
Subscribers: emaste, arichardson, jakehehrlich, MaskRay, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64170
llvm-svn: 365173
show more ...
|