History log of /freebsd-current/contrib/elftoolchain/readelf/readelf.c
Revision Date Author Comments
# cec2d0b1 05-Mar-2023 Christos Margiolis <christos@FreeBSD.org>

readelf: fix -wR option, memory leaks, and -wf minor bug

Reviewed by: markj
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38419


# 76614563 13-Dec-2022 Ed Maste <emaste@FreeBSD.org>

readelf: match GNU readelf formatting

GNU readelf emits a blank line before, and uses single quotes around the
symbol table name, in each "Symbol table 'name' contains ## entries"
header.

Reviewed by: markj
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37746


# 931983ee 24-Mar-2022 John Baldwin <jhb@FreeBSD.org>

x86: Add a NT_X86_SEGBASES register set.

This register set contains the values of the fsbase and gsbase
registers. Note that these registers can already be controlled
individually via ptrace(2) via MD operations, so the main reason for
adding this is to include these register values in core dumps. In
particular, this will enable looking up the value of TLS variables
from core dumps in gdb.

The value of NT_X86_SEGBASES was chosen to match the value of
NT_386_TLS on Linux. The notes serve similar purposes, but FreeBSD
will never dump a note equivalent to NT_386_TLS (which dumps a single
segment descriptor rather than a pair of addresses) and picking a
currently-unused value in the NT_X86_* range could result in a future
conflict.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D34650


# b2cb74c2 23-Mar-2022 John Baldwin <jhb@FreeBSD.org>

arm,arm64: Add a NT_ARM_TLS read-only register set.

This register set exposes the per-thread TLS register. It matches the
layout used by Linux on arm64. Linux does not implement this note for
32-bit arm.

Reviewed by: andrew, markj
Sponsored by: University of Cambridge, Google, Inc.
Differential Revision: https://reviews.freebsd.org/D34595


# 817e68d8 21-Feb-2022 Ed Maste <emaste@FreeBSD.org>

readelf: add Arm address mask note type NT_ARM_ADDR_MASK

Reviewed by: andrew
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34346


# 089eb4ea 16-Feb-2022 Ed Maste <emaste@FreeBSD.org>

readelf: add newer Linux core arm note types

Sponsored by: The FreeBSD Foundation


# 758d98de 17-Jan-2022 Mark Johnston <markj@FreeBSD.org>

exec: Remove the stack gap implementation

ASLR stack randomization will reappear in a forthcoming commit. Rather
than inserting a random gap into the stack mapping, the entire stack
mapping itself will be randomized in the same way that other mappings
are when ASLR is enabled.

No functional change intended, as the stack gap implementation is
currently disabled by default.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33704


# ca457394 10-Dec-2021 Ed Maste <emaste@FreeBSD.org>

readelf: add Go Build ID ELF note support

Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D33379


# aacbf3fb 17-Sep-2021 Andrew Turner <andrew@FreeBSD.org>

Teach the readelf about arm64 gnu properties

On arm64 binaries can be tagged as using BTI or PAC. Add support to
decode these to the elftoolchain readelf.

To simplify the code use a table based method to find the flag
description table.

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32315


# f161abf9 17-Sep-2021 Ed Maste <emaste@FreeBSD.org>

readelf: include notes (-n) and unwind (-u) in --all/-a

This matches the GNU and LLVM versions of readelf.

As markj noted in the review -u is not actually implemented yet and has
no effect. The option is accepted and just ignored.

Reported by: andrew
Reviewed by: andrew, markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32003


# ea444392 04-Apr-2021 Ed Maste <emaste@FreeBSD.org>

readelf: return error in case of invalid file

GNU readelf exits with an error for a number of invalid file cases.
Previously ELF Tool Chain readelf always exited with 0. Now we exit 1
upon detecting an error with one or more input files, but in any case
all of them are processed.

This should catch common failure cases. We still do not report an error
for some types of malformed ELF files, but this is consistent with GNU
readelf.

PR: 252727
Reviewed by: jkoshy, markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29377


# 847dfd28 02-Feb-2021 Ed Maste <emaste@FreeBSD.org>

readelf: do not trucate section name with -W

PR: 246015
Reviewed by: cem
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28461


# e79b51e2 03-Feb-2021 Ed Maste <emaste@FreeBSD.org>

readelf: decode LA48 and ASG_DISABLE feature flags

