summaryrefslogtreecommitdiffstats
path: root/contrib/elftoolchain
Commit message (Collapse)AuthorAgeFilesLines
* MF11 r320685: Update to ELF Tool Chain snapshot at r3561emaste2017-07-064-191/+619
| | | | | | | | | | | | | | | | | | | | | | | 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 Also r320663 libelftc: bump version, tracking import in r320343 Approved by: re (gjb) Sponsored by: The FreeBSD Foundation
* MFC r318603: nm: document 'r' symbol typeemaste2017-05-251-1/+3
| | | | | PR: 219245 Sponsored by: The FreeBSD Foundation
* MFC r317371: elfcopy: allow empty symbol list filesemaste2017-05-081-2/+3
|
* MFC r316685: libelf: add an assert that msz is non-zeroemaste2017-05-031-0/+1
| | | | | | Reported by: Coverity CID: 976023 Sponsored by: The FreeBSD Foundation
* MFC r313411 (jhibbits): Add elf*-powerpc-freebsd targetsemaste2017-05-031-0/+18
| | | | | | | | | to the elftoolchain target list 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 r307808: elfcopy: select mode by the end of the program nameemaste2017-05-031-3/+23
| | | | | | | | | | The mode of operation (elfcopy, mcs, or strip) is chosen based on the program name. Broaden this to allow a substring match at the end of the name to allow prefixes - for example, bsdstrip or aarch64-freebsd-strip. This improves use of these tools as drop-in replacements for GNU objcopy and strip, which are often built with a limited set of supported targets and installed with a target prefix for cross tools.
* MFC r309679 (cem): readelf -S: Include zero index and match binutils' no-nameemaste2017-05-031-3/+4
| | | | | | | | Include the SHN_UNDEF (zero) index special section in extended-attribute ELF files, like GNU binutils' readelf. Additionally, print "<no-name>" for sections without names, like GNU binutils.
* MFC r309547 (cem): readelf: Add support for extended program header numbersemaste2017-05-031-2/+8
| | | | | Add support for extended program header numbers to elftoolchain 'readelf -h'.
* MFC r312779: strings: avoid unnecessary trip through handle_file for stdinemaste2017-05-031-8/+4
| | | | Sponsored by: The FreeBSD Foundation
* MFC libelf: Fix extended numberingemaste2017-05-032-26/+23
| | | | | | | | | | | r310136 (cem): libelf: Fix extended numbering detection Extended numbering is used for any of these fields overflowing. r310137 (cem): gelf_getphdr: Allow extended indices Needed for 'readelf -l' of extended phnum files. (Parity with GNU binutils.)
* MFC r317141: readelf: dump MIPS abiflags sectionemaste2017-05-031-0/+82
| | | | | | | This is not fully fleshed out but is sufficient to dump the SHT_MIPS_ABIFLAGS used in FreeBSD. Sponsored by: The FreeBSD Foundation
* MFC r317075: Update ELF Tool Chain to upstream r3520emaste2017-05-0123-424/+500
| | | | | | | | | | | | | 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 Also MFC r317076, version bump. Sponsored by: The FreeBSD Foundation
* MFC r317193: elfcopy: document --strip-symbols=filename in the man pageemaste2017-04-271-1/+6
| | | | | Reported by: bz Sponsored by: The FreeBSD Foundation
* MFC r316284: elfcopy: remove temporary ELF file when converting from binaryemaste2017-04-131-0/+2
| | | | | | | | | | | Previously a command like objcopy --input-target binary --output-target elf64-x86-64-freebsd \ binary_file object.o would leave a temporary file behind. ELF Tool Chain ticket #543
* MFC r308430, r309782: libelftc: add elf{32,64}-trad{big,little}mipsemaste2017-02-102-0/+36
|
* MFC r311946: readelf: add S390 relocation typesemaste2017-02-101-0/+31
| | | | From https://refspecs.linuxfoundation.org/ELF/zSeries/lzsabi0_zSeries.html
* MFC r310724:markj2017-02-032-14/+29
| | | | | | Follow DW_AT_specification when looking up DW_AT_type attributes. PR: 215350, 215395
* readelf: add PPC64 relocation typesemaste2017-01-251-0/+114
| | | | MFC of r311941, r311942
* MFC r310634: elfcopy: fix PE object section name corruption and crashemaste2017-01-031-7/+9
| | | | | | | | | | | | | | | Fixed a bug that the PE object section names are generated incorrectly using the section name table found in the original input ELF object instead of the intermediate ELF object. Ticket: #541 Do not try to copy section content from a NULL d_buf when creating uninitialized data COFF section for PE object. Ticket: #540 Obtained from: ELF Tool Chain r3507, r3508
* MFC r307969: strings: fix exit status if a file before the last one failsemaste2016-11-251-16/+11
| | | | | | | | | Previously a command like "strings f1 f2 f3" reported the exit status based only on processing the last file. As with GNU strings, report an error exit status if an error was encountered processing any of the files. While here simplify the exit status handling to just success (0) / failure (1).
* MFC r306008:markj2016-09-272-0/+41
| | | | libdwarf: Add definitions for Apple's DWARF extension attributes.
* MFC r305130: Update to ELF Tool Chain r3490emaste2016-09-1516-25/+227
| | | | | | | | | | | | | 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 MFC r305155: readelf: silence GCC 4.2.1 uninitialized variable warning Sponsored by: The FreeBSD Foundation
* MFC r304191: elfcopy: correct comment typoemaste2016-09-151-1/+1
| | | | (Missed in r305838)
* MFC r304160: elfcopy: add elf64-littleaarch64 output target supportemaste2016-09-152-0/+9
|
* MFC r304151: elfcopy: silence GCC 5.3 unitialized variable warningemaste2016-09-151-0/+1
| | | | | Although it's a false positive there is little cost to initializing it always.
* MFC r303674: readelf: report ARM program and section header typesemaste2016-09-151-9/+30
|
* MFC r303279: libelftc: fix demangling of wchar_temaste2016-07-271-1/+1
| | | | | | | | | "wchar_t" is 7 characters long, not 6. PR: 208661 Submitted by: Daniel McRobb Approved by: re (kib) Obtained from: ELF Tool Chain r3480
* Use the in-tree sys/elf_common.h to build libelftc.bdrewery2016-06-056-40/+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
* Update to ELF Tool Chain r3477emaste2016-05-251-11/+9
| | | | | | | | | | | | | This fixes a EFI/PE header issue that prevented elfcopy-produced .efi files from working with Secure Boot: Make sure section raw size is always padded to multiple of FileAlignment from the optional header, as requested by the PE specification. This change should reduce the diff between PE image generated by Binutils objcopy and elftoolchain elfcopy. Submitted by: kaiw Reported by: ambrisko
* Add relocation support for RISC-V.br2016-05-252-0/+9
| | | | | | | Reviewed by: emaste Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D6559
* elftoolchain: backwards compatability for ELFOSABI_CLOUDABI definitionemaste2016-05-213-0/+13
| | | | | | | It is not provided by sys/elf_common.h on older releases or -current before March 2015. Reported by: Jenkins
* elftoolchain: backwards compatability for EM_RISCV definitionemaste2016-05-203-0/+9
| | | | | | It is not provided by sys/elf_common.h on older releases Reported by: Jenkins
* elftoolchain: backwards compatability for EM_IAMCU definitionemaste2016-05-204-0/+18
| | | | It is not provided by sys/elf_common.h on older stable/10.
* Update to ELF Tool Chain r3475emaste2016-05-2034-1238/+1288
| | | | | | | | | | | | | | | | | | | | | 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
* libelf: correct byte count in cross-endian note translationemaste2016-03-111-0/+1
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* libdwarf: fix SHT_REL relocation processingemaste2016-03-111-3/+12
| | | | | | | Relocation of type SHT_REL must use the current value as addend. PR: 204084 Obtained from: NetBSD libdwarf_elf_init.c v1.4
* 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-1265-873/+4894
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* readelf: decode AArch64 TLS descriptor relocationsemaste2016-02-051-0/+10
| | | | | | | From ELF for the ARM(R) 64-bit Architecture, table 4-19. Obtained from: ELF Tool Chain r3386 Sponsored by: The FreeBSD Foundation
* readelf: report value of unknown relocation typesemaste2016-02-051-12/+14
| | | | | Obtained from: ELF Tool Chain r3387 Sponsored by: The FreeBSD Foundation
* readelf: avoid accidental fallthrough in RISC-V relocationsemaste2016-02-051-0/+1
| | | | | | | | | This would have printed an unknown RISC-V relocation type as a SPARC relocation. CID: 1331398 Obtained from: ELF Tool Chain r3283 Sponsored by: The FreeBSD Foundation
* Add config for RISC-V ISA.br2016-01-241-0/+6
| | | | | | | Reviewed by: emaste Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D5046
* Fixed uninitialized variable warnings.kaiw2015-12-131-2/+2
|
* Update to ELF Tool Chain r3272emaste2015-12-1110-180/+484
| | | | | | | | | | | 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
OpenPOWER on IntegriCloud