elfdefinitions: Add a compile-time knob for controlling file inclusion.
The initial use-case is for NetBSD, to allow this file to be
used alongside NetBSD's <sys/exec_elf.h>.
libelf/testsuite: Use deterministic file timestamps in a test.
TET will (by default) copy test case files to a temporary
directory before executing a test case. This causes the
modification times for individual files in the test case's
temporary directory to differ from their respective timestamps
when the test archive was built.
Instead, use a fixed file modification time for archive members
when creating the archive, and have the test case check for
this fixed value.
common: Refactor the ELF{32,64}_ST_*() macros.
Define ELF class-agnostic ELF_ST_*() macros for accessing the
'st_info' and 'st_other' fields of Elf##_Sym structures, and use
the class-agnostic definitions to implement the class-specific
ELF{32,64}_ST_*() macros.
The class-agnostic ELF_ST_*() macros should help improve the
succinctness of code fragments dealing with these fields that
are otherwise ELF class-agnostic.
elfconstants: remove DT_MAXPOSTAGS.
This symbol holds the number of small-valued DT_* tags known
at compile time.
However, ELF files in the wild could contain DT_* tags that
are not known at compile time and/or could contain known
but non-small-valued tags in the range DT_LOOS (0x6000000D)
to DT_HIPROC (0x7FFFFFFF). ELF-handling tools are expected
to handle such tags gracefully, which means that the value of
DT_MAXPOSTAGS is not useful in practice.
Remove the symbol to reduce maintenance overhead.
libelf/testsuite: Add tests for ar(1) archive handling.
These tests verify that ar(1) archives with unparseable archive
headers are flagged appropriately.