MFC after: 1 week
Sponsored by: The FreeBSD Foundation


# 2a399193 03-Feb-2021 Alex Richardson <arichardson@FreeBSD.org>

readelf: Fix printing NT_FREEBSD_ARCH_TAG

Looking at lib/csu/arm/crt1_s.S, this should be a string and therefore the
restriction to 4 characters seems wrong.
Found whle updating https://reviews.llvm.org/D74393.

Reviewed By: emaste
Differential Revision: https://reviews.freebsd.org/D28470


# d4fba562 31-Oct-2020 Brandon Bergren <bdragon@FreeBSD.org>

Fix 32-bit build after r367209

Fix build on systems with a 32-bit size_t.

Since it's being passed as a pointer, a 64-bit write to it will overflow.

MFC with: r367209


# e128bd0f 31-Oct-2020 Ed Maste <emaste@FreeBSD.org>

readelf: Add -z decompression support

Compatible with GNU readelf, -z decompresses sections displayed by
-x or -p.

ELF Tool Chain ticket #555
https://sourceforge.net/p/elftoolchain/tickets/555/

Submitted by: Tiger Gao <tig@FreeBSDFoundation.org>
Reviewed by: markj
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D26909


# 796bf313 31-May-2020 Ed Maste <emaste@FreeBSD.org>

readelf: add more DT_FLAGS_1 flags

Reference:
https://docs.oracle.com/cd/E36784_01/html/E36857/chapter6-42444.html

> DF_1_SINGLETON Singleton symbols exist.
> DF_1_STUB Object is a stub.
> DF_1_PIE Object is a position-independent executable.

Sponsored by: The FreeBSD Foundation


# e982f6f9 20-Mar-2020 Ed Maste <emaste@FreeBSD.org>

readelf: simplify Xen string note printing

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24140


# d5e7add6 20-Mar-2020 Mark Johnston <markj@FreeBSD.org>

readelf: Fix another instance of the leak mentioned in r357542.

CID: 1292493
MFC after: 1 week
Sponsored by: The FreeBSD Foundation


# c37c6b38 20-Mar-2020 Mark Johnston <markj@FreeBSD.org>

readelf: Avoid leaking ELF descriptors for archive entries.

CID: 1292494
MFC after: 1 week
Sponsored by: The FreeBSD Foundation


# 6c37d603 06-Mar-2020 Ed Maste <emaste@FreeBSD.org>

readelf: print GNU Build-ID

Sponsored by: The FreeBSD Foundation


# ff0f134b 06-Mar-2020 Ed Maste <emaste@FreeBSD.org>

readelf: decode and print Xen ELF note strings

Sponsored by: The FreeBSD Foundation


# 4d8a9faf 06-Mar-2020 Ed Maste <emaste@FreeBSD.org>

readelf: add XEN_ELFNOTE_PHYS32_ENTRY note

See r336469 for details.

Sponsored by: The FreeBSD Foundation


# 89839cad 04-Mar-2020 Ed Maste <emaste@FreeBSD.org>

readelf: simplify namesz / descsz checks

MFC after: 3 days
Sponsored by: The FreeBSD Foundation


# 721ac29c 04-Mar-2020 Ed Maste <emaste@FreeBSD.org>

readelf: check note namesz and descsz

Previously corrupt note namesz or descsz (perhaps caused by readelf's
current lack of endian support for notes) resulted in a crash. Check
that namesz and descsz do not extend beyond the end of the buffer before
trying to access name and desc data.

Reported by: jhb
MFC after: 3 days
Sponsored by: The FreeBSD Foundation


# d06e23f9 04-Mar-2020 Ed Maste <emaste@FreeBSD.org>

Reserve WXNEEDED ELF feature control flag

This will be used to tag binaries that require W+X mappings, in advance
of the ability to prevent W^X in mmap/mprotect.

There is still some discussion about the flag's name, but the ABI won't
change even if the name does (as kib pointed out in the review).

Reviewed by: csjp, kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23909


# 8e7e7da5 01-Mar-2020 Ed Maste <emaste@FreeBSD.org>

readelf: add PROTMAX_DISABLE and STKGAP_DISABLE

From r349609 (PROTMAX_DISABLE) and r354790 (STKGAP_DISABLE). Commited
upstream (in a slightly different form) as r3831.

Sponsored by: The FreeBSD Foundation


