This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: gold patch RFC: fix address size of DW_FORM_ref_addr
- From: Cary Coutant <ccoutant at gmail dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Sun, 19 Nov 2017 18:31:46 -0800
- Subject: Re: gold patch RFC: fix address size of DW_FORM_ref_addr
- Authentication-results: sourceware.org; auth=none
- References: <CAKOQZ8yXwDzus0sex9zs+Nz58TZdKw8VfGEOo8FowqwHDwMsPQ@mail.gmail.com>
> 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