On Tue, Jul 20, 2010 at 12:34:03AM +0200, Kai Wang wrote:
> On Tue, Jul 20, 2010 at 12:15:31AM +0200, Joerg Sonnenberger wrote:
> > Hi all,
> > the first time I looked at libelf, it didn't work on NetBSD due to
> > various macros and types missing from NetBSD's elf.h. This has been
> > addressed in the mean time by adding another bunch of #if's. The same
> > applies for FreeBSD. When people want to use libelf on Solaris or Linux,
> > I expect it to grow another set of conditionals.
>
> That's strange. We already have a bunch of #if's for NetBSD. You meant
> we need more to make it compile?
Those have been added in the mean time.
> > This brings me to my question of whether this is really the best
> > approach. Wouldn't it be much easier if libelf provide its own elf.h
> > replacement with predictable content based on the libelf version and
> > nothing else? This would also make it easier to use ELF (and DWARF) as
> > intermediate formats for compiler and other toolchain stuff.
>
> You are right. We've thought about this as well and we're going to create
> our own ELF include files (including arch specific ELF definitions),
> similar with Binutils' include dir, I guess. However some #if's will still
> be necessary.
What conditionals should be needed? The only glaring conditional is for
strlcpy support.
Joerg
|