# 85642eee 04-Feb-2020 Mark Johnston <markj@FreeBSD.org>

readelf: Don't leak memory when dwarf_get_fde_info_for_all_regs() fails.

CID: 1292493
MFC after: 1 week
Sponsored by: The FreeBSD Foundation


# 37fa1df2 04-Feb-2020 Mark Johnston <markj@FreeBSD.org>

readelf: Fix the check for an error from realloc().

Use err() instead of errx() while here, since realloc() sets errno.

CID: 1401326
MFC after: 1 week
Sponsored by: The FreeBSD Foundation


# dfa16904 04-Feb-2020 Mark Johnston <markj@FreeBSD.org>

readelf: Fix a double close of the input file.

The caller of dump_object() is responsible for opening the file, let it
be responsible for closing too.

CID: 1411588
MFC after: 1 week
Sponsored by: The FreeBSD Foundation


# 12f7c1e8 18-Nov-2019 Justin Hibbits <jhibbits@FreeBSD.org>

ELF toolchain: Add PowerPC VMX and VSX note decode to readelf

Summary: A follow-on to r276634, which added the VMX note to userland cores,
and r334538 for VSX notes.

Copied from note_type_linux_core().

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D22404


# 19669671 06-Aug-2019 Mark Johnston <markj@FreeBSD.org>

readelf: Close input files when done with them.

The low fd limit used by poudriere exposed an odd failure mode in
cap_fileargs (used by readelf as of r350516). In particular, when
the limit was hit, both the main process and casper service would
block on their shared socket, waiting forever for the other to send a
message.

Reported by: zeising
MFC after: 3 days
Sponsored by: The FreeBSD Foundation


# 802c2095 01-Aug-2019 Mark Johnston <markj@FreeBSD.org>

Capsicumize readelf(1).

Reviewed by: oshogbo
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21108


# 14a345d9 01-Aug-2019 Ed Maste <emaste@FreeBSD.org>

readelf: decode NT_GNU_PROPERTY_TYPE_0 / GNU_PROPERTY_X86_FEATURE_1_AND

These bits are used for Intel CET IBT/Shadow Stack.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20516


# 1a0c2201 30-Jun-2019 Mitchell Horne <mhorne@FreeBSD.org>

readelf: Add RISC-V DWARF register aliases

This allows DWARF debugging output to use the common register
mneumonics, such as ra, sp, or t0.

DWARF registers 0-31 are mapped to the 32 general purpose registers,
which are then followed by the 32 floating point registers.

Reviewed by: markj
Approved by: markj (mentor)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D20779


# 857e20a2 28-Jun-2019 Leandro Lupori <luporl@FreeBSD.org>

[PowerPC64] readelf: print description for 'e_flags' in ELF header (ABI type)

This prints out description text with the meaning of 'Flags' value in PowerPC64.

Example:

$ readelf -h ~/tmp/t1-Flag2
ELF Header:

Magic: 7f 45 4c 46 02 02 01 09 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, big endian
Version: 1 (current)
OS/ABI: FreeBSD
ABI Version: 0
Type: EXEC (Executable file)
Machine: PowerPC 64-bit
Version: 0x1
Entry point address: 0x10010000
Start of program headers: 64 (bytes into file)
Start of section headers: 209368 (bytes into file)
Flags: 0x2, OpenPOWER ELF V2 ABI
Size of this header: 64 (bytes)
Size of program headers: 56 (bytes)
Number of program headers: 10
Size of section headers: 64 (bytes)
Number of section headers: 34
Section header string table index: 31

Submitted by: alfredo.junior_eldorado.org.br
Reviewed by: luporl
Differential Revision: https://reviews.freebsd.org/D20782


# b0084180 27-Jun-2019 Mitchell Horne <mhorne@FreeBSD.org>

readelf: Add support for RISC-V specific e_flags

Reviewed by: markj
Approved by: markj (mentor)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D20767


# ca307559 07-Jun-2019 Christian S.J. Peron <csjp@FreeBSD.org>

Teach readelf about some OpenBSD ELF program headers

- Add constants for OpenBSD wxneeded, bootdata and randomize to the
FreeBSD elf_common.h file. This is the file that gets used by the
elftoolchain library.
- Update readelf and elfdump utilities to decode these program headers
if they are encountered.

