gold patch RFC: fix address size of DW_FORM_ref_addr

Cary Coutant ccoutant@gmail.com
Mon Nov 20 02:31:00 GMT 2017


> I'm not sure if there is a reasonable way to test this.  GCC never
> seems to generate DW_FORM_ref_addr anyhow; it uses DW_FORM_ref4.  I
> ran across this using the Go compiler, which does DW_FORM_ref_addr
> although it should probably also use DW_FORM_ref4.

DW_FORM_ref[1248] and DW_FORM_ref_addr aren't interchangeable. The
former ones use a constant offset relative to the beginning of the
current CU, determined by the compiler, while the latter uses an
offset relative to the beginning of the output .debug_info section,
computed via relocation to an external symbol. DW_FORM_ref_addr is
meant for references between CUs, which doesn't normally happen, but I
think GCC can be coaxed into to doing that through some special
options (not sure offhand which) -- some of the newer early debug work
for LTO might be using it, too.

-cary



More information about the Binutils mailing list