#
f4e75a50 |
| 29-Oct-2018 |
Alexander Shaposhnikov <shal1t712@gmail.com> |
[llvm-objcopy] Move elf-specific code into subfolder
In this diff the elf-specific code is moved into the subfolder ELF (and factored out from llvm-objcopy.cpp).
Test plan: make check-all
Differe
[llvm-objcopy] Move elf-specific code into subfolder
In this diff the elf-specific code is moved into the subfolder ELF (and factored out from llvm-objcopy.cpp).
Test plan: make check-all
Differential revision: https://reviews.llvm.org/D53790
llvm-svn: 345544
show more ...
|
#
654d3a95 |
| 24-Oct-2018 |
Alexander Shaposhnikov <shal1t712@gmail.com> |
[llvm-objcopy] Introduce dispatch mechanism based on the input
In this diff we introduce dispatch mechanism based on the type of the input (archive, object file, raw binary) and the format (coff,
[llvm-objcopy] Introduce dispatch mechanism based on the input
In this diff we introduce dispatch mechanism based on the type of the input (archive, object file, raw binary) and the format (coff, elf, macho). We also move the ELF-specific code into the namespace llvm::objcopy::elf.
Test plan: make check-all
Differential revision: https://reviews.llvm.org/D53311
llvm-svn: 345217
show more ...
|
#
3d4c4aca |
| 16-Oct-2018 |
Alexander Shaposhnikov <shal1t712@gmail.com> |
[llvm-objcopy] Factor out Buffer
In this diff we move out the hierarchy of buffers from Object.h/Object.cpp into separate files since it is not ELF-specific and will be reused later. After this ch
[llvm-objcopy] Factor out Buffer
In this diff we move out the hierarchy of buffers from Object.h/Object.cpp into separate files since it is not ELF-specific and will be reused later. After this change Object.h/Object.cpp are almost exclusively ELF-specific.
Test plan: make check-all
Differential revision: https://reviews.llvm.org/D53298
llvm-svn: 344585
show more ...
|
#
8d0b74c9 |
| 11-Oct-2018 |
Alexander Shaposhnikov <shal1t712@gmail.com> |
[llvm-objcopy] Factor out CopyConfig
In this diff we move out CopyConfig from llvm-oobjcopy.cpp into a separate header CopyConfig.h to enable us (in the future) reuse this class in the other impleme
[llvm-objcopy] Factor out CopyConfig
In this diff we move out CopyConfig from llvm-oobjcopy.cpp into a separate header CopyConfig.h to enable us (in the future) reuse this class in the other implementations of objcopy (for coff, mach-o). Additionally this enables us to unload the complexity from llvm-objcopy.cpp a little bit.
Test plan: make check-all
Differential revision: https://reviews.llvm.org/D53006
llvm-svn: 344307
show more ...
|
#
fdb732b5 |
| 10-Oct-2018 |
Armando Montanez <amontanez@google.com> |
Test commit: fix typo in comment
llvm-svn: 344185
|
#
88478bbc |
| 10-Oct-2018 |
Fangrui Song <maskray@google.com> |
[opt] Change the parameter of OptTable::PrintHelp from Name to Usage and don't append "[options] <inputs>"
Summary: Before, "[options] <inputs>" is unconditionally appended to the `Name` parameter.
[opt] Change the parameter of OptTable::PrintHelp from Name to Usage and don't append "[options] <inputs>"
Summary: Before, "[options] <inputs>" is unconditionally appended to the `Name` parameter. It is more flexible to change its semantic to `Usage` and let user customize the usage line.
% llvm-objcopy ... USAGE: llvm-objcopy <input> [ <output> ] [options] <inputs>
With this patch:
% llvm-objcopy ... USAGE: llvm-objcopy input [output]
Reviewers: rupprecht, alexshap, jhenderson
Reviewed By: rupprecht
Subscribers: jakehehrlich, mehdi_amini, steven_wu, dexonsmith, llvm-commits
Differential Revision: https://reviews.llvm.org/D51009
llvm-svn: 344097
show more ...
|
#
af048648 |
| 01-Oct-2018 |
Puyan Lotfi <puyan@puyan.org> |
[llvm-objcopy] Adding support for decompressing zlib compressed dwarf sections.
Summary: I had added support for compressing dwarf sections in a prior commit, this one adds support for deco
[llvm-objcopy] Adding support for decompressing zlib compressed dwarf sections.
Summary: I had added support for compressing dwarf sections in a prior commit, this one adds support for decompressing. Usage is:
llvm-objcopy --decompress-debug-sections input.o output.o
Reviewers: jakehehrlich, jhenderson, alexshap
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D51841
llvm-svn: 343451
show more ...
|
#
7b1c8168 |
| 21-Sep-2018 |
Jordan Rupprecht <rupprecht@google.com> |
[llvm-objcopy/llvm-strip]: handle --version
Summary: Implement --version for objcopy and strip.
I think there are LLVM utilities that automatically handle this, but that doesn't seem to work with c
[llvm-objcopy/llvm-strip]: handle --version
Summary: Implement --version for objcopy and strip.
I think there are LLVM utilities that automatically handle this, but that doesn't seem to work with custom parsing since this binary handles both objcopy and strip, so it uses custom parsing.
This fixes PR38298
Reviewers: jhenderson, alexshap, jakehehrlich
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D52328
llvm-svn: 342702
show more ...
|
Revision tags: llvmorg-7.0.0, llvmorg-7.0.0-rc3 |
|
#
99124cc0 |
| 07-Sep-2018 |
Puyan Lotfi <puyan@puyan.org> |
[llvm-objcopy] Dwarf .debug section compression support (zlib, zlib-gnu).
Third Attempt: - Alignment issues resolved. - zlib::isAvailable() detected. - ArrayRef misuse fixed.
Usage:
[llvm-objcopy] Dwarf .debug section compression support (zlib, zlib-gnu).
Third Attempt: - Alignment issues resolved. - zlib::isAvailable() detected. - ArrayRef misuse fixed.
Usage:
llvm-objcopy --compress-debug-sections=zlib foo.o llvm-objcopy --compress-debug-sections=zlib-gnu foo.o
In both cases the debug section contents is compressed with zlib. In the GNU style case the header is the "ZLIB" magic string followed by the uint64 big- endian decompressed size. In the non-GNU mode the header is the Elf(32|64)_Chdr.
Decompression support is coming soon.
Differential Revision: https://reviews.llvm.org/D49678
llvm-svn: 341635
show more ...
|
#
5be060e3 |
| 07-Sep-2018 |
Puyan Lotfi <puyan@puyan.org> |
Revert: [llvm-objcopy] Dwarf .debug section compression (Second Attempt).
Various bots still fail for unknown reason.
llvm-svn: 341613
|
#
f0954dd2 |
| 06-Sep-2018 |
Puyan Lotfi <puyan@puyan.org> |
[llvm-objcopy] Dwarf .debug section compression support (zlib, zlib-gnu).
Second Attempt. Alignment issues resolved. zlib::isAvailable() detected.
Usage:
llvm-objcopy --compress-debug-sectio
[llvm-objcopy] Dwarf .debug section compression support (zlib, zlib-gnu).
Second Attempt. Alignment issues resolved. zlib::isAvailable() detected.
Usage:
llvm-objcopy --compress-debug-sections=zlib foo.o llvm-objcopy --compress-debug-sections=zlib-gnu foo.o
In both cases the debug section contents is compressed with zlib. In the GNU style case the header is the "ZLIB" magic string followed by the uint64 big- endian decompressed size. In the non-GNU mode the header is the Elf(32|64)_Chdr.
Decompression support is coming soon.
Differential Revision: https://reviews.llvm.org/D49678
llvm-svn: 341607
show more ...
|
#
591d8890 |
| 05-Sep-2018 |
Jordan Rupprecht <rupprecht@google.com> |
[llvm-strip] Support stripping multiple input files
Summary: Allow strip to be called on multiple input files, which is interpreted as stripping N files in place. Using multiple input files is incom
[llvm-strip] Support stripping multiple input files
Summary: Allow strip to be called on multiple input files, which is interpreted as stripping N files in place. Using multiple input files is incompatible with -o.
To allow this, create a `DriverConfig` struct which just wraps a list of `CopyConfigs`. objcopy will only ever have a single `CopyConfig`, but strip will have N (where N >= 1) CopyConfigs.
Reviewers: alexshap, jakehehrlich
Reviewed By: alexshap, jakehehrlich
Subscribers: MaskRay, jakehehrlich, llvm-commits
Differential Revision: https://reviews.llvm.org/D51660
llvm-svn: 341464
show more ...
|
#
163222f5 |
| 04-Sep-2018 |
Chandler Carruth <chandlerc@gmail.com> |
Revert r341342: Dwarf .debug section compression support (zlib, zlib-gnu).
Also reverts follow-up commits r341343 and r341344.
The primary commit continues to break some build bots even after the f
Revert r341342: Dwarf .debug section compression support (zlib, zlib-gnu).
Also reverts follow-up commits r341343 and r341344.
The primary commit continues to break some build bots even after the fixes in r341343 for UBSan issues: http://lab.llvm.org:8011/builders/clang-cmake-aarch64-full/builds/5823
It is also failing for me locally (linux, x86-64).
llvm-svn: 341360
show more ...
|
#
5a40cd5b |
| 03-Sep-2018 |
Puyan Lotfi <puyan@puyan.org> |
[llvm-objcopy] Dwarf .debug section compression support (zlib, zlib-gnu).
Usage:
llvm-objcopy --compress-debug-sections=zlib foo.o llvm-objcopy --compress-debug-sections=zlib-gnu foo.o
In
[llvm-objcopy] Dwarf .debug section compression support (zlib, zlib-gnu).
Usage:
llvm-objcopy --compress-debug-sections=zlib foo.o llvm-objcopy --compress-debug-sections=zlib-gnu foo.o
In both cases the debug section contents is compressed with zlib. In the GNU style case the header is the "ZLIB" magic string followed by the uint64 big- endian decompressed size. In the non-GNU mode the header is the Elf(32|64)_Chdr.
Decompression support is coming soon.
Differential Revision: https://reviews.llvm.org/D49678
llvm-svn: 341342
show more ...
|
#
7481540f |
| 29-Aug-2018 |
Jordan Rupprecht <rupprecht@google.com> |
[llvm-strip] Fix -p|--preserve-dates to not truncate output when used in-place.
The restoreDateOnFile() method used to preserve dates uses sys::fs::openFileForWrite(). That method defaults to openin
[llvm-strip] Fix -p|--preserve-dates to not truncate output when used in-place.
The restoreDateOnFile() method used to preserve dates uses sys::fs::openFileForWrite(). That method defaults to opening files with CD_CreateAlways, which truncates the output file if it exists. Use CD_OpenExisting instead to open it and *not* truncate it, which also has the side benefit of erroring if the file does not exist (it should always exist, because we just wrote it out).
Also, fix the test case to make sure the output is a valid output file, and not empty. The extra test assertions are enough to catch this regression.
llvm-svn: 340996
show more ...
|
Revision tags: llvmorg-7.0.0-rc2 |
|
#
0e49ef95 |
| 21-Aug-2018 |
Fangrui Song <maskray@google.com> |
[llvm-objcopy] Simplify find(X,Y) != X.end() with is_contained()
llvm-svn: 340241
|
#
ffbc3e25 |
| 20-Aug-2018 |
Fangrui Song <maskray@google.com> |
[llvm-strip] Allow only one input
Summary: Before, llvm-strip accepted a second argument but it would just be ignored.
Reviewers: alexshap, jhenderson, paulsemel
Reviewed By: alexshap
Subscribers
[llvm-strip] Allow only one input
Summary: Before, llvm-strip accepted a second argument but it would just be ignored.
Reviewers: alexshap, jhenderson, paulsemel
Reviewed By: alexshap
Subscribers: jakehehrlich, rupprecht, llvm-commits
Differential Revision: https://reviews.llvm.org/D51004
llvm-svn: 340229
show more ...
|
#
be8ebcca |
| 17-Aug-2018 |
Jordan Rupprecht <rupprecht@google.com> |
[llvm-objcopy] Implement -G/--keep-global-symbol(s).
Summary: Port GNU Objcopy -G/--keep-global-symbol(s).
This is slightly different than the already-implemented --globalize-symbol, which marks a
[llvm-objcopy] Implement -G/--keep-global-symbol(s).
Summary: Port GNU Objcopy -G/--keep-global-symbol(s).
This is slightly different than the already-implemented --globalize-symbol, which marks a symbol as global when copying. When --keep-global-symbol (alias -G) is used, *only* those symbols marked will stay global, and all other globals are demoted to local. (Also note that it doesn't *promote* a symbol to global). Additionally, there is a pluralized version of the flag --keep-global-symbols, which effectively applies --keep-global-symbol for every non-comment in a file.
Reviewers: jakehehrlich, jhenderson, alexshap
Reviewed By: jhenderson
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D50589
llvm-svn: 340105
show more ...
|
#
cf67633e |
| 17-Aug-2018 |
Jordan Rupprecht <rupprecht@google.com> |
[llvm-objcopy] Add support for -I binary -B <arch>.
Summary: The -I (--input-target) and -B (--binary-architecture) flags exist but are currently silently ignored. This adds support for -I binary fo
[llvm-objcopy] Add support for -I binary -B <arch>.
Summary: The -I (--input-target) and -B (--binary-architecture) flags exist but are currently silently ignored. This adds support for -I binary for architectures i386, x86-64 (and alias i386:x86-64), arm, aarch64, sparc, and ppc (powerpc:common64). This is largely based on D41687.
This is done by implementing an additional subclass of Reader, BinaryReader, which works by interpreting the input file as contents for .data field, sets up a synthetic header, and adds additional sections/symbols (e.g. _binary__tmp_data_txt_start).
Reviewers: jakehehrlich, alexshap, jhenderson, javed.absar
Reviewed By: jhenderson
Subscribers: jyknight, nemanjai, kbarton, fedor.sergeev, jrtc27, kristof.beyls, paulsemel, llvm-commits
Differential Revision: https://reviews.llvm.org/D50343
llvm-svn: 340070
show more ...
|
#
d1767dc5 |
| 16-Aug-2018 |
Jordan Rupprecht <rupprecht@google.com> |
[llvm-strip] Add support for -p/--preserve-dates
Summary: [llvm-strip] Preserve access/modification timestamps when -p is used.
Reviewers: jakehehrlich, jhenderson, alexshap
Reviewed By: jhenderso
[llvm-strip] Add support for -p/--preserve-dates
Summary: [llvm-strip] Preserve access/modification timestamps when -p is used.
Reviewers: jakehehrlich, jhenderson, alexshap
Reviewed By: jhenderson
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D50744
llvm-svn: 339921
show more ...
|
#
6b575395 |
| 13-Aug-2018 |
Jordan Rupprecht <rupprecht@google.com> |
[llvm-objcopy] NFC: Fix minor formatting issues
llvm-svn: 339616
|
#
88ed5e59 |
| 09-Aug-2018 |
Jordan Rupprecht <rupprecht@google.com> |
[llvm-objcopy] NFC: Add some color to error()
llvm-svn: 339404
|
#
7a3dc2c1 |
| 09-Aug-2018 |
Paul Semel <semelpaul@gmail.com> |
[llvm-objcopy] Add --prefix-symbols option
Differential Revision: https://reviews.llvm.org/D50381
llvm-svn: 339362
|
#
a42dec7a |
| 09-Aug-2018 |
Paul Semel <semelpaul@gmail.com> |
[llvm-objcopy] Add --dump-section
Differential Revision: https://reviews.llvm.org/D49979
llvm-svn: 339358
|
Revision tags: llvmorg-7.0.0-rc1 |
|
#
97604b4f |
| 02-Aug-2018 |
Puyan Lotfi <puyan@puyan.org> |
[NFC] clang-format cleanup of a couple files in llvm-objcopy.
llvm-svn: 338752
|