The assembler only supports 32-bit stabs. So set sh_entsize unconditionally to 12.
authorFangrui Song <maskray@google.com>
Tue, 14 Apr 2020 14:21:50 +0000 (15:21 +0100)
committerNick Clifton <nickc@redhat.com>
Tue, 14 Apr 2020 14:21:50 +0000 (15:21 +0100)
PR gas/25768
* elf.c (assign_section_numbers): Always set .stab sh_entsize to
12.

bfd/ChangeLog
bfd/elf.c

index 0ef3b2faefd37a532d1ecfe98e48b8892fd2e4a3..b89aced0e7e8d1bed9512270528ea8984ed52fbe 100644 (file)
@@ -1,3 +1,9 @@
+2020-04-14  Fangrui Song  <maskray@google.com>
+
+       PR gas/25768
+       * elf.c (assign_section_numbers): Always set .stab sh_entsize to
+       12.
+
 2020-04-14  Stephen Casner  <casner@acm.org>
 
        PR ld/25677
index 1780074f5ab89139b2f1b833c0862e0bb1d0af18..3d2eee9ea8b96122b8888a0f08d30c52495bebc0 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -3998,9 +3998,7 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info)
                  elf_section_data (s)->this_hdr.sh_link = d->this_idx;
 
                  /* This is a .stab section.  */
-                 if (elf_section_data (s)->this_hdr.sh_entsize == 0)
-                   elf_section_data (s)->this_hdr.sh_entsize
-                     = 4 + 2 * bfd_get_arch_size (abfd) / 8;
+                 elf_section_data (s)->this_hdr.sh_entsize = 12;
                }
            }
          break;