aboutsummaryrefslogtreecommitdiff
path: root/bfd/coffcode.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1999-09-07 03:40:32 +0000
committerIan Lance Taylor <ian@airs.com>1999-09-07 03:40:32 +0000
commit8d3ad4e16f2b7ab875747b5363abfa89ce87096c (patch)
tree8ea82632d4ea7ee78342ca37bc11fb99fd0f726e /bfd/coffcode.h
parent25bcc51d8f60fcd875d25877ea5caeaeab49681d (diff)
downloadgdb-8d3ad4e16f2b7ab875747b5363abfa89ce87096c.zip
gdb-8d3ad4e16f2b7ab875747b5363abfa89ce87096c.tar.gz
gdb-8d3ad4e16f2b7ab875747b5363abfa89ce87096c.tar.bz2
1999-09-06 Donn Terry <donn@interix.com>
* libcoff-in.h (struct pei_section_tdata): Add pe_flags field. * coffcode.h (coff_set_alignment_hook): Set pe_flags field if COFF_WITH_PE. * libcoff.h: Rebuild.
Diffstat (limited to 'bfd/coffcode.h')
-rw-r--r--bfd/coffcode.h44
1 files changed, 21 insertions, 23 deletions
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 4b0a39d..1116ee8 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -1487,38 +1487,36 @@ coff_set_alignment_hook (abfd, section, scnhdr)
}
#endif
-#ifdef COFF_IMAGE_WITH_PE
+#ifdef COFF_WITH_PE
/* In a PE image file, the s_paddr field holds the virtual size of a
- section, while the s_size field holds the raw size. */
- if (hdr->s_paddr != 0)
+ section, while the s_size field holds the raw size. We also keep
+ the original section flag value, since not every bit can be
+ mapped onto a generic BFD section bit. */
+ if (coff_section_data (abfd, section) == NULL)
{
- if (coff_section_data (abfd, section) == NULL)
+ section->used_by_bfd =
+ (PTR) bfd_zalloc (abfd, sizeof (struct coff_section_tdata));
+ if (section->used_by_bfd == NULL)
{
- section->used_by_bfd =
- (PTR) bfd_zalloc (abfd, sizeof (struct coff_section_tdata));
- if (section->used_by_bfd == NULL)
- {
- /* FIXME: Return error. */
- abort ();
- }
+ /* FIXME: Return error. */
+ abort ();
}
- if (pei_section_data (abfd, section) == NULL)
+ }
+ if (pei_section_data (abfd, section) == NULL)
+ {
+ coff_section_data (abfd, section)->tdata =
+ (PTR) bfd_zalloc (abfd, sizeof (struct pei_section_tdata));
+ if (coff_section_data (abfd, section)->tdata == NULL)
{
- coff_section_data (abfd, section)->tdata =
- (PTR) bfd_zalloc (abfd, sizeof (struct pei_section_tdata));
- if (coff_section_data (abfd, section)->tdata == NULL)
- {
- /* FIXME: Return error. */
- abort ();
- }
+ /* FIXME: Return error. */
+ abort ();
}
- pei_section_data (abfd, section)->virt_size = hdr->s_paddr;
}
-#endif
+ pei_section_data (abfd, section)->virt_size = hdr->s_paddr;
+ pei_section_data (abfd, section)->pe_flags = hdr->s_flags;
-#ifdef COFF_WITH_PE
section->lma = hdr->s_vaddr;
-#endif
+#endif /* COFF_WITH_PE */
}
#undef ALIGN_SET
#undef ELIFALIGN_SET