Bug 232983 - readelf: does not decode DT_FLAGS/DT_FLAGS_1
Summary: readelf: does not decode DT_FLAGS/DT_FLAGS_1
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-05 14:17 UTC by Ed Maste
Modified: 2019-04-22 08:59 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer 2018-11-05 14:17:20 UTC
GNU readelf reports:
Dynamic section at offset 0x9028 contains 25 entries:
  Tag        Type                         Name/Value
...
 0x000000000000001e (FLAGS)              BIND_NOW
 0x000000006ffffffb (FLAGS_1)            Flags: NOW

ELF Tool Chain readelf reports:
Dynamic section at offset 0x9028 contains 25 entries:
  Tag                Type                  Name/Value
...
 0x000000000000001e FLAGS               
 0x000000006ffffffb FLAGS_1             

We should decode and display the individual flags.
Comment 1 commit-hook freebsd_committer 2019-01-30 20:45:40 UTC
A commit references this bug:

Author: emaste
Date: Wed Jan 30 20:44:51 UTC 2019
New revision: 343592
URL: https://svnweb.freebsd.org/changeset/base/343592

Log:
  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

Changes:
  head/contrib/elftoolchain/readelf/readelf.c
Comment 2 commit-hook freebsd_committer 2019-01-30 21:46:35 UTC
A commit references this bug:

Author: emaste
Date: Wed Jan 30 21:46:12 UTC 2019
New revision: 343593
URL: https://svnweb.freebsd.org/changeset/base/343593

Log:
  readelf: fix i386 build

  Use %jx and (uintmax_t) cast.

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

Changes:
  head/contrib/elftoolchain/readelf/readelf.c
Comment 3 commit-hook freebsd_committer 2019-04-22 08:59:28 UTC
A commit references this bug:

Author: ngie
Date: Mon Apr 22 08:58:38 UTC 2019
New revision: 346536
URL: https://svnweb.freebsd.org/changeset/base/346536

Log:
  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

