Bug 25768

Summary: .stab: sh_size%sh_entsize!=0 for 64-bit architectures
Product: binutils Reporter: Fangrui Song <i>
Component: gasAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: nickc
Priority: P2    
Version: 2.35   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:

Description Fangrui Song 2020-04-03 05:14:12 UTC
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.
Comment 1 Sourceware Commits 2020-04-14 14:22:32 UTC
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.
Comment 2 Nick Clifton 2020-04-14 14:23:09 UTC
Patch applied.