Note: FreeBSD has it's own version of elfdump(1), which will be updated
in a subsequent commit. I am adding it here anyway because this diff is
going to be submitted upstream.

Discussed with: emaste
Reviewed by: imp
MFC afer: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20548

M contrib/elftoolchain/elfdump/elfdump.c
M contrib/elftoolchain/readelf/readelf.c
M sys/sys/elf_common.h


# 718699be 30-May-2019 Mark Johnston <markj@FreeBSD.org>

readelf: Make -t imply -S, for compatibility with GNU binutils.

Reported by: jhb
Reviewed by: emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20475


# cb12a690 17-Apr-2019 Ed Maste <emaste@FreeBSD.org>

readelf: use size_t for object counts

PR: 212539
Reported by: cem
Sponsored by: The FreeBSD Foundation


# 9817bae9 17-Apr-2019 Ed Maste <emaste@FreeBSD.org>

readelf: speed up readelf -wo

Use an array instead of STAILQ, and sort at the end instead of while
adding new elements.

PR: 212539
Submitted by: Bora Özarslan <borako.ozarslan@gmail.com>
Reviewed by: markj
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation


# 77f552e2 28-Mar-2019 Ed Maste <emaste@FreeBSD.org>

readelf: add newline after dumping dynamic FLAGS / FLAGS_1

All three dump_flags() callers need a newline after printing the flags.

Sponsored by: The FreeBSD Foundation


# 0fd15975 28-Mar-2019 Ed Maste <emaste@FreeBSD.org>

Revert other accidentally committed part of r345625


# 09b47fc1 27-Mar-2019 Ed Maste <emaste@FreeBSD.org>

revert r341429 "disable BIND_NOW in libc, libthr, and rtld"

r345620 by kib@ fixed the rtld issue that caused a crash at startup
during resolution of libc's ifuncs with BIND_NOW.

PR: 233333
Sponsored by: The FreeBSD Foundation


# 3f0e38d7 01-Feb-2019 Ed Maste <emaste@FreeBSD.org>

readelf: decode FreeBSD note types

Decode NT_FREEBSD_ABI_TAG, NT_FREEBSD_ARCH_TAG, and NT_FREEBSD_FEATURE_CTL.

Reviewed by: brooks, kib (earlier)
MFC after: 2 weeks
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19054


# 6b2779a0 01-Feb-2019 Ed Maste <emaste@FreeBSD.org>

readelf: use table-based DT_FLAGS and DT_FLAGS_1 decoding

Fewer lines of code and more maintainable.

Reviewed by: brooks, kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19053


# 675f752c 31-Jan-2019 Ed Maste <emaste@FreeBSD.org>

readelf: dump elf note data

Output format is compatible with GNU readelf's handling of unknown note
types (modulo a GNU char signedness bug); future changes will add type-
specific decoding.

Reviewed by: kib
MFC after: 1 week
Relnotes: Yes
Sponsored by: The FreeBSD Foundation


# fb4e7182 30-Jan-2019 Ed Maste <emaste@FreeBSD.org>

readelf: fix i386 build

Use %jx and (uintmax_t) cast.

PR: 232983
MFC with: r343592
Sponsored by: The FreeBSD Foundation


# 87a8583b 30-Jan-2019 Ed Maste <emaste@FreeBSD.org>

readelf: decode flag bits in DT_FLAGS/DT_FLAGS_1

Decode d_val when the tag is DT_FLAGS or DT_FLAGS_1 based on the
information at:

https://docs.oracle.com/cd/E23824_01/html/819-0690/chapter6-42444.html

PR: 232983
Submitted by: Bora Ozarslan borako.ozarslan@gmail.com
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18784


# 65caaa0e 21-Nov-2018 Maxim Sobolev <sobomax@FreeBSD.org>

Fix CU: output of the --debug-dump=decodedline, the problem there
is that both file name and current directory is recorded, however
file name sometimes already contains absolute path. In which case
prefixing it with directory name results in an invalid pathname.

Only append directory name if the file name does not start with '/'.
This seems to DTRT.

Approved by: emaste
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D18290


# e74f411d 02-Nov-2018 Ed Maste <emaste@FreeBSD.org>

Define NT_FREEBSD_FEATURE_CTL ELF note type

This ELF note will be used to allow binaries to opt out of, or in to,
upcoming vulnerability mitigation and other features.