Changes:
_U  stable/12/
  stable/12/contrib/elftoolchain/README.rst
  stable/12/contrib/elftoolchain/addr2line/addr2line.1
  stable/12/contrib/elftoolchain/addr2line/addr2line.c
  stable/12/contrib/elftoolchain/ar/ar.1
  stable/12/contrib/elftoolchain/ar/ar.5
  stable/12/contrib/elftoolchain/ar/ar.c
  stable/12/contrib/elftoolchain/ar/ar.h
  stable/12/contrib/elftoolchain/ar/ranlib.1
  stable/12/contrib/elftoolchain/ar/read.c
  stable/12/contrib/elftoolchain/ar/write.c
  stable/12/contrib/elftoolchain/common/native-elf-format
  stable/12/contrib/elftoolchain/cxxfilt/c++filt.1
  stable/12/contrib/elftoolchain/elfcopy/elfcopy.1
  stable/12/contrib/elftoolchain/elfcopy/elfcopy.h
  stable/12/contrib/elftoolchain/elfcopy/mcs.1
  stable/12/contrib/elftoolchain/elfcopy/sections.c
  stable/12/contrib/elftoolchain/elfcopy/segments.c
  stable/12/contrib/elftoolchain/elfcopy/strip.1
  stable/12/contrib/elftoolchain/libdwarf/dwarf.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_comp_dir.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_const_value_string.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_dataref.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_flag.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_location_expr.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_name.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_producer.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_ref_address.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_reference.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_signed_const.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_string.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_targ_address.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_arange.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_die_to_debug.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_directory_decl.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_expr_addr.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_expr_gen.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_fde_inst.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_file_decl.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_frame_cie.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_frame_fde.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_funcname.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_line_entry.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_pubname.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_typename.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_varname.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_weakname.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_attr.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_attrlist.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_attroffset.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_child.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_dealloc.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_def_macro.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_die_abbrev_code.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_die_link.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_diename.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_dieoffset.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_end_macro_file.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_errmsg.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_errno.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_expand_frame_instructions.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_expr_current_offset.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_expr_into_block.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_fde_cfa_offset.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_find_macro_value_start.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_finish.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_formaddr.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_formblock.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_formexprloc.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_formflag.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_formref.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_formsig8.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_formstring.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_formudata.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_AT_name.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_abbrev.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_abbrev_children_flag.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_abbrev_code.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_abbrev_entry.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_abbrev_tag.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_address_size.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_arange.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_arange_info.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_aranges.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_cie_index.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_cie_info.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_cie_of_fde.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_cu_die_offset.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_die_infotypes_flag.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_elf.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_fde_at_pc.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_all_regs.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_all_regs3.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_cfa_reg3.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_reg.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_reg3.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_fde_instr_bytes.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_fde_list.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_fde_n.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_fde_range.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_form_class.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_funcs.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_globals.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_loclist_entry.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_macro_details.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_pubtypes.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_ranges.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_relocation_info.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_relocation_info_count.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_section_bytes.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_section_max_offsets.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_str.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_types.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_vars.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_weaks.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_hasattr.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_hasform.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_highpc.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_init.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_lineno.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_lne_end_sequence.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_lne_set_address.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_loclist.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_loclist_from_expr.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_new_die.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_new_expr.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_new_fde.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_next_cu_header.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_next_types_section.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_object_init.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_producer_init.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_producer_set_isa.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_reset_section_bytes.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_set_frame_cfa_value.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_set_reloc_application.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_seterrarg.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_srcfiles.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_srclines.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_start_macro_file.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_tag.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_transform_to_disk_form.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_undef_macro.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_vendor_ext.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_whatattr.3
  stable/12/contrib/elftoolchain/libelf/Makefile
  stable/12/contrib/elftoolchain/libelf/_libelf.h
  stable/12/contrib/elftoolchain/libelf/elf.3
  stable/12/contrib/elftoolchain/libelf/elf_begin.3
  stable/12/contrib/elftoolchain/libelf/elf_cntl.3
  stable/12/contrib/elftoolchain/libelf/elf_data.c
  stable/12/contrib/elftoolchain/libelf/elf_end.3
  stable/12/contrib/elftoolchain/libelf/elf_errmsg.3
  stable/12/contrib/elftoolchain/libelf/elf_fill.3
  stable/12/contrib/elftoolchain/libelf/elf_flagdata.3
  stable/12/contrib/elftoolchain/libelf/elf_getarhdr.3
  stable/12/contrib/elftoolchain/libelf/elf_getarsym.3
  stable/12/contrib/elftoolchain/libelf/elf_getbase.3
  stable/12/contrib/elftoolchain/libelf/elf_getdata.3
  stable/12/contrib/elftoolchain/libelf/elf_getident.3
  stable/12/contrib/elftoolchain/libelf/elf_getphdrnum.3
  stable/12/contrib/elftoolchain/libelf/elf_getphnum.3
  stable/12/contrib/elftoolchain/libelf/elf_getscn.3
  stable/12/contrib/elftoolchain/libelf/elf_getshdrnum.3
  stable/12/contrib/elftoolchain/libelf/elf_getshdrstrndx.3
  stable/12/contrib/elftoolchain/libelf/elf_getshnum.3
  stable/12/contrib/elftoolchain/libelf/elf_getshstrndx.3
  stable/12/contrib/elftoolchain/libelf/elf_hash.3
  stable/12/contrib/elftoolchain/libelf/elf_kind.3
  stable/12/contrib/elftoolchain/libelf/elf_memory.3
  stable/12/contrib/elftoolchain/libelf/elf_next.3
  stable/12/contrib/elftoolchain/libelf/elf_open.3
  stable/12/contrib/elftoolchain/libelf/elf_rand.3
  stable/12/contrib/elftoolchain/libelf/elf_rawfile.3
  stable/12/contrib/elftoolchain/libelf/elf_scn.c
  stable/12/contrib/elftoolchain/libelf/elf_strptr.3
  stable/12/contrib/elftoolchain/libelf/elf_update.3
  stable/12/contrib/elftoolchain/libelf/elf_update.c
  stable/12/contrib/elftoolchain/libelf/elf_version.3
  stable/12/contrib/elftoolchain/libelf/gelf.3
  stable/12/contrib/elftoolchain/libelf/gelf_checksum.3
  stable/12/contrib/elftoolchain/libelf/gelf_fsize.3
  stable/12/contrib/elftoolchain/libelf/gelf_getcap.3
  stable/12/contrib/elftoolchain/libelf/gelf_getclass.3
  stable/12/contrib/elftoolchain/libelf/gelf_getdyn.3
  stable/12/contrib/elftoolchain/libelf/gelf_getehdr.3
  stable/12/contrib/elftoolchain/libelf/gelf_getmove.3
  stable/12/contrib/elftoolchain/libelf/gelf_getphdr.3
  stable/12/contrib/elftoolchain/libelf/gelf_getrel.3
  stable/12/contrib/elftoolchain/libelf/gelf_getrela.3
  stable/12/contrib/elftoolchain/libelf/gelf_getshdr.3
  stable/12/contrib/elftoolchain/libelf/gelf_getsym.3
  stable/12/contrib/elftoolchain/libelf/gelf_getsyminfo.3
  stable/12/contrib/elftoolchain/libelf/gelf_getsymshndx.3
  stable/12/contrib/elftoolchain/libelf/gelf_mips64el.c
  stable/12/contrib/elftoolchain/libelf/gelf_newehdr.3
  stable/12/contrib/elftoolchain/libelf/gelf_newphdr.3
  stable/12/contrib/elftoolchain/libelf/gelf_update_ehdr.3
  stable/12/contrib/elftoolchain/libelf/gelf_xlate.c
  stable/12/contrib/elftoolchain/libelf/gelf_xlatetof.3
  stable/12/contrib/elftoolchain/libelf/libelf_convert.m4
  stable/12/contrib/elftoolchain/libelf/libelf_ehdr.c
  stable/12/contrib/elftoolchain/libelf/libelf_elfmachine.c
  stable/12/contrib/elftoolchain/libelf/libelf_phdr.c
  stable/12/contrib/elftoolchain/libelf/libelf_xlate.c
  stable/12/contrib/elftoolchain/libelftc/elftc.3
  stable/12/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3
  stable/12/contrib/elftoolchain/libelftc/elftc_copyfile.3
  stable/12/contrib/elftoolchain/libelftc/elftc_demangle.3
  stable/12/contrib/elftoolchain/libelftc/elftc_reloc_type_str.3
  stable/12/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c
  stable/12/contrib/elftoolchain/libelftc/elftc_set_timestamps.3
  stable/12/contrib/elftoolchain/libelftc/elftc_string_table_create.3
  stable/12/contrib/elftoolchain/libelftc/elftc_timestamp.3
  stable/12/contrib/elftoolchain/libelftc/elftc_version.3
  stable/12/contrib/elftoolchain/nm/nm.1
  stable/12/contrib/elftoolchain/readelf/readelf.1
  stable/12/contrib/elftoolchain/readelf/readelf.c
  stable/12/contrib/elftoolchain/strings/strings.c
  stable/12/lib/libelf/Makefile
  stable/12/lib/libelftc/elftc_version.c
