2000-10-09 Kazu Hirata <kazu@hxi.com>

* ldcref.c: Fix formatting.
	* ldctor.h: Likewise.
	* ldemul.c: Likewise.
	* ldemul.h: Likewise.
	* ldexp.c: Likewise.
	* ldexp.h: Likewise.
	* ldfile.c: Likewise.
	* ldfile.h: Likewise.
	* ld.h: Likewise.
	* ldlang.c: Likewise.
	* ldlang.h: Likewise.
	* ldmain.c: Likewise.
This commit is contained in:
Kazu Hirata
2000-10-09 15:09:17 +00:00
parent 86b1cc60c0
commit 89cdebba13
13 changed files with 117 additions and 152 deletions

View File

@ -1,5 +1,17 @@
2000-10-09 Kazu Hirata <kazu@hxi.com> 2000-10-09 Kazu Hirata <kazu@hxi.com>
* ld.h: Fix formatting.
* ldcref.c: Likewise.
* ldctor.h: Likewise.
* ldemul.c: Likewise.
* ldemul.h: Likewise.
* ldexp.c: Likewise.
* ldexp.h: Likewise.
* ldfile.c: Likewise.
* ldfile.h: Likewise.
* ldlang.c: Likewise.
* ldlang.h: Likewise.
* ldmain.c: Likewise.
* pe-dll.c: Fix formatting. * pe-dll.c: Fix formatting.
2000-10-08 Kazu Hirata <kazu@hxi.com> 2000-10-08 Kazu Hirata <kazu@hxi.com>

21
ld/ld.h
View File

