Created attachment 11805 [details] test files $ nm -ClS --radix=d --size-sort firmwareNoError.elf T __libc_csu_fini b completed.7374 T main main.cpp:9 R _IO_stdin_used T _start T __libc_csu_init $ nm -ClS --radix=d --size-sort firmwareAbbrevError.elf T __libc_csu_fininm: DWARF error: could not find abbrev number 7 b completed.7374 R _IO_stdin_used T _start T __libc_csu_init $ nm -ClS --radix=d --size-sort firmwareInfoPtr.elf T __libc_csu_fininm: DWARF error: info pointer extends beyond end of attributes b completed.7374 R _IO_stdin_used T _start T __libc_csu_init
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90441#c25 "I fear this is the libbfd dwarf reader simply not coping with DW_AT_abstract_origin in other CUs, being confused as to which abbrev section it needs to look into (probably using that of the refering CU instead of the referred to one)."
The problem is that the code in dwarf2.c:find_abstract_instance only looks over the chain of CUs already parsed. The one pointed at by DW_FORM_ref_addr hasn't yet been parsed.
The master branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=dfc19da6a6d43390544fa446bb1a33723b339a77 commit dfc19da6a6d43390544fa446bb1a33723b339a77 Author: Alan Modra <amodra@gmail.com> Date: Wed Aug 14 10:51:22 2019 +0930 PR24623, DWARF errors PR 24623 * dwarf2.c (stash_comp_unit): New function, extracted from.. (_bfd_dwarf2_find_nearest_line): ..here. (find_abstract_instance): Parse comp units and decode line info as needed.
Fixed for 2.33, I believe.