aboutsummaryrefslogtreecommitdiff
path: root/bfd/coffcode.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-09-28 17:57:13 +0000
committerIan Lance Taylor <ian@airs.com>1995-09-28 17:57:13 +0000
commit850985ee6b8e0fee2d2f887ff71e12af0a2cfc57 (patch)
tree79234cbb44e472b2ec9c4cb30c1dbb5c78ddb866 /bfd/coffcode.h
parent46b5a8926d07518b5508247fd1151c7d9924ccb7 (diff)
downloadgdb-850985ee6b8e0fee2d2f887ff71e12af0a2cfc57.zip
gdb-850985ee6b8e0fee2d2f887ff71e12af0a2cfc57.tar.gz
gdb-850985ee6b8e0fee2d2f887ff71e12af0a2cfc57.tar.bz2
* coffcode.h (coff_new_section_hook): Make sure that the alignment
of .ctors and .dtors sections is no larger than 2. PR 8086.
Diffstat (limited to 'bfd/coffcode.h')
-rw-r--r--bfd/coffcode.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index e814d3a..f636c09 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;