@ -58,25 +58,23 @@
#define DISCARD_SECTION_NAME "/DISCARD/" #define DISCARD_SECTION_NAME "/DISCARD/"
/* A file name list */ /* A file name list */
typedef struct name_list typedef struct name_list {
{
const char *name; const char *name;
struct name_list *next; struct name_list *next;
} name_list; }
name_list;
/* A wildcard specification. This is only used in ldgram.y, but it /* A wildcard specification. This is only used in ldgram.y, but it
winds up in ldgram.h, so we need to define it outside. */ winds up in ldgram.h, so we need to define it outside. */
struct wildcard_spec struct wildcard_spec {
{
const char *name; const char *name;
struct name_list *exclude_name_list; struct name_list *exclude_name_list;
boolean sorted; boolean sorted;
}; };
/* Extra information we hold on sections */ /* Extra information we hold on sections */
typedef struct user_section_struct typedef struct user_section_struct {
{
/* Pointer to the section where this data will go */ /* Pointer to the section where this data will go */
struct lang_input_statement_struct *file; struct lang_input_statement_struct *file;
} section_userdata_type; } section_userdata_type;
@ -96,8 +94,7 @@ typedef struct user_section_struct
#define ALIGN_N(this, boundary) \ #define ALIGN_N(this, boundary) \
((( (this) + ((boundary) -1)) & (~((boundary)-1)))) ((( (this) + ((boundary) -1)) & (~((boundary)-1))))
typedef struct typedef struct {
{
/* 1 => assign space to common symbols even if `relocatable_output'. */ /* 1 => assign space to common symbols even if `relocatable_output'. */
boolean force_common_definition; boolean force_common_definition;
boolean relax; boolean relax;
@ -161,8 +158,7 @@ extern args_type command_line;
typedef int token_code_type; typedef int token_code_type;
typedef struct typedef struct {
{
bfd_size_type specified_data_size; bfd_size_type specified_data_size;
boolean magic_demand_paged; boolean magic_demand_paged;
boolean make_executable; boolean make_executable;
@ -215,8 +211,7 @@ typedef struct
extern ld_config_type config; extern ld_config_type config;
typedef enum typedef enum {
{
lang_first_phase_enum, lang_first_phase_enum,
lang_allocating_phase_enum, lang_allocating_phase_enum,
lang_final_phase_enum lang_final_phase_enum

View File

@ -36,8 +36,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* We keep an instance of this structure for each reference to a /* We keep an instance of this structure for each reference to a
symbol from a given object. */ symbol from a given object. */
struct cref_ref struct cref_ref {
{
/* The next reference. */ /* The next reference. */
struct cref_ref *next; struct cref_ref *next;
/* The object. */ /* The object. */
@ -52,8 +51,7 @@ struct cref_ref
/* We keep a hash table of symbols. Each entry looks like this. */ /* We keep a hash table of symbols. Each entry looks like this. */
struct cref_hash_entry struct cref_hash_entry {
{
struct bfd_hash_entry root; struct bfd_hash_entry root;
/* The demangled name. */ /* The demangled name. */
char *demangled; char *demangled;
@ -63,8 +61,7 @@ struct cref_hash_entry
/* This is what the hash table looks like. */ /* This is what the hash table looks like. */
struct cref_hash_table struct cref_hash_table {
{
struct bfd_hash_table root; struct bfd_hash_table root;
}; };
@ -389,8 +386,7 @@ check_nocrossref (h, ignore)
/* The struct is used to pass information from check_refs to /* The struct is used to pass information from check_refs to
check_reloc_refs through bfd_map_over_sections. */ check_reloc_refs through bfd_map_over_sections. */
struct check_refs_info struct check_refs_info {
{
struct cref_hash_entry *h; struct cref_hash_entry *h;
asection *defsec; asection *defsec;
struct lang_nocrossrefs *ncrs; struct lang_nocrossrefs *ncrs;

View File

@ -31,8 +31,7 @@ extern boolean constructors_sorted;
/* We keep a list of these structures for each set we build. */ /* We keep a list of these structures for each set we build. */
struct set_info struct set_info {
{
struct set_info *next; /* Next set. */ struct set_info *next; /* Next set. */
struct bfd_link_hash_entry *h; /* Hash table entry. */ struct bfd_link_hash_entry *h; /* Hash table entry. */
bfd_reloc_code_real_type reloc; /* Reloc to use for an entry. */ bfd_reloc_code_real_type reloc; /* Reloc to use for an entry. */
@ -40,8 +39,7 @@ struct set_info
struct set_element *elements; /* Elements in set. */ struct set_element *elements; /* Elements in set. */
}; };
struct set_element struct set_element {
{
struct set_element *next; /* Next element. */ struct set_element *next; /* Next element. */
const char *name; /* Name in set (may be NULL). */ const char *name; /* Name in set (may be NULL). */
asection *section; /* Section of value in set. */ asection *section; /* Section of value in set. */

View File

@ -188,7 +188,6 @@ ldemul_default_target ()
void void
after_parse_default () after_parse_default ()
{ {
} }
void void
@ -199,13 +198,11 @@ after_open_default ()
void void
after_allocation_default () after_allocation_default ()
{ {
} }
void void
before_allocation_default () before_allocation_default ()
{ {
} }
void void

View File

@ -54,8 +54,7 @@ extern void hll_default PARAMS ((char*));
extern int ldemul_find_potential_libraries extern int ldemul_find_potential_libraries
PARAMS ((char *, struct lang_input_statement_struct *)); PARAMS ((char *, struct lang_input_statement_struct *));
typedef struct ld_emulation_xfer_struct typedef struct ld_emulation_xfer_struct {
{
/* Run before parsing the command line and script file. /* Run before parsing the command line and script file.
Set the architecture, maybe other things. */ Set the architecture, maybe other things. */
void (*before_parse) PARAMS ((void)); void (*before_parse) PARAMS ((void));
@ -142,8 +141,7 @@ typedef struct ld_emulation_xfer_struct
} ld_emulation_xfer_type; } ld_emulation_xfer_type;
typedef enum typedef enum {
{
intel_ic960_ld_mode_enum, intel_ic960_ld_mode_enum,
default_mode_enum, default_mode_enum,
intel_gld960_ld_mode_enum intel_gld960_ld_mode_enum

View File

@ -66,8 +66,7 @@ static void
exp_print_token (code) exp_print_token (code)
token_code_type code; token_code_type code;
{ {
static CONST struct static CONST struct {
{
token_code_type code; token_code_type code;
char *name; char *name;
} table[] = { } table[] = {

View File

@ -23,15 +23,13 @@
#define LDEXP_H #define LDEXP_H
/* The result of an expression tree */ /* The result of an expression tree */
typedef struct typedef struct {
{
bfd_vma value; bfd_vma value;
struct lang_output_section_statement_struct *section; struct lang_output_section_statement_struct *section;
boolean valid_p; boolean valid_p;
} etree_value_type; } etree_value_type;
typedef struct typedef struct {
{
int node_code; int node_code;
enum { etree_binary, enum { etree_binary,
etree_trinary, etree_trinary,
@ -46,8 +44,7 @@ typedef struct
etree_rel } node_class; etree_rel } node_class;
} node_type; } node_type;
typedef union etree_union typedef union etree_union {
{
node_type type; node_type type;
struct { struct {
node_type type; node_type type;

View File

@ -62,8 +62,7 @@ char *slash = ":";
static search_dirs_type **search_tail_ptr = &search_head; static search_dirs_type **search_tail_ptr = &search_head;
typedef struct search_arch typedef struct search_arch {
{
char *name; char *name;
struct search_arch *next; struct search_arch *next;
} search_arch_type; } search_arch_type;
@ -304,11 +303,11 @@ ldfile_find_command_file (name, extend)
FILE *result; FILE *result;
char buffer[1000]; char buffer[1000];
/* First try raw name */ /* First try raw name. */
result = try_open (name, ""); result = try_open (name, "");
if (result == (FILE *) NULL) if (result == (FILE *) NULL)
{ {
/* Try now prefixes */ /* Try now prefixes. */
for (search = search_head; for (search = search_head;
search != (search_dirs_type *) NULL; search != (search_dirs_type *) NULL;
search = search->next) search = search->next)
@ -426,7 +425,8 @@ ldfile_add_arch (in_name)
} }
#endif #endif
/* Set the output architecture */ /* Set the output architecture. */
void void
ldfile_set_output_arch (string) ldfile_set_output_arch (string)
CONST char *string; CONST char *string;

View File

@ -29,8 +29,7 @@ extern const char *ldfile_output_machine_name;
/* Structure used to hold the list of directories to search for /* Structure used to hold the list of directories to search for
libraries. */ libraries. */
typedef struct search_dirs typedef struct search_dirs {
{
/* Next directory on list. */ /* Next directory on list. */
struct search_dirs *next; struct search_dirs *next;
/* Name of directory. */ /* Name of directory. */

View File

@ -4622,8 +4622,7 @@ static etree_type *overlay_max;
/* A list of all the sections in this overlay. */ /* A list of all the sections in this overlay. */
struct overlay_list struct overlay_list {
{
struct overlay_list *next; struct overlay_list *next;
lang_output_section_statement_type *os; lang_output_section_statement_type *os;
}; };

View File

@ -22,8 +22,7 @@
#ifndef LDLANG_H #ifndef LDLANG_H
#define LDLANG_H #define LDLANG_H
typedef enum typedef enum {
{
lang_input_file_is_l_enum, lang_input_file_is_l_enum,
lang_input_file_is_symbols_only_enum, lang_input_file_is_symbols_only_enum,
lang_input_file_is_marker_enum, lang_input_file_is_marker_enum,
@ -33,14 +32,13 @@ typedef enum
} lang_input_file_enum_type; } lang_input_file_enum_type;
typedef unsigned int fill_type; typedef unsigned int fill_type;
typedef struct statement_list
{ typedef struct statement_list {
union lang_statement_union *head; union lang_statement_union *head;
union lang_statement_union **tail; union lang_statement_union **tail;
} lang_statement_list_type; } lang_statement_list_type;
typedef struct memory_region_struct typedef struct memory_region_struct {
{
char *name; char *name;
struct memory_region_struct *next; struct memory_region_struct *next;
bfd_vma origin; bfd_vma origin;
@ -52,11 +50,9 @@ typedef struct memory_region_struct
boolean had_full_message; boolean had_full_message;
} lang_memory_region_type; } lang_memory_region_type;
typedef struct lang_statement_header_struct typedef struct lang_statement_header_struct {
{
union lang_statement_union *next; union lang_statement_union *next;
enum statement_enum enum statement_enum {
{
lang_output_section_statement_enum, lang_output_section_statement_enum,
lang_assignment_statement_enum, lang_assignment_statement_enum,
lang_input_statement_enum, lang_input_statement_enum,
@ -77,28 +73,24 @@ typedef struct lang_statement_header_struct
} type; } type;
} lang_statement_header_type; } lang_statement_header_type;
typedef struct typedef struct {
{
lang_statement_header_type header; lang_statement_header_type header;
union etree_union *exp; union etree_union *exp;
} lang_assignment_statement_type; } lang_assignment_statement_type;
typedef struct lang_target_statement_struct typedef struct lang_target_statement_struct {
{
lang_statement_header_type header; lang_statement_header_type header;
const char *target; const char *target;
} lang_target_statement_type; } lang_target_statement_type;
typedef struct lang_output_statement_struct typedef struct lang_output_statement_struct {
{
lang_statement_header_type header; lang_statement_header_type header;
const char *name; const char *name;
} lang_output_statement_type; } lang_output_statement_type;
/* Section types specified in a linker script. */ /* Section types specified in a linker script. */
enum section_type enum section_type {
{
normal_section, normal_section,
dsect_section, dsect_section,
copy_section, copy_section,
@ -110,15 +102,13 @@ enum section_type
/* This structure holds a list of program headers describing segments /* This structure holds a list of program headers describing segments
in which this section should be placed. */ in which this section should be placed. */
struct lang_output_section_phdr_list struct lang_output_section_phdr_list {
{
struct lang_output_section_phdr_list *next; struct lang_output_section_phdr_list *next;
const char *name; const char *name;
boolean used; boolean used;
}; };
typedef struct lang_output_section_statement_struct typedef struct lang_output_section_statement_struct {
{
lang_statement_header_type header; lang_statement_header_type header;
union etree_union *addr_tree; union etree_union *addr_tree;
lang_statement_list_type children; lang_statement_list_type children;
@ -144,26 +134,22 @@ typedef struct lang_output_section_statement_struct
struct lang_output_section_phdr_list *phdrs; struct lang_output_section_phdr_list *phdrs;
} lang_output_section_statement_type; } lang_output_section_statement_type;
typedef struct typedef struct {
{
lang_statement_header_type header; lang_statement_header_type header;
} lang_common_statement_type; } lang_common_statement_type;
typedef struct typedef struct {
{
lang_statement_header_type header; lang_statement_header_type header;
} lang_object_symbols_statement_type; } lang_object_symbols_statement_type;
typedef struct typedef struct {
{
lang_statement_header_type header; lang_statement_header_type header;
fill_type fill; fill_type fill;
int size; int size;
asection *output_section; asection *output_section;
} lang_fill_statement_type; } lang_fill_statement_type;
typedef struct typedef struct {
{
lang_statement_header_type header; lang_statement_header_type header;
unsigned int type; unsigned int type;
union etree_union *exp; union etree_union *exp;
@ -174,8 +160,7 @@ typedef struct
/* Generate a reloc in the output file. */ /* Generate a reloc in the output file. */
typedef struct typedef struct {
{
lang_statement_header_type header; lang_statement_header_type header;
/* Reloc to generate. */ /* Reloc to generate. */
@ -205,8 +190,7 @@ typedef struct
bfd_vma output_vma; bfd_vma output_vma;
} lang_reloc_statement_type; } lang_reloc_statement_type;
typedef struct lang_input_statement_struct typedef struct lang_input_statement_struct {
{
lang_statement_header_type header; lang_statement_header_type header;
/* Name of this file. */ /* Name of this file. */
const char *filename; const char *filename;
@ -250,28 +234,27 @@ typedef struct lang_input_statement_struct
boolean loaded; boolean loaded;
/* unsigned int globals_in_this_file;*/ #if 0
unsigned int globals_in_this_file;
#endif
const char *target; const char *target;
boolean real; boolean real;
} lang_input_statement_type; } lang_input_statement_type;
typedef struct typedef struct {
{
lang_statement_header_type header; lang_statement_header_type header;
asection *section; asection *section;
lang_input_statement_type *ifile; lang_input_statement_type *ifile;
} lang_input_section_type; } lang_input_section_type;
typedef struct typedef struct {
{
lang_statement_header_type header; lang_statement_header_type header;
asection *section; asection *section;
union lang_statement_union *file; union lang_statement_union *file;
} lang_afile_asection_pair_statement_type; } lang_afile_asection_pair_statement_type;
typedef struct lang_wild_statement_struct typedef struct lang_wild_statement_struct {
{
lang_statement_header_type header; lang_statement_header_type header;
const char *section_name; const char *section_name;
boolean sections_sorted; boolean sections_sorted;
@ -282,15 +265,13 @@ typedef struct lang_wild_statement_struct
lang_statement_list_type children; lang_statement_list_type children;
} lang_wild_statement_type; } lang_wild_statement_type;
typedef struct lang_address_statement_struct typedef struct lang_address_statement_struct {
{
lang_statement_header_type header; lang_statement_header_type header;
const char *section_name; const char *section_name;
union etree_union *address; union etree_union *address;
} lang_address_statement_type; } lang_address_statement_type;
typedef struct typedef struct {
{
lang_statement_header_type header; lang_statement_header_type header;
bfd_vma output_offset; bfd_vma output_offset;
size_t size; size_t size;
@ -303,14 +284,12 @@ typedef struct
symbols are found. The effect is to search a group of libraries as symbols are found. The effect is to search a group of libraries as
though they were a single library. */ though they were a single library. */
typedef struct typedef struct {
{
lang_statement_header_type header; lang_statement_header_type header;
lang_statement_list_type children; lang_statement_list_type children;
} lang_group_statement_type; } lang_group_statement_type;
typedef union lang_statement_union typedef union lang_statement_union {
{
lang_statement_header_type header; lang_statement_header_type header;
union lang_statement_union *next; union lang_statement_union *next;
lang_wild_statement_type wild_statement; lang_wild_statement_type wild_statement;
@ -334,8 +313,7 @@ typedef union lang_statement_union
/* This structure holds information about a program header, from the /* This structure holds information about a program header, from the
PHDRS command in the linker script. */ PHDRS command in the linker script. */
struct lang_phdr struct lang_phdr {
{
struct lang_phdr *next; struct lang_phdr *next;
const char *name; const char *name;
unsigned long type; unsigned long type;
@ -348,16 +326,14 @@ struct lang_phdr
/* This structure is used to hold a list of sections which may not /* This structure is used to hold a list of sections which may not
cross reference each other. */ cross reference each other. */
struct lang_nocrossref struct lang_nocrossref {
{
struct lang_nocrossref *next; struct lang_nocrossref *next;
const char *name; const char *name;
}; };
/* The list of nocrossref lists. */ /* The list of nocrossref lists. */
struct lang_nocrossrefs struct lang_nocrossrefs {
{
struct lang_nocrossrefs *next; struct lang_nocrossrefs *next;
struct lang_nocrossref *list; struct lang_nocrossref *list;
}; };

View File

@ -1030,8 +1030,7 @@ constructor_callback (info, constructor, name, abfd, section, value)
/* A structure used by warning_callback to pass information through /* A structure used by warning_callback to pass information through
bfd_map_over_sections. */ bfd_map_over_sections. */
struct warning_callback_info struct warning_callback_info {
{
boolean found; boolean found;
const char *warning; const char *warning;
const char *symbol; const char *symbol;