1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/tools
Fangrui Song dd2cb2d821 [llvm-objcopy][ELF] Implement --only-keep-debug
--only-keep-debug produces a debug file as the output that only
preserves contents of sections useful for debugging purposes (the
binutils implementation preserves SHT_NOTE and non-SHF_ALLOC sections),
by changing their section types to SHT_NOBITS and rewritting file
offsets.

See https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html

The intended use case is:

```
llvm-objcopy --only-keep-debug a a.dbg
llvm-objcopy --strip-debug a b
llvm-objcopy --add-gnu-debuglink=a.dbg b
```

The current layout algorithm is incapable of deleting contents and
shrinking segments, so it is not suitable for implementing the
functionality.

This patch adds a new algorithm which assigns sh_offset to sections
first, then modifies p_offset/p_filesz of program headers. It bears a
resemblance to lld/ELF/Writer.cpp.

Reviewed By: jhenderson, jakehehrlich

Differential Revision: https://reviews.llvm.org/D67137
2019-11-05 08:56:15 -08:00
..
bugpoint Revert "[NFC] Rename LLVM_NO_DEAD_STRIP" 2019-10-30 14:56:20 -04:00
bugpoint-passes [LegacyPassManager] Delete BasicBlockPass/Manager. 2019-10-30 11:40:16 -07:00
dsymutil [dsymutil] Add support for linking remarks 2019-11-01 15:38:49 -07:00
gold [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
llc Revert "[NFC] Rename LLVM_NO_DEAD_STRIP" 2019-10-30 14:56:20 -04:00
lli [lli-child-target] Fix -DBUILD_SHARED_LIBS=on build 2019-10-29 22:46:13 -07:00
llvm-ar Fix uninitialized variable warning. NFCI. 2019-11-02 18:03:21 +00:00
llvm-as
llvm-as-fuzzer
llvm-bcanalyzer
llvm-c-test [IR] Add Freeze instruction 2019-11-05 15:54:56 +09:00
llvm-cat
llvm-cfi-verify [Mips] Use appropriate private label prefix based on Mips ABI 2019-10-23 12:24:35 +02:00
llvm-config llvm-config: emit the C++ standard flag into CXXFLAGS 2019-11-01 09:13:58 -07:00
llvm-cov Revert "[llvm-cov] Add option to whitelist filenames" 2019-10-29 22:38:38 -07:00
llvm-cvtres
llvm-cxxdump [llvm/Object] - Make ELFObjectFile::getRelocatedSection return Expected<section_iterator> 2019-10-21 11:06:38 +00:00
llvm-cxxfilt
llvm-cxxmap
llvm-diff
llvm-dis [Tools] Mark output of tools as text if it is text 2019-10-08 08:21:20 +00:00
llvm-dwarfdump [Tools] Mark output of tools as text if it is text 2019-10-08 08:21:20 +00:00
llvm-dwp [Mips] Use appropriate private label prefix based on Mips ABI 2019-10-23 12:24:35 +02:00
llvm-elfabi [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
llvm-exegesis [Mips] Use appropriate private label prefix based on Mips ABI 2019-10-23 12:24:35 +02:00
llvm-extract [llvm-extract] Update the help message for group extraction feature 2019-08-20 20:45:16 +00:00
llvm-go Bump llvm-go to C++14 2019-08-15 10:55:25 +00:00
llvm-ifs [llvm-ifs][NFC] Adds TODO comment for dropping ObjectFileFormat on yaml format. 2019-10-24 10:14:34 -07:00
llvm-isel-fuzzer [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
llvm-itanium-demangle-fuzzer
llvm-jitlink [Mips] Use appropriate private label prefix based on Mips ABI 2019-10-23 12:24:35 +02:00
llvm-jitlistener
llvm-link [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
llvm-lipo [llvm-lipo] Add missing cast 2019-10-15 20:10:34 +00:00
llvm-lto [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
llvm-lto2 [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
llvm-mc [Mips] Use appropriate private label prefix based on Mips ABI 2019-10-23 12:24:35 +02:00
llvm-mc-assemble-fuzzer [Mips] Use appropriate private label prefix based on Mips ABI 2019-10-23 12:24:35 +02:00
llvm-mc-disassemble-fuzzer
llvm-mca [Mips] Use appropriate private label prefix based on Mips ABI 2019-10-23 12:24:35 +02:00
llvm-microsoft-demangle-fuzzer
llvm-modextract
llvm-mt
llvm-nm Revert [llvm-nm] Add tapi file support 2019-09-11 21:35:28 +00:00
llvm-objcopy [llvm-objcopy][ELF] Implement --only-keep-debug 2019-11-05 08:56:15 -08:00
llvm-objdump [Mips] Use appropriate private label prefix based on Mips ABI 2019-10-23 12:24:35 +02:00
llvm-opt-fuzzer [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
llvm-opt-report [llvm-opt-report] Improve error handling 2019-09-13 20:52:04 +00:00
llvm-pdbutil [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
llvm-profdata Prune Pass.h include from DataLayout.h. NFCI 2019-10-21 17:51:54 +00:00
llvm-rc [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
llvm-readobj [llvm-readobj] Change errors to warnings for symbol section name dumping 2019-11-04 12:04:04 +00:00
llvm-reduce llvm-reduce: Follow-up to 372280, now with more-better msan fixing 2019-09-19 20:04:04 +00:00
llvm-rtdyld [Mips] Use appropriate private label prefix based on Mips ABI 2019-10-23 12:24:35 +02:00
llvm-shlib [LLVM-C] Fix omission of INSTALL_WITH_TOOLCHAIN to llvm_add_library() 2019-08-28 22:59:04 +00:00
llvm-size Reapply: [llvm-size] Tidy up error messages (PR42970) 2019-10-14 17:29:15 +00:00
llvm-special-case-list-fuzzer
llvm-split
llvm-stress [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
llvm-strings
llvm-symbolizer
llvm-undname [Demangle] Add a few more options to the microsoft demangler 2019-10-15 08:29:56 +00:00
llvm-xray [llvm-objdump] Add warning messages if disassembly + source for problematic inputs 2019-08-15 05:15:22 +00:00
llvm-yaml-numeric-parser-fuzzer
lto [LTO][Legacy] Add new C inferface to query libcall functions 2019-09-16 18:49:54 +00:00
msbuild
obj2yaml [yaml2obj/obj2yaml] - Add support for SHT_GNU_HASH section. 2019-10-31 12:25:37 +03:00
opt Revert "[NFC] Rename LLVM_NO_DEAD_STRIP" 2019-10-30 14:56:20 -04:00
opt-viewer [llvm] [cmake] Add install targets for missing distribution components 2019-10-02 16:06:50 +00:00
remarks-shlib [Remarks] Add parser for bitstream remarks 2019-09-09 17:43:50 +00:00
sancov [Mips] Use appropriate private label prefix based on Mips ABI 2019-10-23 12:24:35 +02:00
sanstats
verify-uselistorder
vfabi-demangle-fuzzer [SVFS] Vector Function ABI demangling. 2019-09-19 17:47:32 +00:00
xcode-toolchain
yaml2obj [yaml2obj/ObjectYAML] - Cleanup the error reporting API, add custom errors handlers. 2019-09-13 16:00:16 +00:00
CMakeLists.txt
LLVMBuild.txt [llvm-ifs][IFS] llvm Interface Stubs merging + object file generation tool. 2019-08-30 18:26:05 +00:00