summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-objcopy
Commit message (Collapse)AuthorAgeFilesLines
* [llvm-objcopy] -O binary: skip empty sectionsFangrui Song2020-05-011-2/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | 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] Improve tool selection logic to recognize llvm-strip-$major ↵Fangrui Song2020-04-111-0/+33
| | | | | | | | | | | | | | | | | 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 (cherry picked from commit f2f96eb605bc770e4da400dbcc7a6d2526ec1fd4)
* [llvm-readelf] Print EI_ABIVERSION as decimal instead of hexadecimalFangrui Song2020-01-061-3/+3
| | | | | | | | This matches GNU readelf and llvm-readobj. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D72234
* [llvm-readelf][llvm-readobj] - Reimplement the logic of section flags dumping.Georgii Rymar2019-12-181-1/+0
| | | | | | | | | | | | | | | | | Our logic that dumped the flags was buggy. For LLVM style it dumped SHF_MASKPROC/SHF_MASKOS named constants, though they are not flags, but masks. For GNU style it was just very inconsistent with GNU which has logic that is not straightforward. Imagine we have sh_flags == 0x90000000. SHF_EXCLUDE ("E") has a value of 0x80000000 and SHF_MASKPROC is 0xf0000000. GNU readelf will not print "E" or "Ep" in this case, but will print just "p". It only will print "E" when no other processor flag is set. I had to investigate the GNU source to find the algorithm and now our logic should match it. Differential revision: https://reviews.llvm.org/D71462
* [llvm-objcopy][ELF] -O binary: use LMA instead of sh_offset to decide where ↵Fangrui Song2019-12-151-18/+105
| | | | | | | | | | | | | | | | | | | | | | | 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
* [llvm-objcopy][MachO] Implement --add-sectionSeiya Nuta2019-12-161-0/+175
| | | | | | | | | | | | Reviewers: alexshap, rupprecht, jhenderson Reviewed By: alexshap, jhenderson Subscribers: mgorny, jakehehrlich, abrachet, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66283
* [llvm-strip][MachO] Test llvm-strip --strip-debugFangrui Song2019-12-031-0/+3
| | | | | | Reviewed By: smeenai Differential Revision: https://reviews.llvm.org/D70995
* [llvm-objcopy][MachO] Implement --dump-sectionSeiya Nuta2019-11-251-0/+82
| | | | | | | | | | | | 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-0/+38
| | | | | | Reviewed By: alexshap Differential Revision: https://reviews.llvm.org/D70476
* [llvm-objcopy][MachO] Fix symbol order in the symbol tableFangrui Song2019-11-212-0/+6
| | | | | | | | | | 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-0/+212
| | | | | | | | | | 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-212/+0
| | | | | 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-0/+212
| | | | | | | | | | 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-151-0/+51
| | | | | | | | | | 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][NFC] Use generated object file in COFF/add-section.testSergey Dmitriev2019-11-153-13/+6
| | | | | | Updated LIT test from D70205 to use generated object file with extended relocation table. Differential Revision: https://reviews.llvm.org/D70269
* [llvm-objcopy][MachO] Implement --remove-sectionSeiya Nuta2019-11-151-0/+127
| | | | | | | | | | | | Reviewers: alexshap, rupprecht, jhenderson Reviewed By: rupprecht, jhenderson Subscribers: jakehehrlich, abrachet, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66282
* [llvm-objcopy][COFF] Add support for extended relocation tablesSergey Dmitriev2019-11-142-0/+32
| | | | | | | | | | | | | | Summary: This patch adds support for COFF objects with extended relocation tables to the llvm-objcopy tool. Reviewers: jhenderson, MaskRay, mstorsjo, alexshap, rupprecht Reviewed By: mstorsjo Subscribers: jakehehrlich, abrachet, seiya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70205
* [llvm-objcopy][COFF] Implement --redefine-sym and --redefine-symsFangrui Song2019-11-123-15/+106
| | | | | | | | | | | | | The parsing error tests in ELF/redefine-symbols.test are not specific to ELF. Move them to redefine-symbols.test. Add COFF/redefine-symbols.test for COFF specific tests. Also fix the documentation regarding --redefine-syms: the old and new names are separated by whitespace, not an equals sign. Reviewed By: mstorsjo Differential Revision: https://reviews.llvm.org/D70036
* Revert "Introduce llvm-install-name-tool"Alexander Shaposhnikov2019-11-065-212/+0
| | | | This reverts commit b5913e6d2f6d13fb753df701619731ca11936316.
* Introduce llvm-install-name-toolAlexander Shaposhnikov2019-11-065-0/+212
| | | | | | | | | 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][ELF] Implement --only-keep-debugFangrui Song2019-11-052-22/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --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] --add-symbol: address post-commit reviews of D69093Fangrui Song2019-10-311-18/+44
| | | | | | | | | | * 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] Preserve .ARM.attributes section when stripping filesJames Henderson2019-10-311-0/+25
| | | | | | | | | | | | | | This works around a bug in Debian's patchset for glibc. The bug is described in detail in the upstream debian bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=943798, but the short version of it is that glibc on any Debian based distro don't load libraries unless it has a .ARM.attribute section. Reviewed by: jhenderson, rupprecht, MaskRay, jakehehrlich Differential Revision: https://reviews.llvm.org/D69188 Patch by Tobias Hieta.
* [llvm-objcopy][MachO] Implement --strip-allSeiya Nuta2019-10-313-0/+811
| | | | | | | | | | | | Reviewers: alexshap, rupprecht, jdoerfert, jhenderson Reviewed By: alexshap Subscribers: jakehehrlich, abrachet, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66281
* [llvm-objcopy] - Do not crash on object that has relocations but no symbol ↵Georgii Rymar2019-10-302-5/+99
| | | | | | | | | | | | | 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 REQUIRES directive to fix a testSeiya Nuta2019-10-301-0/+2
| | | | Buildbot failure log: http://lab.llvm.org:8011/builders/clang-cmake-armv7-quick/builds/11164
* [llvm-objcopy][MachO] Support indirect symbol tableSeiya Nuta2019-10-301-0/+64
| | | | | | | | | | | | | | | | | 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
* [yaml2obj] - Make .symtab to be not mandatory section for SHT_REL[A] section.Georgii Rymar2019-10-291-0/+2
| | | | | | | | | | | | | | Before this change .symtab section was required for SHT_REL[A] section declarations. yaml2obj automatically defined it in case when YAML document did not have it. With this change it is now possible to produce an object that has a relocation section, but has no symbol table. It simplifies the code and also it is inline with how we handle Link fields for another special sections. Differential revision: https://reviews.llvm.org/D69260
* [llvm-objcopy][MachO] Implement --only-sectionSeiya Nuta2019-10-281-0/+153
| | | | | | | | | | | | 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-255-0/+80
| | | | | | | | Add support for min os version load commands. Test plan: make check-all Differential revision: https://reviews.llvm.org/D69419
* [yaml2obj, obj2yaml] - Add support for SHT_NOTE sections.georgerim2019-10-251-0/+1
| | | | | | | | | | | | | | | | | | | | | SHT_NOTE is the section that consists of namesz, descsz, type, name + padding, desc + padding data. This patch teaches yaml2obj, obj2yaml to dump and parse them. This patch implements the section how it is described here: https://docs.oracle.com/cd/E23824_01/html/819-0690/chapter6-18048.html Which says: "For 64–bit objects and 32–bit objects, each entry is an array of 4-byte words in the format of the target processor" The official specification is different http://www.sco.com/developers/gabi/latest/ch5.pheader.html#note_section And says: "n 64-bit objects (files with e_ident[EI_CLASS] equal to ELFCLASS64), each entry is an array of 8-byte words in the format of the target processor. In 32-bit objects (files with e_ident[EI_CLASS] equal to ELFCLASS32), each entry is an array of 4-byte words in the format of the target processor" Since LLVM uses the first, 32-bit way, this patch follows it. Differential revision: https://reviews.llvm.org/D68983
* [yaml2obj][obj2yaml] - Do not create a symbol table by default.George Rimar2019-10-2023-32/+33
| | | | | | | | | | | | | | | | | | This patch tries to resolve problems faced in D68943 and uses some of the code written by Konrad Wilhelm Kleine in that patch. Previously, yaml2obj tool always created a .symtab section. This patch changes that. With it we only create it when have a "Symbols:" tag in the YAML document or when we need to create it because it is used by another section(s). obj2yaml follows the new behavior and does not print "Symbols:" anymore when there is no symbol table. Differential revision: https://reviews.llvm.org/D69041 llvm-svn: 375361
* [llvm-objcopy] Add support for shell wildcardsJordan Rupprecht2019-10-172-0/+311
| | | | | | | | | | | | | | | | | | | | 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
* [llvm-objcopy] --add-symbol: fix crash if SHT_SYMTAB does not existFangrui Song2019-10-171-0/+81
| | | | | | | | | | | | | | | | | | 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
* [Tests] Output of od can be lower or upper case (llvm-objcopy/yaml2obj).Kai Nacke2019-10-119-25/+25
| | | | | | | | | | | | | | | The command `od -t x` is used to dump data in hex format. The LIT tests assumes that the hex characters are in lowercase. However, there are also platforms which use uppercase letter. To solve this issue the tests are updated to use the new `--ignore-case` option of FileCheck. Reviewers: Bigcheese, jakehehrlich, rupprecht, espindola, alexshap, jhenderson Differential Revision: https://reviews.llvm.org/D68693 llvm-svn: 374547
* Revert "[Tests] Output of od can be lower or upper case ↵Dmitri Gribenko2019-10-109-1035/+1035
| | | | | | | | | (llvm-objcopy/yaml2obj)." This reverts commit r374343. It broke tests: http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/19066 llvm-svn: 374358
* [Tests] Output of od can be lower or upper case (llvm-objcopy/yaml2obj).Kai Nacke2019-10-109-1035/+1035
| | | | | | | | | | | | | | | The command `od -t x` is used to dump data in hex format. The LIT tests assumes that the hex characters are in lowercase. However, there are also platforms which use uppercase letter. To solve this issue the tests are updated to use the new `--ignore-case` option of FileCheck. Reviewers: Bigcheese, jakehehrlich, rupprecht, espindola, alexshap, jhenderson Differential Revision: https://reviews.llvm.org/D68693 llvm-svn: 374343
* [llvm-objcopy] Add --set-section-alignmentFangrui Song2019-10-022-0/+62
| | | | | | | | | | | | | 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
* [llvm-objcopy][test] Clean up -B testsFangrui Song2019-09-253-30/+13
| | | | | | | | | | | | | -B is ignored for GNU objcopy compatibility after D67215/r371914. * Delete mentions of -B from input-output-target.test - we have enough -B tests. * Merge binary-input-with-arch.test into binary-output-target.test. Reviewed By: rupprecht Differential Revision: https://reviews.llvm.org/D67693 llvm-svn: 372809
* [llvm-objcopy] - Remove python invocations from 2 test cases.George Rimar2019-09-172-27/+2
| | | | | | | | | It is possible to use yaml2obj to create sections with overlapping sh_offset now. This patch does that. Differential revision: https://reviews.llvm.org/D67610 llvm-svn: 372081
* [llvm-objcopy] Ignore -B --binary-architecture=Fangrui Song2019-09-141-4/+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] Default --output-target to --input-target when unspecifiedFangrui Song2019-09-145-37/+46
| | | | | | | | | | | | | | | | | | | | | Fixes PR42171. In GNU objcopy, if -O (--output-target) is not specified, the value is copied from -I (--input-target). ``` objcopy -I binary -B i386:x86-64 a.txt b # b is copied from a.txt llvm-objcopy -I binary -B i386:x86-64 a.txt b # b is an x86-64 object file ``` This patch changes our behavior to match GNU. With this change, we can delete code related to -B handling (D67215). Reviewed By: jakehehrlich Differential Revision: https://reviews.llvm.org/D67144 llvm-svn: 371913
* [llvm-objcopy] Add support for response files in llvm-strip and llvm-objcopyMichael Pozulp2019-09-142-0/+24
| | | | | | | | | | | | | | | | 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
* [yaml2obj] Write the section header table after section contentsFangrui Song2019-09-056-19/+17
| | | | | | | | | | | | | | | | | Linkers (ld.bfd/gold/lld) place the section header table at the very end. This allows tools to strip it, which is optional in executable/shared objects. In addition, if we add or section, the size of the section header table will change. Placing the section header table in the end keeps section offsets unchanged. yaml2obj currently places the section header table immediately after the program header. Follow what linkers do to make offset updating easier. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D67221 llvm-svn: 371074
* [yaml2obj] Support PT_GNU_STACK and PT_GNU_RELROFangrui Song2019-09-041-1/+1
| | | | | | | | | | | | | PT_GNU_STACK is used in an llvm-objcopy test. I plan to use PT_GNU_RELRO in a patch to improve nested segment processing in llvm-objcopy (PR42963). Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D67146 llvm-svn: 370857
* [yaml2obj][obj2yaml] - Use a single "Other" field instead of "Other", ↵George Rimar2019-08-302-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "Visibility" and "StOther". Currenly we can encode the 'st_other' field of symbol using 3 fields. 'Visibility' is used to encode STV_* values. 'Other' is used to encode everything except the visibility, but it can't handle arbitrary values. 'StOther' is used to encode arbitrary values when 'Visibility'/'Other' are not helpfull enough. 'st_other' field is used to encode symbol visibility and platform-dependent flags and values. Problem to encode it is that it consists of Visibility part (STV_* values) which are enumeration values and the Other part, which is different and inconsistent. For MIPS the Other part contains flags for all STO_MIPS_* values except STO_MIPS_MIPS16. (Like comment in ELFDumper says: "Someones in their infinite wisdom decided to make STO_MIPS_MIPS16 flag overlapped with other ST_MIPS_xxx flags."...) And for PPC64 the Other part might actually encode any value. This patch implements custom logic for handling the st_other and removes 'Visibility' and 'StOther' fields. Here is an example of a new YAML style this patch allows: - Name: foo Other: [ 0x4 ] - Name: bar Other: [ STV_PROTECTED, 4 ] - Name: zed Other: [ STV_PROTECTED, STO_MIPS_OPTIONAL, 0xf8 ] Differential revision: https://reviews.llvm.org/D66886 llvm-svn: 370472
* [llvm-objcopy] Allow the visibility of symbols created by --binary andChris Jackson2019-08-302-0/+42
| | | | | | --add-symbol to be specified with --new-symbol-visibility llvm-svn: 370458
* [llvm-objcopy] Strip debug sections when running with --strip-unneeded.Jordan Rupprecht2019-08-231-0/+30
| | | | | | | | | | | | | | | | | | | Summary: GNU --strip-unneeded strips debugging sections as well. Do that for llvm-objcopy as well. Additionally, add a test that verifies we keep the .gnu_debuglink section. This apparently was not always the case, and I'm not sure which commit fixed it, but there doesn't appear to be any test coverage to make sure we continue to do so. This fixes PR41043. Reviewers: jhenderson, jakehehrlich, espindola, alexshap Subscribers: emaste, arichardson, MaskRay, abrachet, seiya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66623 llvm-svn: 369761
* [llvm-objcopy][test] Add a test to show that argv[0] is included in ↵Fangrui Song2019-08-201-0/+20
| | | | | | | | | | | | error/warning messages test/llvm-objcopy/ELF/error-format.test is similar to test/llvm-readobj/error-format.test added in D66425. Reviewed By: grimar, jhenderson Differential Revision: https://reviews.llvm.org/D66476 llvm-svn: 369392
* [llvm-objcopy] Append '\n' to warning messagesFangrui Song2019-08-201-3/+4
| | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud