[PATCH v2] Set the sh_entsize field of .stab to 12
Fangrui Song
maskray@google.com
Fri Apr 3 06:03:47 GMT 2020
The existing code assumes sh_entsize(.stab)=20 on ELFCLASS64.
However, the assembler only supports 32-bit stabs. So set sh_entsize unconditionally to 12.
PR gas/25768
* elf.c (assign_section_numbers): Set .stab sh_entsize to 12.
---
bfd/ChangeLog | 5 +++++
bfd/elf.c | 4 +---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 64c3dde475..47b8e566ef 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2020-04-02 Fangrui Song <maskray@google.com>
+
+ PR gas/25768
+ * elf.c (assign_section_numbers): Set .stab sh_entsize to 12.
+
2020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
* bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
diff --git a/bfd/elf.c b/bfd/elf.c
index 86dadea05c..0c550bdadf 100644
--- 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;
--
2.26.0.292.g33ef6b2f38-goog
More information about the Binutils
mailing list