There is quite a bit of code duplication between src/readelf.c and libdw/dwarf_getsrclines.c when parsing header_length, unit_length, etc. Pull the code out into libdwP.h and use it in both of those files. It doesn't save a much code as I'd hoped and I'm not sure about the naming, but here's the patch. Thanks, Timm