From: Ian Lance Taylor Date: Thu, 28 Sep 1995 17:57:13 +0000 (+0000) Subject: * coffcode.h (coff_new_section_hook): Make sure that the alignment X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=850985ee6b8e0fee2d2f887ff71e12af0a2cfc57;p=binutils-gdb.git * coffcode.h (coff_new_section_hook): Make sure that the alignment of .ctors and .dtors sections is no larger than 2. PR 8086. --- diff --git a/bfd/coffcode.h b/bfd/coffcode.h index e814d3a38df..f636c0999f8 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -852,11 +852,13 @@ coff_new_section_hook (abfd, section) /* The .stab section must be aligned to 2**2 at most, because otherwise there may be gaps in the section which gdb will not know how to interpret. Examining the section name is a hack, but - that is also how gdb locates the section. We also align the - .stabstr section this way for backward compatibility, although I - believe it would work anyhow. */ + that is also how gdb locates the section. + We need to handle the .ctors and .dtors sections similarly, to + avoid introducing null words in the tables. */ if (COFF_DEFAULT_SECTION_ALIGNMENT_POWER > 2 - && (strncmp (section->name, ".stab", 5) == 0)) + && (strncmp (section->name, ".stab", 5) == 0 + || strcmp (section->name, ".ctors") == 0 + || strcmp (section->name, ".dtors") == 0)) section->alignment_power = 2; return true;