libdwelf: New DWARF ELF Low-level Functions. Add dwelf_elf_gnu_debuglink.

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>
dwarf_elf_begin: Add .gnu_debugaltlink to the sectiondata array

And use it if DWZ mode is enabled.

Signed-off-by: Florian Weimer <fweimer@redhat.com>
libdw: Add dwarf_getalt, dwarf_setalt

Signed-off-by: Florian Weimer <fweimer@redhat.com>
libdwelf: Add dwelf_dwarf_gnu_debugaltlink

Signed-off-by: Florian Weimer <fweimer@redhat.com>
tests/allfcts.c: Install alternate debug information

This change also adds more error checking and reporting.

Signed-off-by: Florian Weimer <fweimer@redhat.com>
Move .gnu_debugaltlink handling from libdw to libdwfl

Also use dwelf_dwarf_gnu_debugaltlink to locate the alternate debugging
information.

Signed-off-by: Florian Weimer <fweimer@redhat.com>
libdwelf: Add dwelf_elf_gnu_build_id.

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>
libdwfl: Move dwz alt multi file searching to find_debuginfo callback.

Don't hard code the Dwarf dwz alt multi file search but allow the user
to override it through the standard Dwfl_Callbacks. Also move ownership
completely to the user of dwarf_setalt by removing free_alt from Dwarf
and adding alt, fd and elf fields to Dwfl_Module. Add a relative .dwz
file test case.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
Remove --enable-dwz. dwz alt debug is no longer experimental.

Signed-off-by: Mark Wielaard <mjw@redhat.com>