This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Sharing one ebl between all dwfl modules?


> Couldn't these ebls be shared in the Dwfl for the Dwfl_Modules? So only
> the first Dwfl_Module that needs it, calls __libdwfl_module_getebl(),
> has to call ebl_openbackend() and then store it in the Dwfl structure?

Yes, this is something I've thought about before.

> Could different Dwfl_Modules from the same Dwfl have different elf
> machine types?

There is nothing else that prevents it, so I'd rather not rule this out.
Still, you only need one pointer for each distinct backend configuration.

> Or does an ebl keep state that cannot be shared?

It has an Elf * used for convenience, but there is no code that actually
stores any other state.  I once had some patches kicking around to
remove the Elf * from struct ebl, which just entails a bunch of
readelf's functions passing another argument to each other and that sort
of thing.  I think that is a worthwhile change to make, but I never
finished it up and talked Uli into it.

With that done, there is nothing to prevent various plans for sharing
Ebl pointers.  To give maximum flexibility for backend code to select
some code or tables based on variants with differing ELF header details,
what might make sense is something like a call to query an Ebl whether
it can apply to a given Elf handle.  Then the libdwfl code could run
through all its open backends looking for one to reuse in each module.


Thanks,
Roland

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]