From bd004e1a7ab09eff31b8802ea10e1e62213bb704 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 9 Aug 1999 02:56:16 +0000 Subject: 1999-08-08 Mark Elbrecht * libcoff-in.h (struct coff_section_alignment_entry): Define. * coffcode.h (coff_set_custom_section_alignment): New static function. (coff_section_alignment_table): New static array. (coff_new_section_hook): Use coff_set_customer_section_alignment. * coff-go32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define. * coff-stgo32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define. * libcoff.h: Rebuild. --- bfd/libcoff-in.h | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'bfd/libcoff-in.h') diff --git a/bfd/libcoff-in.h b/bfd/libcoff-in.h index dae881f288..a0362ca9f1 100644 --- a/bfd/libcoff-in.h +++ b/bfd/libcoff-in.h @@ -1,5 +1,5 @@ /* BFD COFF object file private structure. - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998 + Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. Written by Cygnus Support. @@ -467,6 +467,41 @@ struct coff_final_link_info struct internal_reloc *internal_relocs; }; +/* Most COFF variants have no way to record the alignment of a + section. This struct is used to set a specific alignment based on + the name of the section. */ + +struct coff_section_alignment_entry +{ + /* The section name. */ + const char *name; + + /* This is either (unsigned int) -1, indicating that the section + name must match exactly, or it is the number of letters which + must match at the start of the name. */ + unsigned int comparison_length; + + /* These macros may be used to fill in the first two fields in a + structure initialization. */ +#define COFF_SECTION_NAME_EXACT_MATCH(name) (name), ((unsigned int) -1) +#define COFF_SECTION_NAME_PARTIAL_MATCH(name) (name), (sizeof (name) - 1) + + /* Only use this entry if the default section alignment for this + target is at least that much (as a power of two). If this field + is COFF_ALIGNMENT_FIELD_EMPTY, it should be ignored. */ + unsigned int default_alignment_min; + + /* Only use this entry if the default section alignment for this + target is no greater than this (as a power of two). If this + field is COFF_ALIGNMENT_FIELD_EMPTY, it should be ignored. */ + unsigned int default_alignment_max; + +#define COFF_ALIGNMENT_FIELD_EMPTY ((unsigned int) -1) + + /* The desired alignment for this section (as a power of two). */ + unsigned int alignment_power; +}; + extern struct bfd_hash_entry *_bfd_coff_link_hash_newfunc PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); extern boolean _bfd_coff_link_hash_table_init -- cgit v1.2.1