mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-13 11:58:51 +08:00
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.
This commit is contained in:
@ -1,5 +1,10 @@
|
|||||||
1999-09-06 Donn Terry <donn@interix.com>
|
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.
|
||||||
|
|
||||||
* coffcode.h (coff_set_custom_section_alignment): Add const to
|
* coffcode.h (coff_set_custom_section_alignment): Add const to
|
||||||
declaration to match definition.
|
declaration to match definition.
|
||||||
(coff_write_object_contents): Don't set F_AR32W(R)? if
|
(coff_write_object_contents): Don't set F_AR32W(R)? if
|
||||||
|
@ -1487,38 +1487,36 @@ coff_set_alignment_hook (abfd, section, scnhdr)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef COFF_IMAGE_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)
|
|
||||||
{
|
|
||||||
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)
|
|
||||||
{
|
|
||||||
/* FIXME: Return error. */
|
|
||||||
abort ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
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)
|
|
||||||
{
|
|
||||||
/* FIXME: Return error. */
|
|
||||||
abort ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pei_section_data (abfd, section)->virt_size = hdr->s_paddr;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef COFF_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. 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)
|
||||||
|
{
|
||||||
|
section->used_by_bfd =
|
||||||
|
(PTR) bfd_zalloc (abfd, sizeof (struct coff_section_tdata));
|
||||||
|
if (section->used_by_bfd == NULL)
|
||||||
|
{
|
||||||
|
/* FIXME: Return error. */
|
||||||
|
abort ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
/* FIXME: Return error. */
|
||||||
|
abort ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pei_section_data (abfd, section)->virt_size = hdr->s_paddr;
|
||||||
|
pei_section_data (abfd, section)->pe_flags = hdr->s_flags;
|
||||||
|
|
||||||
section->lma = hdr->s_vaddr;
|
section->lma = hdr->s_vaddr;
|
||||||
#endif
|
#endif /* COFF_WITH_PE */
|
||||||
}
|
}
|
||||||
#undef ALIGN_SET
|
#undef ALIGN_SET
|
||||||
#undef ELIFALIGN_SET
|
#undef ELIFALIGN_SET
|
||||||
|
@ -216,12 +216,14 @@ struct xcoff_section_tdata
|
|||||||
#define xcoff_section_data(abfd, sec) \
|
#define xcoff_section_data(abfd, sec) \
|
||||||
((struct xcoff_section_tdata *) coff_section_data ((abfd), (sec))->tdata)
|
((struct xcoff_section_tdata *) coff_section_data ((abfd), (sec))->tdata)
|
||||||
|
|
||||||
/* Tdata for sections in PEI image files. */
|
/* Tdata for sections in PE files. */
|
||||||
|
|
||||||
struct pei_section_tdata
|
struct pei_section_tdata
|
||||||
{
|
{
|
||||||
/* The virtual size of the section. */
|
/* The virtual size of the section. */
|
||||||
bfd_size_type virt_size;
|
bfd_size_type virt_size;
|
||||||
|
/* The PE section flags. */
|
||||||
|
long pe_flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* An accessor macro for the pei_section_tdata structure. */
|
/* An accessor macro for the pei_section_tdata structure. */
|
||||||
|
@ -216,12 +216,14 @@ struct xcoff_section_tdata
|
|||||||
#define xcoff_section_data(abfd, sec) \
|
#define xcoff_section_data(abfd, sec) \
|
||||||
((struct xcoff_section_tdata *) coff_section_data ((abfd), (sec))->tdata)
|
((struct xcoff_section_tdata *) coff_section_data ((abfd), (sec))->tdata)
|
||||||
|
|
||||||
/* Tdata for sections in PEI image files. */
|
/* Tdata for sections in PE files. */
|
||||||
|
|
||||||
struct pei_section_tdata
|
struct pei_section_tdata
|
||||||
{
|
{
|
||||||
/* The virtual size of the section. */
|
/* The virtual size of the section. */
|
||||||
bfd_size_type virt_size;
|
bfd_size_type virt_size;
|
||||||
|
/* The PE section flags. */
|
||||||
|
long pe_flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* An accessor macro for the pei_section_tdata structure. */
|
/* An accessor macro for the pei_section_tdata structure. */
|
||||||
|
Reference in New Issue
Block a user