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.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
diff --git a/libasm/symbolhash.c b/libasm/symbolhash.c
index 1c95418..57c9e76 100644
--- a/libasm/symbolhash.c
+++ b/libasm/symbolhash.c
@@ -1,5 +1,5 @@
 /* Symbol hash table implementation.
-   Copyright (C) 2001, 2002 Red Hat, Inc.
+   Copyright (C) 2001, 2002, 2016 Red Hat, Inc.
    This file is part of elfutils.
    Written by Ulrich Drepper <drepper@redhat.com>, 2001.
 
@@ -42,7 +42,7 @@
 #define ITERATE 1
 #define REVERSE 1
 #define COMPARE(a, b) \
-  strcmp (ebl_string ((a)->strent), ebl_string ((b)->strent))
+  strcmp (dwelf_strent_str ((a)->strent), dwelf_strent_str ((b)->strent))
 
 #define next_prime __libasm_next_prime
 extern size_t next_prime (size_t) attribute_hidden;