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

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.

        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.


Reply via email to