https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108905
Bug ID: 108905 Summary: Debugging information refers to the wrong file Product: gcc Version: 11.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: lveyde at redhat dot com Target Milestone: --- It seems GCC sometimes injects wrong DWARF information regarding the source file and line. In particular this shows itself in case of some Linux kernel symbols, for example __SCT__x86_pmu_handle_irq. $ /tmp/binutils-gdb/binutils/addr2line -fie vmlinux 0xffffffff81c00290 __SCT__x86_pmu_handle_irq /tmp/linux-5.15.95/./arch/x86/include/asm/paravirt.h:10 In reality this symbol is generated by macro on line 63 of arch/x86/events/core.c source file. Please note: https://sourceware.org/bugzilla/show_bug.cgi?id=30150#c24 and https://sourceware.org/bugzilla/show_bug.cgi?id=30150#c29