Committing the definition and readelf change separately to allow
independent MFC.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation


# ce0c6340 10-Aug-2018 Ed Maste <emaste@FreeBSD.org>

readelf: display NT_GNU_PROPERTY_TYPE_0 note name

NT_GNU_PROPERTY_TYPE_0 in a .note.gnu.property section "contains a
program property note which describes special handling requirements
for linker and run-time loader." (from the System V Application Binary
Interface - Linux Extensions")

Intel CET uses two processor-specific program properties in
NT_GNU_PROPERTY_TYPE_0: GNU_PROPERTY_X86_FEATURE_1_IBT to indicate that
all executable sections are compatible with Indirect Branch Tracking,
and GNU_PROPERTY_X86_FEATURE_1_SHSTK to indicate that sections are
compatible with shadow stack.

A later change should add decoding of the individual properties.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation


# 48d41ef0 13-May-2018 Phil Shafer <phil@FreeBSD.org>

Handle thread-local storage (TLS) segments correctly when
copying (objcopy) and displaying (readelf) them.

PR: 227552
Submitted by: kaiw (maintainer)
Reported by: jachmann@unitix.org
Reviewed by: phil
MFC after: 1 day


# 7003cfb3 26-Dec-2017 Ed Maste <emaste@FreeBSD.org>

readelf: report byte size for DT_PREINIT_ARRAYSZ

Sponsored by: The FreeBSD Foundation


# 9fb35c8d 15-Sep-2017 John Baldwin <jhb@FreeBSD.org>

Add missing newline after unknown MIPS-specific dynamic entries.

Reviewed by: emaste
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D12384


# 369bd05b 14-Sep-2017 John Baldwin <jhb@FreeBSD.org>

Recognize NT_PTLWPINFO and NT_ARM_VFP in FreeBSD ELF cores.

Reviewed by: emaste
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D12371


# 75826696 16-Jul-2017 Ed Maste <emaste@FreeBSD.org>

readelf: correct printing of DT_FILTER and DT_AUXILIARY values

Previously these were shown only for MIPS objects.

Obtained from: ELF Tool Chain r3564
MFC after: 1 week
MFC with: r321045
Sponsored by: The FreeBSD Foundation


# d62ecb4e 15-Jul-2017 Ed Maste <emaste@FreeBSD.org>

readelf: fix printing of DT_FILTER and some other DT_* values

Some non-processor-specific DT_* values overlap the range DT_LOPROC to
DT_HIPROC. Handle common ones first, then the processor-specific ones.

Obtained from: ELF Tool Chain r3563
Sponsored by: The FreeBSD Foundation


# e9f3f88a 19-Apr-2017 Ed Maste <emaste@FreeBSD.org>

readelf: dump MIPS abiflags section

This is not fully fleshed out but is sufficient to dump the
SHT_MIPS_ABIFLAGS used in FreeBSD.

Reviewed by: imp
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8241


# 7dc45d65 07-Dec-2016 Conrad Meyer <cem@FreeBSD.org>

readelf(1) -S: Include zero index and match binutils' no-name

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.

Reviewed by: kaiw@
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D8707


# 714935be 04-Dec-2016 Conrad Meyer <cem@FreeBSD.org>

readelf(1): Add support for extended program header numbers

Add support for extended program header numbers to elftoolchain
'readelf -h'.

Reviewed by: emaste
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D8702


# d0bd2dad 31-Aug-2016 Ed Maste <emaste@FreeBSD.org>

readelf: silence GCC 4.2.1 uninitialized variable warning

Sponsored by: The FreeBSD Foundation


# 20136ffc 02-Aug-2016 Ed Maste <emaste@FreeBSD.org>

readelf: report ARM program and section header types

Reviewed by: andrew
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7390


# 94bb24b3 05-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Use the in-tree sys/elf_common.h to build libelftc.

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


# bcf9fc28 21-May-2016 Ed Maste <emaste@FreeBSD.org>

elftoolchain: backwards compatability for ELFOSABI_CLOUDABI definition

It is not provided by sys/elf_common.h on older releases or -current
before March 2015.

Reported by: Jenkins


# bdef86c6 20-May-2016 Ed Maste <emaste@FreeBSD.org>

elftoolchain: backwards compatability for EM_RISCV definition

It is not provided by sys/elf_common.h on older releases