Comment 4 commit-hook freebsd_committer 2019-04-22 08:59:30 UTC
A commit references this bug:

Author: ngie
Date: Mon Apr 22 08:58:38 UTC 2019
New revision: 346536
URL: https://svnweb.freebsd.org/changeset/base/346536

Log:
  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

Changes:
_U  stable/12/
  stable/12/contrib/elftoolchain/README.rst
  stable/12/contrib/elftoolchain/addr2line/addr2line.1
  stable/12/contrib/elftoolchain/addr2line/addr2line.c
  stable/12/contrib/elftoolchain/ar/ar.1
  stable/12/contrib/elftoolchain/ar/ar.5
  stable/12/contrib/elftoolchain/ar/ar.c
  stable/12/contrib/elftoolchain/ar/ar.h
  stable/12/contrib/elftoolchain/ar/ranlib.1
  stable/12/contrib/elftoolchain/ar/read.c
  stable/12/contrib/elftoolchain/ar/write.c
  stable/12/contrib/elftoolchain/common/native-elf-format
  stable/12/contrib/elftoolchain/cxxfilt/c++filt.1
  stable/12/contrib/elftoolchain/elfcopy/elfcopy.1
  stable/12/contrib/elftoolchain/elfcopy/elfcopy.h
  stable/12/contrib/elftoolchain/elfcopy/mcs.1
  stable/12/contrib/elftoolchain/elfcopy/sections.c
  stable/12/contrib/elftoolchain/elfcopy/segments.c
  stable/12/contrib/elftoolchain/elfcopy/strip.1
  stable/12/contrib/elftoolchain/libdwarf/dwarf.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_comp_dir.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_const_value_string.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_dataref.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_flag.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_location_expr.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_name.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_producer.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_ref_address.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_reference.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_signed_const.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_string.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_AT_targ_address.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_arange.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_die_to_debug.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_directory_decl.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_expr_addr.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_expr_gen.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_fde_inst.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_file_decl.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_frame_cie.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_frame_fde.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_funcname.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_line_entry.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_pubname.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_typename.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_varname.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_add_weakname.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_attr.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_attrlist.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_attroffset.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_child.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_dealloc.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_def_macro.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_die_abbrev_code.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_die_link.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_diename.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_dieoffset.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_end_macro_file.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_errmsg.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_errno.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_expand_frame_instructions.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_expr_current_offset.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_expr_into_block.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_fde_cfa_offset.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_find_macro_value_start.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_finish.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_formaddr.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_formblock.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_formexprloc.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_formflag.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_formref.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_formsig8.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_formstring.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_formudata.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_AT_name.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_abbrev.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_abbrev_children_flag.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_abbrev_code.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_abbrev_entry.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_abbrev_tag.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_address_size.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_arange.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_arange_info.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_aranges.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_cie_index.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_cie_info.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_cie_of_fde.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_cu_die_offset.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_die_infotypes_flag.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_elf.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_fde_at_pc.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_all_regs.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_all_regs3.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_cfa_reg3.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_reg.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_reg3.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_fde_instr_bytes.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_fde_list.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_fde_n.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_fde_range.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_form_class.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_funcs.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_globals.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_loclist_entry.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_macro_details.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_pubtypes.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_ranges.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_relocation_info.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_relocation_info_count.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_section_bytes.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_section_max_offsets.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_str.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_types.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_vars.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_get_weaks.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_hasattr.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_hasform.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_highpc.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_init.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_lineno.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_lne_end_sequence.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_lne_set_address.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_loclist.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_loclist_from_expr.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_new_die.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_new_expr.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_new_fde.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_next_cu_header.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_next_types_section.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_object_init.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_producer_init.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_producer_set_isa.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_reset_section_bytes.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_set_frame_cfa_value.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_set_reloc_application.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_seterrarg.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_srcfiles.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_srclines.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_start_macro_file.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_tag.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_transform_to_disk_form.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_undef_macro.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_vendor_ext.3
  stable/12/contrib/elftoolchain/libdwarf/dwarf_whatattr.3
  stable/12/contrib/elftoolchain/libelf/Makefile
  stable/12/contrib/elftoolchain/libelf/_libelf.h
  stable/12/contrib/elftoolchain/libelf/elf.3
  stable/12/contrib/elftoolchain/libelf/elf_begin.3
  stable/12/contrib/elftoolchain/libelf/elf_cntl.3
  stable/12/contrib/elftoolchain/libelf/elf_data.c
  stable/12/contrib/elftoolchain/libelf/elf_end.3
  stable/12/contrib/elftoolchain/libelf/elf_errmsg.3
  stable/12/contrib/elftoolchain/libelf/elf_fill.3
  stable/12/contrib/elftoolchain/libelf/elf_flagdata.3
  stable/12/contrib/elftoolchain/libelf/elf_getarhdr.3
  stable/12/contrib/elftoolchain/libelf/elf_getarsym.3
  stable/12/contrib/elftoolchain/libelf/elf_getbase.3
  stable/12/contrib/elftoolchain/libelf/elf_getdata.3
  stable/12/contrib/elftoolchain/libelf/elf_getident.3
  stable/12/contrib/elftoolchain/libelf/elf_getphdrnum.3
  stable/12/contrib/elftoolchain/libelf/elf_getphnum.3
  stable/12/contrib/elftoolchain/libelf/elf_getscn.3
  stable/12/contrib/elftoolchain/libelf/elf_getshdrnum.3
  stable/12/contrib/elftoolchain/libelf/elf_getshdrstrndx.3
  stable/12/contrib/elftoolchain/libelf/elf_getshnum.3
  stable/12/contrib/elftoolchain/libelf/elf_getshstrndx.3
  stable/12/contrib/elftoolchain/libelf/elf_hash.3
  stable/12/contrib/elftoolchain/libelf/elf_kind.3
  stable/12/contrib/elftoolchain/libelf/elf_memory.3
  stable/12/contrib/elftoolchain/libelf/elf_next.3
  stable/12/contrib/elftoolchain/libelf/elf_open.3
  stable/12/contrib/elftoolchain/libelf/elf_rand.3
  stable/12/contrib/elftoolchain/libelf/elf_rawfile.3
  stable/12/contrib/elftoolchain/libelf/elf_scn.c
  stable/12/contrib/elftoolchain/libelf/elf_strptr.3
  stable/12/contrib/elftoolchain/libelf/elf_update.3
  stable/12/contrib/elftoolchain/libelf/elf_update.c
  stable/12/contrib/elftoolchain/libelf/elf_version.3
  stable/12/contrib/elftoolchain/libelf/gelf.3
  stable/12/contrib/elftoolchain/libelf/gelf_checksum.3
  stable/12/contrib/elftoolchain/libelf/gelf_fsize.3
  stable/12/contrib/elftoolchain/libelf/gelf_getcap.3
  stable/12/contrib/elftoolchain/libelf/gelf_getclass.3
  stable/12/contrib/elftoolchain/libelf/gelf_getdyn.3
  stable/12/contrib/elftoolchain/libelf/gelf_getehdr.3
  stable/12/contrib/elftoolchain/libelf/gelf_getmove.3
  stable/12/contrib/elftoolchain/libelf/gelf_getphdr.3
  stable/12/contrib/elftoolchain/libelf/gelf_getrel.3
  stable/12/contrib/elftoolchain/libelf/gelf_getrela.3
  stable/12/contrib/elftoolchain/libelf/gelf_getshdr.3
  stable/12/contrib/elftoolchain/libelf/gelf_getsym.3
  stable/12/contrib/elftoolchain/libelf/gelf_getsyminfo.3
  stable/12/contrib/elftoolchain/libelf/gelf_getsymshndx.3
  stable/12/contrib/elftoolchain/libelf/gelf_mips64el.c
  stable/12/contrib/elftoolchain/libelf/gelf_newehdr.3
  stable/12/contrib/elftoolchain/libelf/gelf_newphdr.3
  stable/12/contrib/elftoolchain/libelf/gelf_update_ehdr.3
  stable/12/contrib/elftoolchain/libelf/gelf_xlate.c
  stable/12/contrib/elftoolchain/libelf/gelf_xlatetof.3
  stable/12/contrib/elftoolchain/libelf/libelf_convert.m4
  stable/12/contrib/elftoolchain/libelf/libelf_ehdr.c
  stable/12/contrib/elftoolchain/libelf/libelf_elfmachine.c
  stable/12/contrib/elftoolchain/libelf/libelf_phdr.c
  stable/12/contrib/elftoolchain/libelf/libelf_xlate.c
  stable/12/contrib/elftoolchain/libelftc/elftc.3
  stable/12/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3
  stable/12/contrib/elftoolchain/libelftc/elftc_copyfile.3
  stable/12/contrib/elftoolchain/libelftc/elftc_demangle.3
  stable/12/contrib/elftoolchain/libelftc/elftc_reloc_type_str.3
  stable/12/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c
  stable/12/contrib/elftoolchain/libelftc/elftc_set_timestamps.3
  stable/12/contrib/elftoolchain/libelftc/elftc_string_table_create.3
  stable/12/contrib/elftoolchain/libelftc/elftc_timestamp.3
  stable/12/contrib/elftoolchain/libelftc/elftc_version.3
  stable/12/contrib/elftoolchain/nm/nm.1
  stable/12/contrib/elftoolchain/readelf/readelf.1
  stable/12/contrib/elftoolchain/readelf/readelf.c
  stable/12/contrib/elftoolchain/strings/strings.c
  stable/12/lib/libelf/Makefile
  stable/12/lib/libelftc/elftc_version.c