https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84213

--- Comment #15 from pmderodat at gcc dot gnu.org ---
Author: pmderodat
Date: Fri Feb  9 14:02:37 2018
New Revision: 257526

URL: https://gcc.gnu.org/viewcvs?rev=257526&root=gcc&view=rev
Log:
DWARF: no location for non-definition DECLs with non-trivial DECL_VALUE_EXPR

This patch restricts the set of cases in which we allow the generation of
location attributes for variables that are not defined in the current unit.
For such variables with complex DECL_VALUE_EXPR trees, generating a location
attribute can end up creating relocations to text symbols in the debug section
of LTO object files, which is not valid.

gcc/
        PR lto/84213
        * dwarf2out.c (is_trivial_indirect_ref): New function.
        (dwarf2out_late_global_decl): Do not generate a location
        attribute for variables that have a non-trivial DECL_VALUE_EXPR
        and that are not defined in the current unit.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/dwarf2out.c

Reply via email to