[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/23425] unresolved symbol diagnostic ends up calling find_abstrac

From: cvs-commit at gcc dot gnu.org
Subject: [Bug ld/23425] unresolved symbol diagnostic ends up calling find_abstract_instance with relocations applied causing spurious 'DWARF error: invalid abstract instance DIE ref'
Date: Fri, 14 Sep 2018 11:53:55 +0000


--- Comment #13 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot 
gnu.org> ---
The master branch has been updated by Alan Modra <address@hidden>:


commit a4cd947aca23d58966ead843e120f4c19db01030
Author: Alan Modra <address@hidden>
Date:   Tue Sep 11 23:50:15 2018 +0930

    PR23425, unresolved symbol diagnostic

    dwarf2.c code reasonably assumes that debug info is local to a file,
    an assumption now violated by gcc, resulting in "DWARF error: invalid
    abstract instance DIE ref" or wrong details when attempting to print
    linker error messages with file, function and line reported.

    This is because find_abstract_instance is only prepared to handle
    DW_FORM_ref_addr when the .debug_info section referenced is in the
    current file.  When that isn't the case, relocations to access another
    file's .debug_info will typically be against a symbol defined at the
    start of that .debug_info section, plus an addend.  Since the dwarf2.c
    code only considers the current file's debug info, that symbol will be
    undefined, resolving to zero.  In effect the ref_addr will wrongly
    resolve to the current file's .debug_info.

    This patch avoids the problem by treating relocations in debug
    sections against undefined symbols in a similar manner to the way
    relocations against symbols defined in discarded sections are
    resolved.  They result in a zero value (except in .debug_ranges)
    regardless of the addend.

        PR 23425
        * reloc.c (bfd_generic_get_relocated_section_contents): Zero reloc
        fields in debug sections when reloc is against an undefined symbol
        and called from bfd_simple_get_relocated_section_contents or
        * dwarf2.c (find_abstract_instance): Return true for zero offset
        DW_FORM_ref_addr without returning values.

You are receiving this mail because:
You are on the CC list for the bug.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]