elfconstants: Use unsigned literals for EM_* values.
This change aligns the signedness these literals with
the signedness of the ELF header's 'e_machine' field.
elfdump: replace an ad hoc helper function with an ELFTC(3) API.
This change enables elfdump(1) to decode all of the ELF machine types
known to the Elftoolchain codebase.
libelf: use an unsigned type internally to represent ELF classes.
This should be an internal-only change. External APIs that specify
or return ELF class information (such as gelf_getclass(3) and
gelf_newehdr(3)) continue to use a signed values, as before.
libelftc: change an API to use an unsigned integral type.
Change the type of the 'e_machine' parameter to the
elftc_get_machine_*() APIs to be 'unsigned', to match
the signedness of the ELF header's 'e_machine' field.
elfconstants: Remove an unnecessary 'L' suffix from integer literals.
This allows the C compiler to use an appropriately sized integral type
for these literals, instead of the 'long int' type specified by the
'L' suffix.
elfdump: Fix a -Wformat-truncation error.
On platforms with a 64-bit 'size_t' type, a "%zu" format
specifier can use up to 20 decimal numbers to represent
a size_t value. Scale a char[] buffer being written to
by snprintf() accordingly.
libelftc: Add elftc_get_machine_name() & elftc_get_machine_description().
These APIs translate ELF machine architecture (EM_*) values to their
corresponding symbol names and descriptions.
libelftc: Fix a typo - FreeBSD's riscv port is little-endian.
This change brings the descriptor for target "elf64-riscv-freebsd"
in line with its documentation.
I missed this somehow when reviewing https://reviews.freebsd.org/D20768.
Reported by: Haowu Ge (on -developers)
Reviewed by: emaste at FreeBSD.org, imp at FreeBSD.org
FreeBSD Differential Revision: https://reviews.freebsd.org/D48271
Add descriptions of ELF symbols to the generated "elfdefinitions.h" file.
This should make the generated "elfdefinitions.h" file easier
to comprehend.
While here, refactor the M4 code in the file into smaller helper
macros, and document these.
Update the elftc(3) overview manual page.
- Add brief descriptions of the elftc_string_*() family of
ELF string table functions.
- Add mention of elftc_reloc_type_str() and elftc_timestamp().
- Add manual page cross-references to the functions referenced
in the text.
- Keep lists sorted alphabetically by function name.
libdwarf: document dwarf_get_UT_name().
While here, improve the description of these functions to clarify
that they retrieve symbolic names for DWARF values, while returning
error codes.