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

--- Comment #22 from krux <hoganmeier at gmail dot com> ---
I can also reproduce it without any linker script, simplified code:

int serial3_available() {}
struct HardwareSerial3 {
        int available()     { serial3_available(); }
};
HardwareSerial3 Serial3;

void yield() { serial3_available(); }
int main()
{
        yield();
}

$ g++-9 -c -fno-exceptions -fno-rtti -flto -g -O2 main.cpp
$ g++-9 -o firmware.elf -g -O2 main.o
$ nm -ClS --radix=d --size-sort firmware.elf
0000000000004496 0000000000000001 T __libc_csu_fininm: DWARF error: could not
find abbrev number 8
0000000000016424 0000000000000001 b completed.7374
0000000000008192 0000000000000004 R _IO_stdin_used
0000000000004160 0000000000000043 T _start
0000000000004400 0000000000000093 T __libc_csu_init


But other tools are fine in this case:
$ llvm-dwarfdump-8 --verify firmware.elf
No errors.
$ gdb firmware.elf
Reading symbols from firmware.elf...

Reply via email to