Mark Wielaard [Wed, 26 Jul 2017 16:06:21 +0000 (18:06 +0200)]
libdw: Add dwarf_default_lower_bound.
Add dwarf_default_lower_bound to get the default lower bound for a language
when not given as attribute for an subrange type. Implementation extracted
from dwarf_aggregate_size.
Add a test to check all known language codes are handled.
Mark Wielaard [Tue, 25 Jul 2017 13:29:10 +0000 (15:29 +0200)]
libdw: Add DWARF5 attributes.
Add new DWARF5 attribute constant names to the attributes enum.
Also add reserved comments between non-consecutive (reserved) numbers.
Remove DW_AT_subscr_data, DW_AT_element_list and DW_AT_member from the
enum list and turn them into compatibility defines because they are
not part of DWARF2+. That way code that directly references them still
compiles but they won't show up in known-dwarf.h.
Since POWER8, PowerPC 64 supports Hardware Transactional Memory, which has
three special purpose registers associated to it: tfhar, tfiar, and texasr.
This commit add HTM SPRs set as known note type so it's possible to use
'readelf --notes' to inspect the HTM SPRs in a coredump file generated in
such a machines.
Mark Wielaard [Thu, 20 Jul 2017 20:34:29 +0000 (22:34 +0200)]
strip: Deal with ARM data marker symbols pointing to debug sections.
ARM data marker symbols "$d" indicate the start of a sequence of data
items in a section. For data only sections no data marker symbol is
necessary, but may be put pointing to the start of the section.
binutils however has a bug which places a data marker symbol somewhere
inside the section (at least for .debug_frame).
https://sourceware.org/bugzilla/show_bug.cgi?id=21809
When strip finds a symbol pointing to a debug section that would be
put into the .debug file then it will copy over the whole symbol table.
This isn't necessary because the symbol is redundant.
Add an ebl hook to recognize data marker symbols with implementations
for arm and aarch64. Use it in strip to strip such symbols from the
symbol table if they point to a debug section.
Mark Wielaard [Tue, 18 Jul 2017 12:12:36 +0000 (14:12 +0200)]
backends: Don't depend on linux/bpf.h to compile bpf disassembler.
We only need a few constants and one structure definition from linux/bpf.
Just define those in a local lib/bpf.h file. This makes sure the bpf
disassembler is always build and included even when elfutils is build
on older GNU/Linux systems (and even on other platforms).
Ulf Hermann [Fri, 17 Feb 2017 15:11:28 +0000 (16:11 +0100)]
Unify linking of libasm, libelf, libdw, backends
Link them all with -z,defs,-z,relro,--no-undefined, provide complete
dependencies for the link steps, and add libeu.a to each one. libeu.a
contains useful library functionality that each of them might use. The
linker will strip unneeded symbols, so linking it in won't hurt even if
none of the functions are used.
Mark Wielaard [Mon, 17 Jul 2017 15:26:25 +0000 (17:26 +0200)]
backends: Swap sys/ptrace.h and asm/ptrace.h include order on s390.
glibc 2.26 changed the sys/ptrace.h header so that it cannot be included
after asm/ptrace.h. We still need to include the kernel asm/ptrace.h for
the ptrace_area definition. Including it after sys/ptrace.h works against
both old and new glibc.
Mark Wielaard [Fri, 14 Jul 2017 15:09:40 +0000 (17:09 +0200)]
strip: Add --keep-section=SECTION and --remove-section=SECTION.
Adds two new output options:
--keep-section=SECTION Keep the named section. SECTION is an extended
wildcard pattern. May be given more than once.
--remove-section=SECTION Remove the named section. SECTION is an
extended wildcard pattern. May be given more than
once. Only non-allocated sections can be removed.
The --remove-section was already partially implemented, but only for the
.comment section. The short option -R is to be compatible with binutils.
The new testcase makes sure that various combinations of kept/removed
sections pull the correct dependencies into the output and/or debug files.
Mark Wielaard [Wed, 7 Jun 2017 18:32:38 +0000 (20:32 +0200)]
strip: Don't generate empty output file when nothing to do.
If there was nothing to do strip would skip generating a separate
debug file if one was requested, but it would also not finish the
creation of a new output file (with the non-stripped sections).
Also if there was an error any partially created output would be kept.
Make sure that when the -o output file option is given we always generate
a complete output file (except on error). Also make sure that when the -f
debug file option is given it is only generated when it is not empty.
Add testcase run-strip-nothing.sh that tests the various combinations.
Mark Wielaard [Wed, 7 Jun 2017 12:05:36 +0000 (14:05 +0200)]
strip: Make sure old .shstrab is removed when eu-strip recreates it.
Although we always recreate the .shstrtab section for the new output
file we never explicitly assumed it could be removed. It might not be
possible to remove it when the section string table is shared with
a symbol table. But if it is removable we should (and recreate it for
the new section list).
Regression introduced in commit elfutils-0.163-33-gdf7dfab.
"Handle merged strtab/shstrtab string tables in strip and unstrip."
Add extra testcase to explicitly check for this case.
Mark Wielaard [Sun, 21 May 2017 21:33:15 +0000 (23:33 +0200)]
ppc64: Add minimal fallback unwinder.
This adds a minimal fallback unwinder for ppc64[le] in case we cannot find
CFI for a particular address. It simply always sets the program counter to
the link register, picks the previous stack pointer from the backchain,
and the previous link register from the LR save area.
This is enough for some simple situations when we don't have CFI and
seems to work nicely in the case of perf with libdw powerpc support:
https://lkml.org/lkml/2017/5/18/998
Ulf Hermann [Thu, 20 Apr 2017 14:54:26 +0000 (16:54 +0200)]
Make elf section sorting more deterministic
At least one test (dwfl-addr-sect) depends on the order of elf sections
with equal addresses. This is not guaranteed by the code. Compare also
by end address and section index to tell entries apart.
Signed-off-by: Ulf Hermann <ulf.hermann@qt.io> Signed-off-by: Mark Wielaard <mark@klomp.org>
Ulf Hermann [Thu, 20 Apr 2017 12:41:35 +0000 (14:41 +0200)]
Add frame pointer unwinding for aarch64 and relax backtrace testcases.
If we don't find any debug information for a given frame, we usually
cannot unwind any further. However, the binary in question might have
been compiled with frame pointers, in which case we can look up the
well known frame pointer locations in the stack snapshot and use them
to bridge the frames without debug information.
Relax the backtrace core testcases a little by allowing a duplicate
sigusr2 frame or a backtrace ending with an invalid register. Both of
which can happen if the frame pointer unwinder guesses slightly wrong.
Signed-off-by: Ulf Hermann <ulf.hermann@qt.io> Signed-off-by: Mark Wielaard <mark@klomp.org>
Ulf Hermann [Fri, 10 Feb 2017 14:19:40 +0000 (15:19 +0100)]
Add frame pointer unwinding as fallback on x86_64
If we don't find any debug information for a given frame, we usually
cannot unwind any further. However, the binary in question might have
been compiled with frame pointers, in which case we can look up the
well known frame pointer locations in the stack snapshot and use them
to bridge the frames without debug information.
The "unwind" hook is the right place for this as it is so far only
used on s390 and called only after trying to unwind with debug
information.
Mark Wielaard [Tue, 25 Apr 2017 10:41:58 +0000 (12:41 +0200)]
tests: Add core backtracegen check and regen ppc32 backtrace testfiles.
Add a check to check_core to make sure the backtracegen function is
found in the backtrace. This function is in the middle of the backtrace
in the main executable and if not found it means the backtrace was
incomplete or the frame was skipped (which could happen on a bad frame
pointer only unwind).
This showed that the ppc32 backtrace test files were missing DWARF CFI
for the main executable. Regenerated them to include full CFI.
Allowing no symbol resolving at all makes it too hard to see
whether the test actually tests anything.
But do keep "address out of range" as allowed error in check_err.
This can be interpreted as DWARF not available (if end of callstack
marker is missing, which it unfortunately often is missing even if CFI
is available.).
Ulf Hermann [Thu, 20 Apr 2017 14:31:02 +0000 (16:31 +0200)]
Avoid double-including config.h
config.h doesn't have include guards, so including it twice is bad. We
deal with this by checking for PACKAGE_NAME, but only in some places.
Once we start using gnulib, we will need to include config.h before any
gnulib-generated headers. This is problematic if we include it
transitively through our own private headers.
In order to set a clear rule about inclusion of config.h, it is now
included in every .c file as first header, but not in any header. This
will definitely avoid double-inclusion and satisfy the condition that it
has to be included before gnulib headers. It comes at the price of
adding some redundancy, but there is no clean way to avoid this.
Ulf Hermann [Thu, 20 Apr 2017 13:55:47 +0000 (15:55 +0200)]
Make __attribute__ conditional in all installed headers
__attribute__ is a GNU extension. If we want to link against the
libraries using a different compiler, it needs to be disabled. It was
already disabled in libdw.h, and this patch extends this to the other
headers. We move the defines to libelf.h as that is included in all
the others.
Ulf Hermann [Thu, 27 Apr 2017 14:35:23 +0000 (16:35 +0200)]
Fix nesting of braces
The way it was before it didn't actually test if elf_update failed, but
rather did something random. !!(<some number>) is a boolean and boolean
true can be represented as anything non-0, including negative numbers.
Ulf Hermann [Thu, 20 Apr 2017 14:40:30 +0000 (16:40 +0200)]
Avoid signed/unsigned comparison
Some compilers implicitly cast the result of uint_fast16_t *
uint_fast16_t to something signed and then complain about the
comparison to (unsigned) size_t.
Casting phnum to size_t is a good idea anyway as 16bit multiplication
can easily overflow and we are not checking for this.
Ulf Hermann [Thu, 20 Apr 2017 13:47:49 +0000 (15:47 +0200)]
Avoid YESSTR and NOSTR
Those are deprecated and apparently some implementations of nl_langinfo
return empty strings for them. The tests even tested for those empty
strings even though the intention of the code was clearly to output
"yes" or "no" there.
Mark Wielaard [Wed, 19 Apr 2017 15:07:46 +0000 (17:07 +0200)]
libelf: Initialize n to zero in elf_getarsym.
When building with gcc -Os it seems we can inline read_number_entries
but if that function fails then n will not be initialized. GCC seems not
to realize that in that case n won't be used at all. Explicitly initialize
n to zero to prevent a spurious error: 'n' may be used uninitialized in
this function [-Werror=maybe-uninitialized] in that case.
Mark Wielaard [Thu, 30 Mar 2017 10:19:53 +0000 (12:19 +0200)]
libdw: Fix dwarf_peel_type infinite loop.
We were calling dwarf_attr_integrate () in the die in the loop instead of
on the result. Which would cause an infinite loop when die != result.
Add a testcase that explicitly checks this case.
Mark Wielaard [Mon, 27 Mar 2017 22:38:52 +0000 (00:38 +0200)]
elflint: Don't trust sh_entsize when checking hash sections.
Calculate and use the expected entsize instead of relying on the one
given by the ELF file section header. Return early if there isn't enough
data in the section to check the full hash table.
Mark Wielaard [Mon, 27 Mar 2017 15:01:57 +0000 (17:01 +0200)]
libelf: Always update last_offset in updatefile and updatemmap.
When ELF section data was used, but not updated or marked as dirty and
there also existed non-dirty sections and some padding was needed between
the sections (possibly because of alignment) then elf_update might write
"fill" over some of the existing data. This happened because in that case
the last_position was not updated correctly.
Includes a new testcase fillfile that fails before this patch by showing
fill instead of the expected data in some section data. It succeeds with
this patch.
Mark Wielaard [Fri, 24 Mar 2017 14:06:04 +0000 (15:06 +0100)]
libelf: Check compression ratio before trying to allocate output buffer.
The maximum compression factor (http://www.zlib.net/zlib_tech.html) is
1032:1. Add a sanity check for that before trying to allocate lots of
memory and trying to decompress lots of bogus data.
Mark Wielaard [Fri, 24 Mar 2017 13:10:26 +0000 (14:10 +0100)]
Use the empty string for note names with zero size (without any data).
ELF notes can have a zero sized name. In which case there is no data at
all (so also no zero terminator). Make sure to use the empty string for
such notes if the code does not otherwise explicitly check n_namesz.
Mark Wielaard [Fri, 24 Mar 2017 11:15:02 +0000 (12:15 +0100)]
readelf: Fix off by one sanity check in handle_gnu_hash.
We sanity check to make sure we don't index outside the chain array
by testing inner > max_nsyms. But inner is a zero-based index, while
max_nsyms is the maximum number. Change the check to inner >= max_nsyms.
Mark Wielaard [Sun, 12 Feb 2017 20:51:34 +0000 (21:51 +0100)]
libasm: Fix one GCC7 -Wformat-truncation=2 warning.
Make sure that if we have really lots of labels the tempsym doesn't get
truncated because it is too small to hold the whole name.
This doesn't enable -Wformat-truncation=2 or fix other "issues" pointed
out by enabling this warning because there are currently some issues
with it. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79448
Mark Wielaard [Wed, 15 Feb 2017 13:30:27 +0000 (14:30 +0100)]
backends: Add support for EM_PPC64 GNU_ATTRIBUTES.
ppc64 and ppc64le ELF files can also contain a power specific
.gnu.attributes section. Add support for those and recognize the new
GNU_Power_ABI_FP Single-precision hard float value.
Ulf Hermann [Thu, 16 Feb 2017 11:32:02 +0000 (12:32 +0100)]
Move print_version into printversion.{h|c}
Rename version.c so that the implementation is called after the header
and the header doesn't clash with the toplevel version.h. print_version
depends on argp and is only used in the tools.
Mark Wielaard [Thu, 9 Feb 2017 20:09:54 +0000 (21:09 +0100)]
Add -D_FORTIFY_SOURCE=2 to CFLAGS if possible.
Some distros now add -D_FORTIFY_SOURCE=2 by default and we have missed
some issues in the past caught by it. Add it to CFLAGS if possible.
The configure check will make sure that it doesn't conflict with any
other CFLAGS already defined.
Ulf Hermann [Fri, 10 Feb 2017 14:19:40 +0000 (15:19 +0100)]
Optionally allow unknown symbols in the backtrace tests
This is useful to test unwinding without debug information. The
binaries being examined might still have frame pointers that allow
us to bridge the unknown symbols.
Ulf Hermann [Fri, 10 Feb 2017 14:19:01 +0000 (15:19 +0100)]
Make the backtrace-data test helper more robust
When unwinding by frame pointer the unwinder might ask for invalid
addresses. We don't have to fail the test in this case. In fact
any broken dwarf information can lead to requests for invalid
addresses, also without frame pointer unwinding.
Mark Wielaard [Sat, 24 Dec 2016 21:31:41 +0000 (22:31 +0100)]
http://elfutils.org/ is now hosted at http://sourceware.org/elfutils/
fedorahosted used to be our home, but we are now hosted at sourceware.
Change the elfutils project home to http://elfutils.org/
Point hosted services (email, release, git, bug tracker and web pages)
to https://sourceware.org/elfutils/
Move design notes from README to NOTES.
Add URLs for home, releases, bugs, git and mailinglist to README.
Make the --version output of all tools the same by using a common
print_version function and update the publicly shown copyright holder
to the elfutils developers.
Akihiko Odaki [Tue, 11 Oct 2016 14:12:11 +0000 (23:12 +0900)]
libelf: gelf_newehdr and gelf_newehdr should return void *.
unsigned long int is not always capable to have pointer in some cases
(LLP64, for example). Return a void pointer instead. Other libelf
implementations will also make this change (or already have).
Also update the documentation to state what is created and that NULL
is returned on error (don't document that the returned value is a
pointer to the actual header created).
Signed-off-by: Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp> Signed-off-by: Mark Wielaard <mjw@redhat.com>
Mark Wielaard [Wed, 23 Nov 2016 19:51:35 +0000 (20:51 +0100)]
Only workaround fts.h if we have a bad version that doesn't handle LFS.
Older versions of glibc included an fts implementation that didn't have
Large File System support. We worked around that in linux-kernel-modules.c
by including it early before config.h and then redefining some symbols
to get the 64-bit versions. This is somewhat fragile and not necessary
with newer glibc. If possible we want the 64bit fts version always.
Mark Wielaard [Thu, 10 Nov 2016 17:45:02 +0000 (18:45 +0100)]
ar: Fix GCC7 -Wformat-length issues.
GCC7 adds warnings for snprintf formatting into too small buffers.
Fix the two issues pointed out by the new warning. The ar header
fields are fixed length containing left-justified strings without
zero terminator. snprintf always adds a '\0' char at the end (which
we then don't copy into the ar header field) and numbers are decimal
strings of fixed 10 chars (-Wformat-length thinks formatting
them as size_t might overflow the buffer on 64bit arches).
Mark Wielaard [Fri, 21 Oct 2016 13:24:34 +0000 (15:24 +0200)]
libelf: Sanity check offset and size before trying to malloc and read data.
Bad sh_off or sh_size could trigger a bad malloc or read. Sanity check
the header values first before trying to malloc a huge buffer or reading
any data that will certainly fail.
Mark Wielaard [Wed, 26 Oct 2016 11:08:52 +0000 (13:08 +0200)]
libelf: Always set ELF maxsize when reading an ELF file for sanity checks.
There are various sanity checks that depend on knowing the file size
of the underlying ELF file which we only used when mmapping the ELF file.
Although we probably won't crash if we use pread to try to read from
the file, we still might return completely bogus data structures. This
could cause us to malloc insane amounts of memory.
Always try to get the maxsize when unknown in elf_begin.c (read_file).
Mark Wielaard [Wed, 2 Nov 2016 12:29:26 +0000 (13:29 +0100)]
Add GCC7 -Wimplicit-fallthrough support/fixes.
GCC7 will have a new -Wimplicit-fallthrough warning. It did catch one
small buglet in elflint option procession. So it seems useful to enable
to make sure all swatch case fallthroughs are deliberate.
Add configure check to detect whether gcc support -Wimplicit-fallthrough
and enable it. Add fixes and explicit fallthrough comments where necessary.
Kevin Cernekee [Sun, 23 Oct 2016 17:25:56 +0000 (10:25 -0700)]
tests: unstrip: Add test for mismatched .strtab sections
Current unstrip test cases either have no .symtab/.strtab in the
stripped binary, or .strtab sections that are identical between the
stripped and debuginfo binaries. Add a test case where .symtab/.strtab
in the stripped binary contains a small subset of the full unstripped
data.
Signed-off-by: Kevin Cernekee <cernekee@chromium.org>
Kevin Cernekee [Sun, 23 Oct 2016 17:25:55 +0000 (10:25 -0700)]
unstrip: Don't try to use unstripped .symtab with stripped .strtab
Prematurely matching up the stripped and unstripped .strtab sections
in the "Match each debuginfo" loop can lead to a case where sec->outscn
gets populated for the stripped .strtab, which we normally want to
ignore. This causes the .strtab override in the "Make sure each main
file section" loop to be skipped, so the code winds up using indices
from the unstripped .symtab to look up strings in the stripped .strtab.
This returns incorrect strings for a little while, and then fails
catastrophically when it tries to read past the end of the (smaller)
stripped file's .strtab section:
eu-unstrip: invalid string offset in symbol [1589]
Fix this by adding logic to the "Match each debuginfo" loop to
treat the unstripped .strtab, .shstrtab, and .symtab sections
essentially the same way.
The new logic will break if the .strtab section shows up earlier than
the .symtab section. We will assume this never happens in practice.
Signed-off-by: Kevin Cernekee <cernekee@chromium.org>
Akihiko Odaki [Tue, 11 Oct 2016 14:06:48 +0000 (23:06 +0900)]
lib: Provide MAX and MIN in system.h
This change also creates a new header file libeu.h to provide the
prototypes for the function of libeu. That hides the definition of function
crc32, which can conflict with zlib, from libelf. It also prevents mistakes
to refer those functions from a component which doesn't link with libeu,
such as libelf.
Mark Wielaard [Thu, 6 Oct 2016 14:06:32 +0000 (16:06 +0200)]
strip: Don't remove real symbols from allocated symbol tables.
Having a symbol in an allocated symbol table (like .dynsym) that
points to an unallocated section is wrong. Traditionally strip
has removed such symbols if they are section or group symbols.
But removing a real symbol from an allocate symbol table is hard
and probably a mistake. Really removing it means rewriting the
dynamic segment and hash sections. Since we don't do that, don't
remove the symbol (and corrupt the ELF file). Do warn and set
the symbol section to SHN_UNDEF.
Mark Wielaard [Thu, 25 Aug 2016 15:17:23 +0000 (17:17 +0200)]
tests: Simplify backtrace-native tests. Drop raise jmp patching for x86_64.
The backtrace-native[-biarch] testcase was a little too clever in places
making it unreliable.
On x86_64 we tried to make an interesting backtrace by catching the
first signal and then replacing the pc with the address of the first
instruction of a function. Then we would raise a new signal, through
ptrace, to create a backtrace that went from a signal frame into a
frame at the start of a function. That way we could check that we were
trying to fetch the correct CFI for the (jmp) function even at the
first instruction (normally we would substract one from the return
address to get at the call address).
This works as long as the CFI for the jmp() function is identical to
the CFI for the raise() function that we "patched away". Unfortunately
on Fedora rawhide glibc has a rewritten raise() implementation that has
different CFI, in particular the CFA is calculated differently. Making
the testcase fail because we cannot properly unwind from jmp().
So this special x86_64 case has been disabled (the code is still there
in case we find another way to test this in a more reliable way).
On Ubuntu there have been spurious testcase failures because
see_exec_module found two Dwfl_Modules with the same path. This would
trigger an assert. Although this might indicate some issue (maybe we
are not parsing the proc/pid/map correctly?) it isn't clear that it
really is a bug. Since the assert is not very helpful finding any
actual bug and for the testcase it is only necessary that the first
Dwfl_Module that represents the executable is found we just pick that
Dwfl_Module and don't iterate through any of the others.
Mark Wielaard [Thu, 25 Aug 2016 18:43:42 +0000 (20:43 +0200)]
strip: Use ELF_CHF_FORCE to recompress any sections that were uncompressed.
Older gcc might create small .debug_pubtype. If such a section is compressed
then strip should use ELF_CHF_FORCE to return it to compressed state after it
is done with the section. Found by the run-strip-reloc.sh testcase on rhel6.
Jose E. Marchesi [Wed, 24 Aug 2016 13:47:57 +0000 (06:47 -0700)]
sparc: fix the printing of hw capabilities object attributes.
The GNU_Sparc_HWCAPS and GNU_Sparc_HWCAPS2 object attributes comprise
a set of hardware capabilities that may (or not) be present in the
target machine for which the object was compiled. This patch adds the
support for printing a nicely formatted comma-separated list with the
selected hw capabilities.
Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com>
Mark Wielaard [Fri, 12 Aug 2016 09:36:10 +0000 (11:36 +0200)]
libdwfl: Fix assert and set in.d_size in dwfl_link_map_report.
When reading the phdrs from a core file segment fails we would try to read
them from the exec. This fallback path contained a faulty assert that the
requested size of the phdrs was still setup. But the core file reading
callback might have reset the d_size value to zero on error. So explicitly
set the number of bytes we want to read again instead of asserting the size.
Mark Wielaard [Sun, 7 Aug 2016 20:13:46 +0000 (22:13 +0200)]
libelf: Fix memory leak in elf_compress for mmapped ELF files.
The testcase added to run-strip-reloc.sh for strip-compressed.o showed
a memory leak when ran under valgrind (configure --enable-valgrind).
For a mmapped ELF file when existing section data was compressed
elf_end would fail to release the new compressed data buffer assigned
to rawdata_base. For non-mapped files rawdata_base is always freed.
For decompressed data rawdata_base is released together with zdata_base.
Use the Elf_Scn flag ELF_T_MALLOCED to track whether rawdata_base
points to malloced memory and free it in elf_end even for mmapped
ELF files.
binutils 2.27 assembler will create compressed sections for x86 ELF
targets. The linker will decompress them again and it doesn't do this
for any other target. This broke one of the run-strip-reloc.sh self tests.
Fix by checking if the target of a relocation section is compressed and
first decompressing it before applying relocations and then compressing
again if necessary.
Add explicit testcases for compressed and uncompressed ET_REL files
to run-strip-reloc.sh.
Mark Wielaard [Fri, 8 Jul 2016 12:08:22 +0000 (14:08 +0200)]
dwelf: Add string table functions from ebl.
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.