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]

libdw reloc hooks


> But browsing through the source I realized another thing: block forms 
> can contain relocatable data.  What with these?  Shall libdw handle them 
> too?  I suspect it has to, client doesn't know about reloc hooks...

There are two kinds of block forms: DWARF expressions and constant blocks.

For DWARF expressions, just handle them in the expression decoder.  (This
includes .debug_loc blocks as well as DW_FORM_block proper.)  They are only
possible/kosher in operands for certain ops, I think only in DW_OP_addr and
DW_OP_call_ref.  Those cases in the decoder can use the normal hooks.

For constant blocks, don't worry about it for the moment.  We can see if
any relocs in constant blocks actually come up in the test data.  I suspect
that none will.

In the reloc-savvy interfaces, these will be the one special case,
i.e. not just a symbolic address nor a DWARF-internal offset value.
The constant_block () accessors/constructors will have a special form
that explicitly give details of the embedded relocs.  Until we work
that out in its final form, I think we can just punt on this case.

> Done that now.  It's on pmachata/reader_hooks branch, forked off master.

Great!  I'll try to review it soon.

> These "hooks" are currently simple global functions.  When you say 
> "hook", I get the idea of a client- or generally external-party-supplied 
> callback that that external party uses to fine-tune aspects of behaviour 
> of the library in question.

No, that's not what I meant to imply.  All I mean is to have all the libdw
internals go through these few internal functions that we can change later
without touching all over the decoder sources again.  For the "stub hooks"
I had in mind just writing some inlines in libdwP.h so they compile away.
(And that much we can merge into master as soon as we've settled on the
signatures.)  In the final implementation, these will be __libdw_*
internal_function globals defined in libdw/relocate.c or suchlike.


Thanks,
Roland

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