summaryrefslogtreecommitdiffstats
path: root/contrib/elftoolchain/elfcopy
Commit message (Collapse)AuthorAgeFilesLines
* Update to ELF Tool Chain r3475emaste2016-05-208-20/+35
| | | | | | | | | | | | | | | | | | | | | Improvements include: * Add support for reporting and handling a number of new constants in various tools, including: * CloudABI OSABI * DT_TLSDESC_* * i386, MIPS, SPARC and amd64 relocations * C++ demangler bug fixes * Man page updates * Improved input validation in several tools This update also reduces diffs against upstream as a number of fixes included in upstream were previously cherry-picked into FreeBSD. Sponsored by: The FreeBSD Foundation
* elfcopy: map all !alnum characters to '_' in binary input symbol namesemaste2016-04-201-3/+4
| | | | | | | This matches bfd and gold. Obtained from: ELF Tool Chain r3445 Sponsored by: The FreeBSD Foundation
* elfcopy: fix symbol table handling when sections come after symtab/strtabemaste2016-04-151-2/+15
| | | | | | | | | | | | | | | | Fix a symbol table handling bug in elfcopy: elfcopy puts .symtab, .strtab and .shstrtab sections in the end of the output object. If the input objects have more sections after any of these 3 sections, the section table will be reordered, and in that case the section symbols should be regenerated for relocations. The bug is triggered since newer clang puts .strtab section in the beginning of the object produced. Ticket: #525 Reported by: royger Obtained from: ELF Tool Chain r3443
* elfcopy: overhaul of LMA handlingemaste2016-03-242-89/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge ELF Tool Chain r3434: Previously, elfcopy defines: VMA: section virtual address LMA: PHDR(p_vaddr) While binutils(libbfd) defines: VMA: section virtual address and PHDR(p_vaddr). LMA: PHDR(p_paddr) For elfcopy, p_paddr is considered not meaningful and is always set to the same value as p_vaddr. elfcopy was implemented that way because I thought p_paddr is not used/meaningful according to the ELF ABI. However it turned out p_paddr is at least used in some ELF files, e.g. the FreeBSD kernel. This change made elfcopy treat p_paddr as LMA, same as libbfd. (However, some VMA/LMA related command line option still need tweaking to make them compatible with binutils objcopy. This will be improved later) Ticket: #524 And typo fixes in r3435 and r3436. This fixes the Xen kernel build. Submitted by: kaiw Tested by: royger
* elfcopy: fail if debug link target is emptyemaste2016-03-041-0/+3
| | | | | | | | | | | | | An empty debug link target previously returned a confusing and incorrect error like "objcopy: fread failed: No error: 0". Now, return an explicit error. GNU objcopy allows an empty file as the debug link target. However, that case is nonsensical so diverging from GNU behaviour is fine. Reviewed by: bdrewery Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5541
* Allow elfcopy to convert between two non-ELF formatsemaste2016-02-161-0/+12
| | | | | | | | | | | | If the output object is not an ELF file, choose an arbitrary ELF format for the intermediate file. srec, ihex and binary formats are independent of class, endianness and machine type so these choices do not affect the output. ELF Tool Chain ticket #517 Reviewed by: kai Obtained from: ELF Tool Chain r3411
* Update ELF Tool Chain to upstream rev 3400emaste2016-02-129-98/+457
| | | | | | | | | | | | | | | | | | | | | | | | | Some notable improvements include: readelf: - Add AArch64 relocation definitions. - Report value of unknown relocation types. elfcopy: - Consider symbols with STB_GNU_UNIQUE binding as global symbols. - Fixed support for VMA adjustment for loadable sections found in relocatable objects. - Handle nameless global symbols. - Improve wildcard matching for !-prefixed symbols. - Add PE/COFF support. elfdump: - Improve section type reporting. - Add MIPS-specific section types. This update also includes a significant number of bug fixes. PR: 207091 [exp-run] Sponsored by: The FreeBSD Foundation
* Update to ELF Tool Chain r3272emaste2015-12-115-13/+24
| | | | | | | | | | | Highlights (not already in the FreeBSD tree): - addr2line: Speed up and support searching inlined functions - addr2line: Support -i, -a, -p options - readelf: Add some ARM relocation types - readelf, libelf: Avoid reading beyond end of buffer/file Relnotes: Yes Sponsored by: The FreeBSD Foundation
* elfcopy: include extension but replace . when converting from binaryemaste2015-12-111-12/+8
| | | | | | | | | | | The change in r291958 was not consistent with GNU objcopy. The start, end and size symbols created for ELF objects converted from binary need to include the full filename including the extension, but with the periods replaced with underscores. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D4474
* elfcopy: exclude extension when converting from binaryemaste2015-12-071-1/+12
| | | | | | | | | | | When converting from binary to ELF, elfcopy creates symbols _binary_<filename>_start_, _binary_<filename>_end, and _binary_<filename>_size. For compatibility with GNU objcopy (and to produce sensible symbol names) the extension must be stripped off. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D4238
* Update to ELF Tool Chain r3250emaste2015-10-091-1/+1
| | | | | | | | | Highlights (not already in the FreeBSD tree): - addr2line: Fixed multiple memory leaks related to DIE allocation - readelf: improve sh_link validation - various man page improvements Sponsored by: The FreeBSD Foundation
* elfcopy: Handle objects without a ".shstrtab" section string tableemaste2015-06-131-0/+8
| | | | | | | | | | | | As of LLVM revision 238073, LLVM stores symbols and section names in the same string table. From the upstream commit mesage: With the scheme of naming sections like ".text.foo" where foo is a symbol, there is a big potential saving in using a single one. This is a cherry-pick of ELF Tool Chain revision 3225. Sponsored by: The FreeBSD Foundation
* Update to ELF Tool Chain r3223emaste2015-05-274-13/+185
| | | | | | | | | | | | | | | | | | | | | | Highlights (upstream revisions): - Fix SHT_GROUP handling in elfcopy/strip (3206 3220 3221) - Misc elfcopy / strip bug fixes (3215 3216 3217) - Many C++ demangler improvements (3199 3200 3201 3202 3203 3204 3205 3208 3210 3211 3212) - Improve GNU binutils compatibility in elfcopy / strip (3213 3214) - Add -g option to readelf(1): dump contents of section groups (3219) - Add EM_IAMCU 32-bit Intel MCU (3198) Also add a compat #define for building with older FreeBSD ELF headers. The GRP_COMDAT flag was added to elf_common.h in r283110, but it's not available during the bootstrap build. It is also convenient to be able to build on older hosts. Thanks to antoine@ for tracking down issues through multiple exp-runs and to kaiw@ for fixing. PR: 198611 (exp-run), 200350 Sponsored by: The FreeBSD Foundation
* Update to ELF Tool Chain r3197emaste2015-05-144-7/+15
| | | | | | | | | | Highlights: - Fix man page markup, whitespace, and typos - Fix sh_info of SHT_GROUP section to point to the correct string - Improve validation in readelf and elfcopy/strip - Handle DWARF 4's DW_AT_high_pc in addr2line Sponsored by: The FreeBSD Foundation
* Update elftoolchain to upstream revision 3179emaste2015-04-019-21/+74
| | | | | | | | | | | | | Some notable changes: - libdwarf: Fixed DWARF4 line section - elfcopy: Implement --localize-hidden - nm: handle object name referenced by DW_AT_specification - elfcopy: Add --strip-dwo and --extract-dwo options for split DWARF - readelf: add remaining arm64 dynamic relocation names - nm: Avoid integer overflow in value comparison Relnotes: Yes Sponsored by: The FreeBSD Foundation
* Update elftoolchain to upstream revision 3163emaste2015-02-172-2/+2
| | | | | | | Most of our changes have now been committed upstream, so this change is largely bookkeeping. Sponsored by: The FreeBSD Foundation
* Preserve hard & symbolic links when modifying source fileemaste2015-01-281-21/+33
| | | | | | | | | | | Strip is often used to modify existing files, rather than creating new files. If the existing file has hard links or is a symbolic link, act as if editing the file in place and preserve the links. Reported by: luigi Reviewed by: imp, rpaulo Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D1682
* elfcopy: Avoid divide-by-0 on section alignment 0emaste2015-01-141-0/+2
| | | | | | | | According to ELF ABI, alignment 0 and 1 has the same meaning: the section has no alignment constraints. PR: 196715 Sponsored by: The FreeBSD Foundation
* Update elftoolchain to upstream rev 3136emaste2014-12-304-59/+130
| | | | | | | | | | | | This fixes two strip(1) issues found during ports exp-run and adds a string hash implementation which significantly speeds up certain operations on objects with large numbers of symbols. This also improves libdwarf handling for stripped objects with .eh_frame or .debug_frame (but not other debug) sections. PR: 196107 Sponsored by: The FreeBSD Foundation
* Update elftoolchain to upstream rev 3130emaste2014-12-245-14/+18
| | | | | | This brings a number of fixes to elfcopy/strip and DWARF4 improvements. Sponsored by: The FreeBSD Foundation
* Set up default shstrtab entries at shstrtab initializationemaste2014-12-221-6/+5
| | | | | | | | | | | | Instead of waiting until the addition of the first non-default entry. This fixes a segfault when strip(1) is asked to remove every section from an object file. Upstream elftoolchain ticket 463 Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D1341
* Include section name in strip warning messageemaste2014-12-181-2/+2
|
* Do not strip all when stripping an explicit symbolemaste2014-12-171-1/+2
| | | | | | | | | | | When requested to strip specific symbols (-N flag) the default should be to strip nothing (other than the requested symbols). This is consistent with binutils strip(1). PR: 196038 Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D1327
* Correct elftoolchain strip(1) memory size calculationemaste2014-12-151-1/+1
| | | | | | | | | | Calculate the segment's memory size (p_memsz) using the virtual addresses, not the file offsets. Otherwise padding preceeding SHT_NOBITS sections may be excluded from the calculation, resulting in a segment that is too small. PR: 195653 Sponsored by: The FreeBSD Foundation
* Track libarchive API changeemaste2014-12-011-6/+6
|
* Fix elftoolchain tools in-tree buildemaste2014-12-012-0/+2
| | | | | * make variables static * add header for uint*_t typedefs
* Copy elftoolchain binutils replacements from vendor branchemaste2014-11-2712-0/+7377
Sponsored by: The FreeBSD Foundation
OpenPOWER on IntegriCloud