summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-objcopy/ELF/Object.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [llvm-objcopy] Avoid invalid Sec.Offset after D79229Fangrui Song2020-05-031-4/+4
| | | | | | | | | | | | To avoid undefined behavior caught by -fsanitize=undefined on binary-paddr.test void SectionWriter::visit(const Section &Sec) { if (Sec.Type != SHT_NOBITS) // Sec.Contents is empty while Sec.Offset may be out of bound llvm::copy(Sec.Contents, Out.getBufferStart() + Sec.Offset); } (cherry picked from commit 762fb1c40eea6878c2d6a1f0f1fc7915c8747981)
* [llvm-objcopy] -O binary: skip empty sectionsFangrui Song2020-05-011-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | After SHF_ALLOC sections are ordered by LMA: * If initial sections are empty, GNU objcopy skips their contents while we emit leading zeros. (binary-paddr.test %t4) * If trailing sections are empty, GNU objcopy skips their contents while we emit trailing zeros. (binary-paddr.test %t5) This patch matches GNU objcopy's behavior. Linkers don't keep p_memsz PT_LOAD segments. Such empty sections would not have a containing PT_LOAD and `Section::ParentSegment` might be null if linkers fail to optimize the file offsets (lld D79254). In particular, without D79254, the arm Linux kernel's multi_v5_defconfig depends on this behavior: in `vmlinux`, an empty .text_itcm is mapped at a very high address (0xfffe0000) but the kernel does not expect `objcopy -O binary` to create a very large `arch/arm/boot/Image` (0xfffe0000-0xc0000000 ~= 1GiB). See https://bugs.llvm.org/show_bug.cgi?id=45632 Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D79229 (cherry picked from commit ec786906f5feb4dceba1b5338927079e63e78095)
* [llvm-objcopy][ELF] -O binary: use LMA instead of sh_offset to decide where ↵Fangrui Song2019-12-151-23/+13
| | | | | | | | | | | | | | | | | | | | | | | to write section contents .text sh_address=0x1000 sh_offset=0x1000 .data sh_address=0x3000 sh_offset=0x2000 In an objcopy -O binary output, the distance between two sections equal their LMA differences (0x3000-0x1000), instead of their sh_offset differences (0x2000-0x1000). This patch changes our behavior to match GNU. This rule gets more complex when the containing PT_LOAD has p_vaddr!=p_paddr. GNU objcopy essentially computes sh_offset-p_offset+p_paddr for each candidate section, and removes the gap before the first address. Added tests to binary-paddr.test to catch the compatibility problem. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D71035
* Fix cppcheck shadow variable warning. NFC.Simon Pilgrim2019-11-181-3/+3
|
* [llvm-objcopy][ELF] Implement --only-keep-debugFangrui Song2019-11-051-12/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --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
* [llvm-objcopy][ELF] Add OriginalType & OriginalFlagsFangrui Song2019-11-051-3/+3
| | | | | | | | | | | `llvm::objcopy::elf::*Section::classof` matches Type and Flags, yet Type and Flags are mutable (by setSectionFlagsAndTypes and upcoming --only-keep-debug feature). Add OriginalType & OriginalFlags to be used in classof, to prevent classof results from changing. Reviewed By: jakehehrlich, jhenderson, alexshap Differential Revision: https://reviews.llvm.org/D69739
* [llvm-objcopy] --add-symbol: address post-commit reviews of D69093Fangrui Song2019-10-311-17/+18
| | | | | | | | | | * Improve comments. * Reorder the assignment to Obj.SectionNames before the symbol table creation code. Add a test. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D69526
* [llvm-objcopy] - Do not crash on object that has relocations but no symbol ↵Georgii Rymar2019-10-301-5/+16
| | | | | | | | | | | | | table. It was revealed by D69260. Tool crashed when scanned relocations in a object without a symbol table. This patch teaches it either to handle such objects (when relocations does not use symbols we do not need a symbol table to proceed) or to show an appropriate error otherwise. Differential revision: https://reviews.llvm.org/D69304
* [llvm-objcopy] --add-symbol: fix crash if SHT_SYMTAB does not existFangrui Song2019-10-171-10/+31
| | | | | | | | | | | | | | | | | | Exposed by D69041. If SHT_SYMTAB does not exist, ELFObjcopy.cpp:handleArgs will crash due to a null pointer dereference. for (const NewSymbolInfo &SI : Config.ELF->SymbolsToAdd) { ... Obj.SymbolTable->addSymbol( Fix this by creating .symtab and .strtab on demand in ELFBuilder<ELFT>::readSections, if --add-symbol is specified. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D69093 llvm-svn: 375105
* [NFC] Add { } to silence compiler warning [-Wmissing-braces].Huihui Zhang2019-09-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | /local/mnt/workspace/huihuiz/llvm-comm-git-2/llvm-project/llvm/lib/Object/MachOObjectFile.cpp:2731:7: warning: suggest braces around initialization of subobject [-Wmissing-braces] "i386", "x86_64", "x86_64h", "armv4t", "arm", "armv5e", ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { 1 warning generated. /local/mnt/workspace/huihuiz/llvm-comm-git-2/llvm-project/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp:355:46: warning: suggest braces around initialization of subobject [-Wmissing-braces] return addMappingFromTable<1>(MI, MRI, { 0 }, Table); ^ {} 1 warning generated. /local/mnt/workspace/huihuiz/llvm-comm-git-2/llvm-project/llvm/tools/llvm-objcopy/ELF/Object.cpp:400:57: warning: suggest braces around initialization of subobject [-Wmissing-braces] static constexpr std::array<uint8_t, 4> ZlibGnuMagic = {'Z', 'L', 'I', 'B'}; ^~~~~~~~~~~~~~~~~~ { } 1 warning generated. llvm-svn: 372811
* [llvm-objcopy] Ignore -B --binary-architecture=Fangrui Song2019-09-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 371914
* [llvm-objcopy] Rename SHOffset (e_shoff) field to SHOff. NFCFangrui Song2019-09-071-6/+6
| | | | | | | | | Similar to D67254. `struct Elf*_Shdr` has a field `sh_offset`. Rename SHOffset to SHOff to avoid confusion. llvm-svn: 371281
* [llvm-objcopy] Add objcopy::elf::Object::allocSections to simplify loops on ↵Fangrui Song2019-09-041-20/+8
| | | | | | | | | | SHF_ALLOC sections Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D67142 llvm-svn: 370860
* [llvm-objcopy] Rename variable names "Section" to "Sec". NFCFangrui Song2019-09-041-66/+60
| | | | | | | | | | | | | | "Section" can refer to the type llvm::objcopy::elf::Section or the variable name. Rename it to "Sec" for clarity. "Sec" is already used a lot, so this change improves consistency as well. Also change `auto` to `const SectionBase` for readability. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D67143 llvm-svn: 370852
* [llvm-objcopy] Fix some identifier names in comments. NFCFangrui Song2019-09-041-5/+5
| | | | llvm-svn: 370838
* [llvm-objcopy] Simplify alignToAddr with llvm::alignToFangrui Song2019-08-311-15/+2
| | | | llvm-svn: 370577
* [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
* Fight a bit against global initializers. NFC.Benjamin Kramer2019-08-221-1/+1
| | | | llvm-svn: 369695
* [llvm] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-151-5/+5
| | | | | | | | 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] Allow strip symtab in executables and DSOsEugene Leviant2019-07-231-0/+21
| | | | | | | Re-commit of the patch after addressing -Wl,--emit-relocs case. Differential revision: https://reviews.llvm.org/D61672 llvm-svn: 366787
* Revert [llvm-objcopy] Allow strip symtab from executables and DSOsJordan Rupprecht2019-07-101-21/+0
| | | | | | | | | | | | | This reverts r365193 (git commit 194f16b3548bcb23a7f0fd638778ed72edd18d37) This patch doesn't work with binaries built w/ `--emit-relocs`, e.g. ``` $ echo 'int main() { return 0; }' | clang -Wl,--emit-relocs -x c - -o foo && llvm-objcopy --strip-unneeded foo llvm-objcopy: error: 'foo': not stripping symbol '__gmon_start__' because it is named in a relocation ``` llvm-svn: 365712
* [llvm-objcopy] Allow strip symtab from executables and DSOsEugene Leviant2019-07-051-0/+21
| | | | | | Differential revision: https://reviews.llvm.org/D61672 llvm-svn: 365193
* llvm-objcopy: silence warning introduced in r364296Nicolai Haehnle2019-06-261-2/+2
| | | | | Change-Id: I306e866d497e55945fb3b471eb0727b63ad9e4b9 llvm-svn: 364460
* AMDGPU/MC: Add .amdgpu_lds directiveNicolai Haehnle2019-06-251-13/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The directive defines a symbol as an group/local memory (LDS) symbol. LDS symbols behave similar to common symbols for the purposes of ELF, using the processor-specific SHN_AMDGPU_LDS as section index. It is the linker and/or runtime loader's job to "instantiate" LDS symbols and resolve relocations that reference them. It is not possible to initialize LDS memory (not even zero-initialize as for .bss). We want to be able to link together objects -- starting with relocatable objects, but possible expanding to shared objects in the future -- that access LDS memory in a flexible way. LDS memory is in an address space that is entirely separate from the address space that contains the program image (code and normal data), so having program segments for it doesn't really make sense. Furthermore, we want to be able to compile multiple kernels in a compilation unit which have disjoint use of LDS memory. In that case, we may want to place LDS symbols differently for different kernels to save memory (LDS memory is very limited and physically private to each kernel invocation), so we can't simply place LDS symbols in a .lds section. Hence this solution where LDS symbols always stay undefined. Change-Id: I08cbc37a7c0c32f53f7b6123aa0afc91dbc1748f Reviewers: arsenm, rampitec, t-tye, b-sumner, jsjodin Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61493 llvm-svn: 364296
* [llvm-objcopy] Implement IHEX readerEugene Leviant2019-06-131-33/+213
| | | | | | | This is the final part of IHEX format support in llvm-objcopy Differential revision: https://reviews.llvm.org/D62583 llvm-svn: 363243
* [llvm-objcopy] Fix SHT_GROUP ordering.Jordan Rupprecht2019-06-101-2/+8
| | | | | | | | | | | | | | | | | | | | | Summary: When llvm-objcopy sorts sections during finalization, it only sorts based on the offset, which can cause the group section to come after the sections it contains. This causes link failures when using gold to link objects created by llvm-objcopy. Fix this for now by copying GNU objcopy's behavior of placing SHT_GROUP sections first. In the future, we may want to remove this sorting entirely to more closely preserve the input file layout. This fixes https://bugs.llvm.org/show_bug.cgi?id=42052. Reviewers: jakehehrlich, jhenderson, MaskRay, espindola, alexshap Reviewed By: MaskRay Subscribers: phuongtrang148993, emaste, arichardson, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62620 llvm-svn: 362973
* llvm-objcopy: Implement --extract-partition and --extract-main-partition.Peter Collingbourne2019-06-071-31/+56
| | | | | | | | | | | | | | | | | | | This implements the functionality described in https://lld.llvm.org/Partitions.html. It works as follows: - Reads the section headers using the ELF header at file offset 0; - If extracting a loadable partition: - Finds the section containing the required partition ELF header by looking it up in the section table; - Reads the ELF and program headers from the section. - If extracting the main partition: - Reads the ELF and program headers from file offset 0. - Filters the section table according to which sections are in the program headers that it read: - If ParentSegment != nullptr or section is not SHF_ALLOC, then it goes in. - Sections containing partition ELF headers or program headers are excluded as there are no headers for these in ordinary ELF files. Differential Revision: https://reviews.llvm.org/D62364 llvm-svn: 362818
* [llvm-objcopy] - Emit error and don't crash if program header reaches past ↵George Rimar2019-06-071-0/+5
| | | | | | | | | | | | | | | | end of file. This is https://bugs.llvm.org/show_bug.cgi?id=42122. If an object file has a size less than program header's file [offset + size] (i.e. if we have overflow), llvm-objcopy crashes instead of reporting a error. The patch fixes this issue. Differential revision: https://reviews.llvm.org/D62898 llvm-svn: 362778
* [llvm-objcopy] Remove %p format specifiersEugene Leviant2019-05-301-2/+2
| | | | | | | On 32-bit machines %p expects 32 bit values, however addresses in llvm-objcopy are always 64 bits. llvm-svn: 362074
* Attempt to fix buildbot after r361949Eugene Leviant2019-05-291-1/+1
| | | | llvm-svn: 361954
* [llvm-objcopy] Implement IHEX writerEugene Leviant2019-05-291-1/+263
| | | | | | Differential revision: https://reviews.llvm.org/D60270 llvm-svn: 361949
* llvm-objcopy: Change sectionWithinSegment() to use virtual addresses instead ↵Peter Collingbourne2019-05-241-0/+14
| | | | | | | | | | | | of file offsets for SHT_NOBITS sections. Without this, sectionWithinSegment() will return the wrong answer for bss sections. This doesn't seem to matter now (for non-broken ELF files), but it will matter with a change that I'm working on. Differential Revision: https://reviews.llvm.org/D58426 llvm-svn: 361578
* [llvm-objcopy] - Many minor NFC changes to cleanup/improve the code in ↵George Rimar2019-05-231-106/+85
| | | | | | | | | | | | | | | | ELF/Object.cpp. The code in ELF/Object.cpp is sometimes a bit hard to read because of lots of auto used everywhere. The main intention of this patch is to replace them with the real type for places where it is not obvious. Also it cleanups few places. It is NFC change, but I want to be sure that there is no objections to do that since it is massive. DIfferential revision: https://reviews.llvm.org/D62260 llvm-svn: 361466
* [llvm-objcopy] Tidy up error messagesJames Henderson2019-05-221-66/+66
| | | | | | | | | | | | | | This patch brings various error messages into line with each other, by removing trailing full stops, and making the first letter lower-case. This addresses https://bugs.llvm.org/show_bug.cgi?id=40859. Reviewed by: jhenderson, rupprecht, jakehehrlich Differential Revision: https://reviews.llvm.org/D62072 Patch by Alex Brachet llvm-svn: 361384
* [llvm-objcopy] Cache gnu_debuglink's target CRCJames Henderson2019-05-141-16/+7
| | | | | | | | | | | | | | | | | | | | | | .gnu_debuglink section contains information regarding file with debugging symbols, identified by its CRC32. This target file is not intended to ever change or it would invalidate the stored checksum, yet the checksum is calculated over and over again for each of the objects inside the archive, usually hundreds of times. This patch precomputes the CRC32 of the target once and then reuses the value where required, saving lots of redundant I/O. The error message reported should stay the same, although now it might be reported earlier. Reviewed by: jhenderson, jakehehrlich, MaskRay Differential Revision: https://reviews.llvm.org/D61343 Patch by Michal Janiszewski llvm-svn: 360661
* [llvm-objcopy] - Fix for "Bug 41775 - SymbolTableSection::addSymbol - shadow ↵George Rimar2019-05-081-2/+2
| | | | | | | | | | | | | | | | | | | variable names" This is a fix for https://bugs.llvm.org/show_bug.cgi?id=41775, Problem is in the final line: Size += this->EntrySize; I checked that we do not actually need it in this place, since we always call removeSectionReferences which calls removeSymbols which updates the Size. But it worth to keep it, that allows to relax the dependencies. Differential revision: https://reviews.llvm.org/D61636 llvm-svn: 360227
* [llvm-objcopy] - Check dynamic relocation sections for broken references.George Rimar2019-04-301-6/+27
| | | | | | | | | | | | | | This is a fix for https://bugs.llvm.org/show_bug.cgi?id=41371. Currently, it is possible to break the sh_link field of the dynamic relocation section by removing the section it refers to. The patch fixes an issue and adds 2 test cases. One of them shows that it does not seem possible to break the sh_info field. I added an assert to verify this. Differential revision: https://reviews.llvm.org/D60825 llvm-svn: 359552
* Use llvm::stable_sort. NFCFangrui Song2019-04-221-8/+4
| | | | llvm-svn: 358897
* [llvm-objcopy][llvm-strip] Add switch to allow removing referenced sectionsJames Henderson2019-04-181-25/+46
| | | | | | | | | | | | | | | | | | | | llvm-objcopy currently emits an error if a section to be removed is referenced by another section. This is a reasonable thing to do, but is different to GNU objcopy. We should allow users who know what they are doing to have a way to produce the invalid ELF. This change adds a new switch --allow-broken-links to both llvm-strip and llvm-objcopy to do precisely that. The corresponding sh_link field is then set to 0 instead of an error being emitted. I cannot use llvm-readelf/readobj to test the link fields because they emit an error if any sections, like the .dynsym, cannot be properly loaded. Reviewed by: rupprecht, grimar Differential Revision: https://reviews.llvm.org/D60324 llvm-svn: 358649
* [llvm-objcopy] Fill .symtab_shndx section correctlyEugene Leviant2019-04-121-10/+23
| | | | | | Differential revision: https://reviews.llvm.org/D60555 llvm-svn: 358278
* [llvm-objcopy]Allow llvm-objcopy to be used on an ELF file with no section ↵James Henderson2019-04-021-10/+18
| | | | | | | | | | | | | | | | | | | | headers This patch fixes https://bugs.llvm.org/show_bug.cgi?id=41293 and https://bugs.llvm.org/show_bug.cgi?id=41045. llvm-objcopy assumed that it could always read a section header string table. This isn't the case when the sections were previously all stripped, and the e_shstrndx field was set to 0. This patch fixes this. It also fixes a double space in an error message relating to this issue, and prevents llvm-objcopy from adding extra space for non-existent section headers, meaning that --strip-sections on the output of a previous --strip-sections run produces identical output, simplifying the test. Reviewed by: rupprecht, grimar Differential Revision: https://reviews.llvm.org/D59989 llvm-svn: 357475
* [llvm-objcopy] Replace the size() helper with SectionTableRef::sizeFangrui Song2019-03-301-10/+5
| | | | | | | | | | | | | | | | | | | Summary: BTW, STLExtras.h provides llvm::size() which is similar to std::size() for random access iterators. However, if we prefer qualified llvm::size(), the member function .size() will be more convenient. Reviewers: jhenderson, jakehehrlich, rupprecht, grimar, alexshap, espindola Reviewed By: grimar Subscribers: emaste, arichardson, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60028 llvm-svn: 357347
* [llvm-objcopy] Fix case style of LayoutSegments. NFCFangrui Song2019-03-291-2/+2
| | | | llvm-svn: 357265
* [llvm-objcopy] Delete two redundant reinterpret_cast. NFCFangrui Song2019-03-291-5/+3
| | | | llvm-svn: 357238
* [llvm-objcopy]Preserve data in segments not covered by sectionsJames Henderson2019-03-251-3/+35
| | | | | | | | | | | | | | | | llvm-objcopy previously knew nothing about data in segments that wasn't covered by section headers, meaning that it wrote zeroes instead of what was there. As it is possible for this data to be useful to the loader, this patch causes llvm-objcopy to start preserving this data. Data in sections that are explicitly removed continues to be written as zeroes. This fixes https://bugs.llvm.org/show_bug.cgi?id=41005. Reviewed by: jakehehrlich, rupprecht Differential Revision: https://reviews.llvm.org/D59483 llvm-svn: 356919
* Recommit r356738 "[llvm-objcopy] - Implement replaceSectionReferences for ↵George Rimar2019-03-241-0/+7
| | | | | | | | | | | | | | | | | | | GroupSection class." Fix: r356853 + set AddressAlign to 4 in Inputs/compress-debug-sections.yaml for the new group section introduced. Original commit message: Currently, llvm-objcopy incorrectly handles compression and decompression of the sections from COMDAT groups, because we do not implement the replaceSectionReferences for this type of the sections. The patch does that. Differential revision: https://reviews.llvm.org/D59638 llvm-svn: 356856
* [llvm-objcopy] - Report SHT_GROUP sections with invalid alignment.George Rimar2019-03-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the reason of ubsan failure (UB detected) happened after landing the D59638 (I had to revert it). http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-ubsan/builds/11760/steps/check-llvm%20ubsan/logs/stdio) Problem is the following. Our implementation of GroupSection assumes that its address is 4 bytes aligned when writes it: template <class ELFT> void ELFSectionWriter<ELFT>::visit(const GroupSection &Sec) { ELF::Elf32_Word *Buf = reinterpret_cast<ELF::Elf32_Word *>(Out.getBufferStart() + Sec.Offset); ... But the test case for D59638 did not set AddressAlign in YAML. So address was not 4 bytes aligned since Sec.Offset was odd. That triggered the issue. This patch teaches llvm-objcopy to report an error for such sections (which should not met in reality), what is better than having UB. Differential revision: https://reviews.llvm.org/D59695 llvm-svn: 356853
* Revert r356738 "[llvm-objcopy] - Implement replaceSectionReferences for ↵George Rimar2019-03-221-7/+0
| | | | | | | | | GroupSection class." Seems this broke ubsan bot: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-ubsan/builds/11760 llvm-svn: 356745
* [llvm-objcopy] - Implement replaceSectionReferences for GroupSection class.George Rimar2019-03-221-0/+7
| | | | | | | | | | | | Currently, llvm-objcopy incorrectly handles compression and decompression of the sections from COMDAT groups, because we do not implement the replaceSectionReferences for this type of the sections. The patch does that. Differential revision: https://reviews.llvm.org/D59638 llvm-svn: 356738
* [llvm-objcopy] - Use replaceSectionReferences to update the sections for ↵George Rimar2019-03-201-6/+7
| | | | | | | | | | | symbols in symbol table. If the compression was used and we had a symbol not involved in relocation, we never updated its section and it was silently removed from the output. Differential revision: https://reviews.llvm.org/D59542 llvm-svn: 356554
OpenPOWER on IntegriCloud