summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-objcopy/MachO
Commit message (Collapse)AuthorAgeFilesLines
* [llvm-objcopy][MachO] Implement --add-sectionSeiya Nuta2019-12-164-24/+148
| | | | | | | | | | | | Reviewers: alexshap, rupprecht, jhenderson Reviewed By: alexshap, jhenderson Subscribers: mgorny, jakehehrlich, abrachet, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66283
* [llvm-objcopy][MachO] Implement --dump-sectionSeiya Nuta2019-11-251-5/+34
| | | | | | | | | | | | Reviewers: alexshap, rupprecht, jhenderson Reviewed By: alexshap, rupprecht, jhenderson Subscribers: MaskRay, jakehehrlich, abrachet, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66408
* [llvm-objcopy][MachO] Implement --strip-debugFangrui Song2019-11-211-3/+3
| | | | | | Reviewed By: alexshap Differential Revision: https://reviews.llvm.org/D70476
* [llvm-objcopy][MachO] Fix symbol order in the symbol tableFangrui Song2019-11-211-3/+5
| | | | | | | | | | Only consider isUndefinedSymbol() when the symbol is not local. This fixes an assert failure when copying the symbol table, if a n_type=0x20 symbol is followed by a n_type=0x64 symbol. Reviewed By: alexshap, seiya Differential Revision: https://reviews.llvm.org/D70475
* Introduce llvm-install-name-toolAlexander Shaposhnikov2019-11-195-12/+45
| | | | | | | | | | 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
* Revert "Introduce llvm-install-name-tool"Alexander Shaposhnikov2019-11-195-45/+12
| | | | | This temporarily reverts the commit 88f00aef684ff84a6494e1f17d5466c5678f703d. The change broke the buildbot http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/36836
* Introduce llvm-install-name-toolAlexander Shaposhnikov2019-11-195-12/+45
| | | | | | | | | | 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
* [llvm-objcopy][MachO] Implement --redefine-sym and --redefine-symsFangrui Song2019-11-152-3/+15
| | | | | | | | | | Similar to D46029 (ELF) and D70036 (COFF), but for MachO. Note, when --strip-symbol (not implemented for MachO) is also specified, --redefine-sym executes before --strip-symbol. Reviewed By: jhenderson, seiya Differential Revision: https://reviews.llvm.org/D70212
* [llvm-objcopy][MachO] Implement --remove-sectionSeiya Nuta2019-11-151-5/+12
| | | | | | | | | | | | Reviewers: alexshap, rupprecht, jhenderson Reviewed By: rupprecht, jhenderson Subscribers: jakehehrlich, abrachet, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66282
* Revert "Introduce llvm-install-name-tool"Alexander Shaposhnikov2019-11-063-31/+2
| | | | This reverts commit b5913e6d2f6d13fb753df701619731ca11936316.
* Introduce llvm-install-name-toolAlexander Shaposhnikov2019-11-063-2/+31
| | | | | | | | | 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
* [llvm-objcopy][MachO] Implement --strip-allSeiya Nuta2019-10-313-6/+60
| | | | | | | | | | | | Reviewers: alexshap, rupprecht, jdoerfert, jhenderson Reviewed By: alexshap Subscribers: jakehehrlich, abrachet, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66281
* [llvm-objcopy][MachO] Support indirect symbol tableSeiya Nuta2019-10-303-9/+32
| | | | | | | | | | | | | | | | | Summary: Parse the indirect symbol table and update the indexes of symbol entries in the table in the writer in case they have been changed. Reviewers: alexshap, rupprecht, jhenderson Reviewed By: alexshap, rupprecht Subscribers: jakehehrlich, abrachet, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66280
* [llvm-objcopy][MachO] Implement --only-sectionSeiya Nuta2019-10-284-5/+30
| | | | | | | | | | | | Reviewers: alexshap, rupprecht, jdoerfert, jhenderson Reviewed By: alexshap, rupprecht, jhenderson Subscribers: mgorny, jakehehrlich, abrachet, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65541
* [llvm-objcopy][MachO] Add support for min os version load commandsAlexander Shaposhnikov2019-10-251-0/+3
| | | | | | | | Add support for min os version load commands. Test plan: make check-all Differential revision: https://reviews.llvm.org/D69419
* [llvm-objcopy] Add --set-section-alignmentFangrui Song2019-10-021-7/+8
| | | | | | | | | | | | | Fixes PR43181. This option was recently added to GNU objcopy (binutils PR24942). `llvm-objcopy -I binary -O elf64-x86-64 --set-section-alignment .data=8` can set the alignment of .data. Reviewed By: grimar, jhenderson, rupprecht Differential Revision: https://reviews.llvm.org/D67656 llvm-svn: 373461
* [Alignment][NFC] Remove unneeded llvm:: scoping on Align typesGuillaume Chatelet2019-09-271-1/+1
| | | | llvm-svn: 373081
* [Alignment] Move OffsetToAlignment to Alignment.hGuillaume Chatelet2019-09-121-1/+2
| | | | | | | | | | | | | | | | | Summary: This is patch is part of a series to introduce an Alignment type. See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html See this patch for the introduction of the type: https://reviews.llvm.org/D64790 Reviewers: courbet, JDevlieghere, alexshap, rupprecht, jhenderson Subscribers: sdardis, nemanjai, hiraditya, kbarton, jakehehrlich, jrtc27, MaskRay, atanasyan, jsji, seiya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D67499 llvm-svn: 371742
* [llvm-objcopy] Allow the visibility of symbols created by --binary andChris Jackson2019-08-301-4/+5
| | | | | | --add-symbol to be specified with --new-symbol-visibility llvm-svn: 370458
* Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI.Simon Pilgrim2019-08-201-1/+2
| | | | llvm-svn: 369366
* [llvm-objcopy][MachO] Fix method names. NFC.Seiya Nuta2019-08-201-2/+2
| | | | | | | | | | | | | | Reviewers: alexshap, rupprecht, jhenderson Reviewed By: alexshap, rupprecht Subscribers: jakehehrlich, abrachet, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65540 llvm-svn: 369346
* Recommit "[llvm-objcopy][MachO] Implement a layout algorithm for executables"Seiya Nuta2019-08-191-20/+46
| | | | | | | | | | | | | | | | Summary: The layout algorithm for relocatable objects and for executable are somewhat different. This patch implements the latter one based on the algorithm in LLD (MachOFileLayout). Reviewers: alexshap, rupprecht, jhenderson Reviewed By: alexshap Subscribers: jakehehrlich, abrachet, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65539 llvm-svn: 369301
* Recommit "[llvm-objcopy][MachO] Support load commands used in ↵Seiya Nuta2019-08-198-210/+559
| | | | | | | | | | | | | | | | | | | | | executables/shared libraries" Summary: This patch implements copying some load commands that appear in executables/shared libraries such as the indirect symbol table. I don't add tests intentionally because this patch is incomplete: we need a layout algorithm for executables/shared libraries. I'll submit it as a separate patch with tests. Reviewers: alexshap, rupprecht, jhenderson, compnerd Reviewed By: alexshap Subscribers: abrachet, mgorny, mgrang, MaskRay, mtrent, jakehehrlich, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63395 llvm-svn: 369298
* Revert r369230 and r369231Seiya Nuta2019-08-198-585/+210
| | | | | | | | | | Looks these commits break CI builds: - http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-gn/builds/4159 This commit reverts r369230 and r369231 (git coommit: 4a198a7 and dee9546). llvm-svn: 369234
* [llvm-objcopy][MachO] Implement a layout algorithm for executablesSeiya Nuta2019-08-191-20/+46
| | | | | | | | | | | | | | | | Summary: The layout algorithm for relocatable objects and for executable are somewhat different. This patch implements the latter one based on the algorithm in LLD (MachOFileLayout). Reviewers: alexshap, rupprecht, jhenderson Reviewed By: alexshap Subscribers: jakehehrlich, abrachet, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65539 llvm-svn: 369231
* [llvm-objcopy][MachO] Support load commands used in executables/shared librariesSeiya Nuta2019-08-198-210/+559
| | | | | | | | | | | | | | | | | | | Summary: This patch implements copying some load commands that appear in executables/shared libraries such as the indirect symbol table. I don't add tests intentionally because this patch is incomplete: we need a layout algorithm for executables/shared libraries. I'll submit it as a separate patch with tests. Reviewers: alexshap, rupprecht, jhenderson, compnerd Reviewed By: alexshap Subscribers: abrachet, mgorny, mgrang, MaskRay, mtrent, jakehehrlich, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63395 llvm-svn: 369230
* [llvm] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-151-2/+2
| | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. llvm-svn: 369013
* [llvm-objcopy][MachO] Fix strict-aliasing warning. NFCISeiya Nuta2019-06-241-3/+1
| | | | | | | | | | | | | | | | | | | Summary: Use MachOObjectFile::isRelocationScattered instead of reinterpret_cast. Fixes https://bugs.llvm.org/show_bug.cgi?id=42360 Reviewers: alexshap, rupprecht, jhenderson Reviewed By: alexshap Subscribers: dendibakh, bjope, uabelho, jakehehrlich, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63699 llvm-svn: 364252
* [llvm-objcopy][MachO] Rebuild the symbol/string table in the writerSeiya Nuta2019-06-216-76/+135
| | | | | | | | | | | | | | | | Summary: Build the string table using StringTableBuilder, reassign symbol indices, and update symbol indices in relocations to allow adding/modifying/removing symbols from the object. Reviewers: alexshap, rupprecht, jhenderson Reviewed By: alexshap Subscribers: mgorny, jakehehrlich, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63309 llvm-svn: 364000
* Fix MSVC "32-bit shift implicitly converted to 64 bits" warning. NFCI.Simon Pilgrim2019-06-101-1/+1
| | | | llvm-svn: 362927
* [llvm-objcopy][MachO] Recompute and update offset/size fields in the writerSeiya Nuta2019-06-085-11/+262
| | | | | | | | | | | | | | | | | | | | Summary: Recompute and update offset/size fields so that we can implement llvm-objcopy options like --only-section. This patch is the first step and focuses on supporting load commands that covered by existing tests: executable files and dynamic libraries are not supported. Reviewers: alexshap, rupprecht, jhenderson Reviewed By: alexshap, rupprecht Subscribers: compnerd, jakehehrlich, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62652 llvm-svn: 362863
* [llvm-objcopy][MachO] Print an error message on use of unsupported optionsSeiya Nuta2019-05-291-1/+37
| | | | | | | | | | | | | | | | | | | Summary: It is better to print an error message instead of silently ignoring unsupported options. As mentioned in https://reviews.llvm.org/D57045, this is not the best solution and we should print which flag is not supported at some time. Reviewers: alexshap, rupprecht, jhenderson, jakehehrlich Reviewed By: alexshap, rupprecht, jakehehrlich Subscribers: jakehehrlich, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62578 llvm-svn: 362040
* [Object] Change ObjectFile::getSectionContents to return ↵Fangrui Song2019-05-141-5/+6
| | | | | | | | | | | | | | | | | | | Expected<ArrayRef<uint8_t>> Change std::error_code getSectionContents(DataRefImpl, StringRef &) const; to Expected<ArrayRef<uint8_t>> getSectionContents(DataRefImpl) const; Many object formats use ArrayRef<uint8_t> as the underlying type, which is generally better than StringRef to represent binary data, so change the type to decrease the number of type conversions. Reviewed By: ruiu, sbc100 Differential Revision: https://reviews.llvm.org/D61781 llvm-svn: 360648
* [llvm-objcopy][NFC] Remove unnecessary llvm-objcopy.h #includesJordan Rupprecht2019-03-132-2/+0
| | | | llvm-svn: 356109
* Update new files added to llvm-objcopy to use the new file header.Chandler Carruth2019-02-117-28/+21
| | | | llvm-svn: 353666
* [llvm-objcopy][NFC] simplify an error returnJordan Rupprecht2019-02-041-3/+1
| | | | llvm-svn: 353074
* [llvm-objcopy][NFC] Fix trailing semicolon warning.Clement Courbet2019-02-041-2/+2
| | | | llvm-svn: 353035
* [llvm-objcopy] Add ability to copy MachO object filesAlexander Shaposhnikov2019-02-027-0/+955
This diff implements first bits for copying (without modification) MachO object files. Test plan: make check-all Differential revision: https://reviews.llvm.org/D54674 llvm-svn: 352944
OpenPOWER on IntegriCloud