* coffcode.h (coff_new_section_hook): Make sure that the alignment
authorIan Lance Taylor <ian@airs.com>
Thu, 28 Sep 1995 17:57:13 +0000 (17:57 +0000)
committerIan Lance Taylor <ian@airs.com>
Thu, 28 Sep 1995 17:57:13 +0000 (17:57 +0000)
        of .ctors and .dtors sections is no larger than 2.
PR 8086.

bfd/coffcode.h

index e814d3a38df5a1b8b234cddaea88e6ae1650dad9..f636c0999f8ce1baf970c3381e518c17a5d493c4 100644 (file)
@@ -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;
This page took 0.028151 seconds and 4 git commands to generate.