[Dwarf-Discuss] .debug_frame and the base address

Eric Christopher echristo@gmail.com
Mon Sep 24 17:40:53 GMT 2018


Dwarf 5, 7.3.1

"A DWARF expression may contain a DW_OP_addr (see Section 2.5.1.1 on 31
page 26) which contains a location within the virtual address space of the
32 program, and require relocation."

On Mon, Sep 24, 2018 at 10:35 AM Robert Harris via Dwarf-Discuss <
dwarf-discuss at lists.dwarfstd.org> wrote:

>
>
> > On 24 Sep 2018, at 16:59, Greg Clayton <clayborg at gmail.com> wrote:
> >
> >
> >
> >> On Sep 24, 2018, at 8:44 AM, Robert Harris <robert.m.harris at oracle.com>
> wrote:
> >>
> >>
> >>
> >>> On 24 Sep 2018, at 15:33, Greg Clayton <clayborg at gmail.com> wrote:
> >>>
> >>>
> >>>
> >>>> On Sep 24, 2018, at 7:15 AM, Robert Harris via Dwarf-Discuss <
> dwarf-discuss at lists.dwarfstd.org> wrote:
> >>>>
> >>>> I'd like some clarification regarding what precisely needs to be
> relocated relative to
> >>>> the object load address when interpreting .debug_frame.  I'm
> interested in versions
> >>>> 2, 3 and 4.
> >>>>
> >>>> I think the only explicit mention of relocation in DWARF 4 is ? 6.4.1:
> >>>>
> >>>>    Abstractly, this mechanism describes a very large table...
> >>>>    ...
> >>>>    The first column indicates an address for every location that
> contains
> >>>>    code in a program. (In shared objects, this is an object-relative
> offset.)
> >>>>
> >>>> Thus adjustments need to be made to only
> >>>>
> >>>>    An FDE's initial_location field
> >>>>    DW_CFA_set_loc's operand
> >>>>
> >>>> Have I missed anything?  I see some ambiguity in the definition of
> >>>> DW_CFA_def_cfa_expression and it's making me wonder if there are any
> >>>> other occasions when a result would require relocation.
> >>>
> >>> Any DWARF expression can contain a DW_OP_addr, which has an address
> argument, and would need to be relocated.
> >>
> >> Do you mean that DW_OP_addr's argument should be relocated in all
> instances
> >> of a DWARF expression, i.e. in other .debug_ sections, or just in the
> context of
> >> .debug_frame?
> >
> > I was specifically talking about DWARF expressions in any .debug_frame
> info.
>
> Well, that would preclude relocating the *result* of any DWARF expression
> in
> .debug_frame.  For some expressions, e.g. DW_CFA_expression, the use
> of the CFA to initialise the stack implies as much but this would be a
> useful
> blanket constraint.
>
>
> > But in general, yes, any DWARF expression that contains a DW_OP_addr
> might need a relocation for its address argument.
>
> Are you aware of where in the standard this is documented?  It sounds
> reasonable
> but I'm returning to this after a long time and I don't remember my way
> around as
> well as I used to.
>
> _______________________________________________
> Dwarf-Discuss mailing list
> Dwarf-Discuss at lists.dwarfstd.org
> http://lists.dwarfstd.org/listinfo.cgi/dwarf-discuss-dwarfstd.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dwarfstd.org/pipermail/dwarf-discuss-dwarfstd.org/attachments/20180924/2f5a6b6f/attachment.html>



More information about the Dwarf-discuss mailing list