Reported by: Jenkins


# d28b40c8 20-May-2016 Ed Maste <emaste@FreeBSD.org>

elftoolchain: backwards compatability for EM_IAMCU definition

It is not provided by sys/elf_common.h on older stable/10.


# baed4bab 05-Feb-2016 Ed Maste <emaste@FreeBSD.org>

readelf: decode AArch64 TLS descriptor relocations

From ELF for the ARM(R) 64-bit Architecture, table 4-19.

Obtained from: ELF Tool Chain r3386
Sponsored by: The FreeBSD Foundation


# 03a5ea47 05-Feb-2016 Ed Maste <emaste@FreeBSD.org>

readelf: report value of unknown relocation types

Obtained from: ELF Tool Chain r3387
Sponsored by: The FreeBSD Foundation


# 23541160 05-Feb-2016 Ed Maste <emaste@FreeBSD.org>

readelf: avoid accidental fallthrough in RISC-V relocations

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


# 8f32e46d 13-Dec-2015 Kai Wang <kaiw@FreeBSD.org>

Fixed uninitialized variable warnings.


# 895f86f1 02-Dec-2015 Ed Maste <emaste@FreeBSD.org>

readelf: add Xen ELF notes

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D4356


# da1cc412 09-Oct-2015 Alexander Kabaev <kan@FreeBSD.org>

Add definitions for MIPS TLS relocations to elftoolchain.

This makes our readelf more useful when looking for TLS-related
issues.


# 453b09ca 24-Sep-2015 Ed Maste <emaste@FreeBSD.org>

Rename ELFOSABI_SYSV to ELFOSABI_NONE to match current spec

Source: http://www.sco.com/developers/gabi/latest/ch4.eheader.html

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3731


# 473c31f1 24-Sep-2015 Ed Maste <emaste@FreeBSD.org>

readelf: Correct typo HPUS -> HPUX

Submitted by: kib


# 71edbbfd 24-Jul-2015 Ed Maste <emaste@FreeBSD.org>

readelf: avoid division by zero on section entry size

ELF Tool Chain tickets #439, #444, #445, #467
Reported by: Alexander Cherepanov <cherepan@mccme.ru> (#467)
Reported by: antiAgainst (others)

Reviewed by: brooks
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2338


# 119b7592 24-Jul-2015 Ed Maste <emaste@FreeBSD.org>

Add RISC-V ELF machine type definition

EM_RISCV is now officially registered as e_machine 243.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation


# 57736250 20-Jan-2015 Ed Maste <emaste@FreeBSD.org>

redelf: Add missing R_X86_64_ relocation types

PR: 196918
Reviewed by: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D1570


# 02b08c90 05-Jan-2015 Ed Maste <emaste@FreeBSD.org>

readelf: Handle note types from different operating systems

Previously elftoolchain readelf(1) produced correct description text
only for Linux note types.

Upstream elftoolchain ticket #473

Differential Revision: https://reviews.freebsd.org/D1428
Reviewed by: kib
Sponsored by: The FreeBSD Foundation


# 34e3f146 02-Jan-2015 Ed Maste <emaste@FreeBSD.org>

readelf: Correct rounding on note padding

In general 64-bit ELF notes use 4-byte padding, not 8, despite what is
claimed in various specs.

Upstream elftoolchain ticket 472
https://sourceforge.net/p/elftoolchain/tickets/472/

Sponsored by: The FreeBSD Foundation


# 3dc58d9c 31-Dec-2014 Ed Maste <emaste@FreeBSD.org>

readelf: Add stdint.h for C99 fixed size types

Upstream elftoolchain brings in stdint.h via an ELF header that we
do not use in FreeBSD.

Sponsored by: The FreeBSD Foundation


# 2013b96e 29-Dec-2014 Ed Maste <emaste@FreeBSD.org>

Rename DT_FEATURE_1 to DT_FEATURE

Track r270303:

This provides a minor cleanup in elfdump; there are otherwise no
consumers in the tree. Old SUN documentation can be found for either
variant, but GNU binutils switched to DT_FEATURE around 2000.

Sponsored by: The FreeBSD Foundation


# b3f26809 22-Dec-2014 Ed Maste <emaste@FreeBSD.org>

Add AArch64 machine time and relocations for readelf

Reviewed by: andrew
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D1333