summaryrefslogtreecommitdiff
path: root/libdwelf/Makefile.am
Commit message (Collapse)AuthorAgeFilesLines
* libdwelf: Add dwelf_elf_e_machine_string and use it in readelf.Mark Wielaard2019-07-101-1/+2
| | | | | | | | | | | | | | | | To print eh human readable description of the ELF e_machine header field we used the ebl name. But this is not set for most EM constants. Introduce a new function dwelf_elf_e_machine_string that does work for all known EM values. Use that in eu-readelf to print a string representation of the e_machine value. Since this was the only usage of ebl->name, remove that from struct ebl. Also add a testcase that makes sure dwelf_elf_e_machine_string works for all EM values in the libelf/elf.h header so we will immediately notice when a new value appears. Signed-off-by: Mark Wielaard <mark@klomp.org>
* libdwelf: New function dwelf_elf_begin.Mark Wielaard2018-11-091-1/+1
| | | | | | | | | | | | | | | | | | This introduces a new function dwelf_elf_begin which creates a (read-only) ELF handle from a possibly compressed file handle or a file that start with a linux kernel header. This can be used in eu-readelf to (re)open a (pure) ELF. eu-readelf uses libdwfl to relocate addresses in the original file in case it is ET_REL. But to show the "raw" data it might need to (re)open the file. Which could fail if the file was compressed. And produced an obscure error message: "cannot create EBL handle". This rewrites __libdw_open_file a little so that the given file handle will never be closed (whether on success or failure) and introduces a new internal function __libdw_open_elf that dwelf_elf_begin wraps. Signed-off-by: Mark Wielaard <mark@klomp.org>
* dwelf: Add string table functions from ebl.Mark Wielaard2016-08-031-1/+2
| | | | | | | | | | | | | | | | Move the strtab functions from libebl to libdw. Programs often want to create ELF/DWARF string tables. We don't want (static) linking against ebl since those are internal functions that might change. This introduces dwelf_strtab_init, dwelf_strtab_add, dwelf_strtab_add_len, dwelf_strtab_finalize, dwelf_strent_off, dwelf_strent_str and dwelf_strtab_free. Documentation for each has been added to libdwelf.h. The add fucntion got a variant that takes the length explicitly and finalize was changed to return NULL on out of memory instead of aborting. All code and tests now uses the new functions. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libdwelf: Add dwelf_scn_gnu_compressed_size.Mark Wielaard2016-01-061-2/+2
| | | | | | Helper function to get the size of a GNU compressed zdebug section. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libdwelf: Add dwelf_elf_gnu_build_id.Mark Wielaard2014-05-011-2/+4
| | | | | | | | | Move internal function __libdwfl_find_build_id to libdwelf and use it to add a public dwelf_elf_gnu_build_id function to extract the NT_GNU_BUILD_ID from an ELF file using either the shdrs or phdrs. Adjust internal callers and add a testcase. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* libdwelf: Add dwelf_dwarf_gnu_debugaltlinkFlorian Weimer2014-04-241-1/+1
| | | | Signed-off-by: Florian Weimer <fweimer@redhat.com>
* libdwelf: New DWARF ELF Low-level Functions. Add dwelf_elf_gnu_debuglink.Mark Wielaard2014-04-241-0/+53
New public header elfutils/libdwelf.h for low-level DWARF/ELF helper functions. The new function dwelf_elf_gnu_debuglink returns the name and crc as found in the .gnu_debuglink section of an ELF file. Signed-off-by: Mark Wielaard <mjw@redhat.com>