sh_entsize(.stab) seems to be wrong since "19990502 sourceware import". https://sourceware.org/pipermail/binutils/2020-April/110529.html can probably fix it. I noticed that #define STRDXOFF (0) #define TYPEOFF (4) #define OTHEROFF (5) #define DESCOFF (6) #define VALOFF (8) #define STABSIZE (12) are duplicated in 4 places. A future clean-up can merge them.
The master branch has been updated by Nick Clifton <nickc@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=34ca55313b8e6c0f6354f2dc5a3a35e38c32ae82 commit 34ca55313b8e6c0f6354f2dc5a3a35e38c32ae82 Author: Fangrui Song <maskray@google.com> Date: Tue Apr 14 15:21:50 2020 +0100 The assembler only supports 32-bit stabs. So set sh_entsize unconditionally to 12. PR gas/25768 * elf.c (assign_section_numbers): Always set .stab sh_entsize to 12.
Patch applied.