aboutsummaryrefslogtreecommitdiff
path: root/contrib/elftoolchain/libelftc
Commit message (Collapse)AuthorAgeFilesLines
* LoongArch: elftoolchain: add supportyu shan wei2025-06-122-0/+150
| | | | | | | | | | | According to the latest elftoolchain r4191, add support for Loongarch Co-authored-by: haowuge <gehaowu@bitmoe.com> Co-authored-by: xiaoqiang zhao <zxq_yx_007@163.com> Signed-off-by: yu shan wei <mpysw@vip.163.com> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1682 Closes: https://github.com/freebsd/freebsd-src/pull/1682
* libelftc: Fix a typo - FreeBSD's riscv port is little-endian.Joseph Koshy2024-12-311-1/+1
| | | | | | | | | | | This change brings the descriptor for target "elf64-riscv-freebsd" in line with its documentation. I missed this somehow when reviewing https://reviews.freebsd.org/D20768. Reported by: Haowu Ge (on elftoolchain-developers) Reviewed by: emaste, imp Differential Revision: https://reviews.freebsd.org/D48271
* Fix memory corruption in C++ demanglerJustine Tunney2024-05-101-1/+1
| | | | | | | | | | | | The __cxa_demangle_gnu3() and cpp_demangle_gnu3() functions segfault on various libcxxabi test cases due to a copy and paste error. This change fixes that. This is a subset of https://github.com/libcxxrt/libcxxrt/pull/34 which fixes the immediate problem. Reviewed by: imp, emaste (I think) Pull Request: https://github.com/freebsd/freebsd-src/pull/1222
* elftoolchain: update the list of riscv relocationsMitchell Horne2023-01-311-4/+8
| | | | | | | | | A few have been added, a couple removed. Reviewed by: jrtc27, imp, emaste MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38175
* Merge elftoolchain r3877 (by jkoshy):Dimitry Andric2020-11-043-8/+9
| | | | | | | | | | | | | | | | | | | | | | Incorporate fixes from Dimitry Andric: - Use a BUFFER_GROW() macro to avoid rounding errors in capacity calculations. - Fix a bug introduced in [r3531]. - Fix handling of nested template parameters. Ticket: #581 This should fix a number of assertions on elftoolchain's cxxfilt, and allow it to correctly demangle several names that it could not handle before. Obtained from: https://sourceforge.net/p/elftoolchain/code/3877/ PR: 250702 MFC after: 3 days Notes: svn path=/head/; revision=367322
* libelftc: Fix a memory leak in cpp_demangle_read_type().Mark Johnston2020-03-201-1/+1
| | | | | | | | | CID: 1305425 MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=359176
* elfcopy: set ELF OS/ABI field when converting from binaryEd Maste2020-02-124-2/+14
| | | | | | | | | | | | PR: 228934 Submitted by: Tiger Gao <tig@freebsdfoundation.org> Reviewed by: markj, jkoshy MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23504 Notes: svn path=/head/; revision=357826
* libelftc: Add a missing check for an error from vector_str_init().Mark Johnston2020-02-043-8/+7
| | | | | | | | | | | While here consistently use the same spelling for such checks. CID: 1376769 MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=357536
* libelftc: Fix memory leaks in the C++ demanglers.Mark Johnston2020-02-042-5/+9
| | | | | | | | | CID: 1262518, 1262519, 1262520, 1262529 MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=357535
* Update ELF Tool Chain to upstream r3769Ed Maste2019-12-056-36/+39
| | | | | | | | | This contains many small bugfixes and documentation improvements. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=355413
* Allow bootstrapping elftoolchain on MacOS and LinuxAlex Richardson2019-07-011-1/+1
| | | | | | | | | | | This is required in order to build on non-FreeBSD systems without setting all the XAR/XSTRINGS/etc. variables Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D16771 Notes: svn path=/head/; revision=349577
* libelftc: add RISC-V bfd targetsMitchell Horne2019-06-282-0/+28
| | | | | | | | | | | | This adds the following targets: elf32-riscv, elf64-riscv, elf64-riscv-freebsd Reviewed by: emaste, markj, jkoshy@users.sourceforge.net Approved by: markj (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D20768 Notes: svn path=/head/; revision=349483
* libelftc: Fix the documented prototype for elftc_string_table_destroy().Mark Johnston2019-06-261-1/+1
| | | | | | | | MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=349422
* libelftc: Consistently use size_t for string table offsets and sizes.Mark Johnston2019-06-263-21/+24
| | | | | | | | | | Reviewed by: emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20702 Notes: svn path=/head/; revision=349421
* libelftc: Micro-optimize string table insertion.Mark Johnston2019-06-261-1/+1
| | | | | | | | | | | | | The string's length is already known, so use memcpy() instead of strcpy() to add it to the string table image. Reviewed by: emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20760 Notes: svn path=/head/; revision=349420
* libelftc: Fix some minor style bugs.Mark Johnston2019-06-042-5/+3
| | | | | | | | | | Reviewed by: emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20472 Notes: svn path=/head/; revision=348655
* Update to ELF Tool Chain r3668Ed Maste2019-01-109-32/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | Highlights: - Make sure that only TLS sections are sorted into TLS segment. - Fixed multiple errors in "Section to Segment mapping". - Man page updates - ar improvements - elfcopy: avoid filter_reloc uninitialized variable for rela - elfcopy: avoid stripping relocations from static binaries - readelf: avoid printing directory in front of absolute path - readelf: add NT_FREEBSD_FEATURE_CTL FreeBSD note type - test improvements NOTES: Some of these changes originated in FreeBSD and simply reduce diffs between contrib and vendor. ELF Tool Chain ar is not (currently) used in FreeBSD, and there are improvements in both FreeBSD and ELF Tool Chain ar that are not in the other. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=342918
* readelf: decode R_MIPS_HIGHER and R_MIPS_HIGHEST relocation typesEd Maste2018-11-021-0/+2
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=340075
* Update ELF Tool Chain to r3614Ed Maste2018-04-272-11/+10
| | | | | | | | | MFC after: 1 week Relnotes: Yes Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=333063
* Update to ELF Tool Chain snapshot at r3561Ed Maste2017-06-253-188/+616
| | | | | | | | | | | | | | | | | | | | | | | This update is primarily bug fixes in C++ symbol demangling, including: - rvalue reference - builtin type auto and decltype(auto) - revamped support for function return types - formatting fixes - omit void when its the only param - ref-qualifiers and others in function types - type qualifiers in pointer-to-member function types - incorrect handling regarding CV-qualifiers in function types - ref-qualifier found in nested-name - properly handle <name> ::= <substitute><template-args> - make sure that nested function name is not a substitute candidate - correctly handle expression in template args - skip unknown substitution abbreviations MFC after: 4 days Notes: svn path=/head/; revision=320343
* Update ELF Tool Chain to upstream r3520Ed Maste2017-04-175-379/+349
| | | | | | | | | | | | | | | | | Highlights of changes between r3490 and r3520: - Improve C++ demangling - Improve compatibility with Binutils tools wrt. error messages - Handle additional types/sections/etc. in readelf and elfdump - addr2line, cxxfilt: use setvbuf to set line buffering for filter use PR: 218395 MFC after: 2 weeks Relnotes: Yes Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=317075
* Add elf*-powerpc-freebsd targets to the elftoolchain target listJustin Hibbits2017-02-081-0/+18
| | | | | | | | | | | | FreeBSD uses the full target triple when generating embedded rootfs images (MFS_IMAGE= make option). Without this change objcopy errors out with: objcopy: elf64-poewrpc-freebsd: invalid target name MFC after: 2 weeks Notes: svn path=/head/; revision=313411
* readelf: add S390 relocation typesEd Maste2017-01-111-0/+31
| | | | | | | | | | | | From https://refspecs.linuxfoundation.org/ELF/zSeries/lzsabi0_zSeries.html Reviewed by: bz MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D9149 Notes: svn path=/head/; revision=311946
* readelf: add more PPC64 relocation types found in LLVMEd Maste2017-01-111-0/+6
| | | | | | | | | MFC after: 2 weeks MFC with: r311941 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=311942
* readelf: add PPC64 relocation typesEd Maste2017-01-111-0/+108
| | | | | | | | | | Reported by: Mark Millard MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D9146 Notes: svn path=/head/; revision=311941
* libelftc: add elf{32,64}-tradlittlemips target emulation namesEd Maste2016-12-102-0/+18
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=309782
* libelftc: add elf{32,64}-tradbigmips target emulation namesEd Maste2016-11-072-0/+18
| | | | | | | | Reported by: theraven Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=308430
* Update to ELF Tool Chain r3490Ed Maste2016-08-318-5/+144
| | | | | | | | | | | | | | Improvements include: * readelf: report all relocation types in rel/rela for MIPS N64 * readelf: add ELFOSABI_ARM_AEABI * elfdump: add ELFOSABI_ARM_AEABI and ELFOSABI_ARM * Add recent RISC-V relocations * elfcopy: use elftc_timestamp, to support SOURCE_DATE_EPOCH Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=305130
* elfcopy: add elf64-littleaarch64 output target supportEd Maste2016-08-152-0/+9
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=304160
* libelftc: fix demangling of wchar_tEd Maste2016-07-241-1/+1
| | | | | | | | | | | | "wchar_t" is 7 characters long, not 6. PR: 208661 Submitted by: Daniel McRobb Obtained from: ELF Tool Chain r3480 MFC after: 3 days Notes: svn path=/head/; revision=303279
* Use the in-tree sys/elf_common.h to build libelftc.Bryan Drewery2016-06-051-8/+0
| | | | | | | | | | | | | | | | | | This fixes build failures on older releases that lack various definitions such as EM_AARCH64 (which was unfixed before this). Revert all of the recent compatibility changes that worked around this problem. This uses the same method of using the in-tree header as lib/libelf, lib/libdwarf and usr.bin/readelf. Reviewed by: emaste Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D6734 Notes: svn path=/head/; revision=301471
* elftoolchain: backwards compatability for EM_RISCV definitionEd Maste2016-05-201-0/+3
| | | | | | | | | It is not provided by sys/elf_common.h on older releases Reported by: Jenkins Notes: svn path=/head/; revision=300334
* elftoolchain: backwards compatability for EM_IAMCU definitionEd Maste2016-05-201-0/+5
| | | | | | | It is not provided by sys/elf_common.h on older stable/10. Notes: svn path=/head/; revision=300320
* Update to ELF Tool Chain r3475Ed Maste2016-05-208-36/+801
| | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=300311
* Update ELF Tool Chain to upstream rev 3400Ed Maste2016-02-1210-573/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=295577
* Update to ELF Tool Chain r3223Ed Maste2015-05-272-49/+427
| | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=283616
* Update to ELF Tool Chain r3197Ed Maste2015-05-143-6/+6
| | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=282918
* Update elftoolchain to upstream revision 3179Ed Maste2015-04-015-15/+17
| | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=280932
* Update elftoolchain to upstream rev 3130Ed Maste2014-12-244-7/+11
| | | | | | | | | This brings a number of fixes to elfcopy/strip and DWARF4 improvements. Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/elftoolchain-update-r3130/; revision=276167
* Fix elftoolchain tools in-tree buildEd Maste2014-12-011-1/+1
| | | | | | | | * make variables static * add header for uint*_t typedefs Notes: svn path=/head/; revision=275369
* Copy elftoolchain binutils replacements from vendor branchEd Maste2014-11-2726-0/+9136
Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=275192