MFC r339473,r340075,r342918,r343592,r343593,r343614,r343665,r343669:
MFC a number of changes to elftoolchain/readelf(1). This brings the copy of
elftoolchain more in line with the version in ^/head and partially fixes
the issue with sys.kern.coredump_phnum_test.coredump_phnum on ^/stable/12.
Tested with: make tinderbox
r339473 (by emaste):
libelf: also test for 64-bit ELF in _libelf_is_mips64el
Although _libelf_is_mips64el is only called in contexts where we've
already checked that e_class is ELFCLASS64 but this may change in the
future. Add a safety belt so that we don't access an invalid e_ehdr64
union member if it does.
r340075 (by emaste):
readelf: decode R_MIPS_HIGHER and R_MIPS_HIGHEST relocation types
r342918 (by emaste):
Update to ELF Tool Chain r3668
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.
r343592 (by emaste):
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
r343593 (by emaste):
readelf: fix i386 build
Use %jx and (uintmax_t) cast.
PR: 232983
MFC with: r343592
r343614 (by emaste):
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.
Relnotes: Yes
r343665 (by emaste):
readelf: use table-based DT_FLAGS and DT_FLAGS_1 decoding
Fewer lines of code and more maintainable.
r343669 (by emaste):
readelf: decode FreeBSD note types
Decode NT_FREEBSD_ABI_TAG, NT_FREEBSD_ARCH_TAG, and NT_FREEBSD_FEATURE_CTL.
Relnotes: Yes