[PATCH v2 1/3] libdw: Add dwarf_debugaltlink function

Mark Wielaard mjw at redhat.com
Fri Apr 11 09:36:18 UTC 2014


On Thu, 2014-04-10 at 20:41 +0200, Florian Weimer wrote:
> On 04/10/2014 08:29 PM, Mark Wielaard wrote:
> >> We could add them at the ELF layer, but then we'd have to iterate over
> >> all the ELF section headers in each of these functions.  The section
> >> header array in libdw avoids this.  I'm also not sure where to put such
> >> convenience functions.
> >
> > Yeah, I might be designing things. You are right having it in libdw and
                     ^ over-
> > using the debug section array is the right thing to use. I am mostly
> > concerned about the naming because I think this functionality is at a
> > different level than the rest.
> 
> So what about dwarf_elf_debugaltlink or even dwarf_elf_gnu_debugaltlink 
> as a name?  This shows the relationship to the underlying ELF data.

I like it. Maybe we could shorten it to dwelf_gnu_debugaltlink.

And then (if I am over-designing anyway) have a separate header file
libdwelf.h which is like libdwfl.h. But instead of having Dwarf Frontend
Library calls with dwfl_..., it would have Dwarf Elf Library Function
calls with dwelf_... Like the libdwfl.h functions they would be part of
libdw.so, but the user would know these are for different, low-level,
Elf-based Dwarf functionality. It would be good to have an explicit
place to put these low-level helper functions, it has come up before and
neither libelf nor libebl is really the right place for them. libdw
would be and with a separate header it would be clear the are
"different"/low-level.

I'll see if I can setup the build-infrastructure to add the new
libdwelf.h header, get it installed properly and make any functions
added part of libdw.so.

Cheers,

Mark



More information about the elfutils-devel mailing list