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

* deffile.h: Fix formatting.
	* lexsup.c: Likewise.
	* mri.c: Likewise.
This commit is contained in:
Kazu Hirata
2000-10-11 00:16:07 +00:00
parent c0e219ccea
commit e47d05ade6
4 changed files with 108 additions and 119 deletions

View File

@ -1,3 +1,9 @@
2000-10-10 Kazu Hirata <kazu@hxi.com>
* deffile.h: Fix formatting.
* lexsup.c: Likewise.
* mri.c: Likewise.
2000-10-09 Paul Sokolovsky <Paul.Sokolovsky@technologist.com> 2000-10-09 Paul Sokolovsky <Paul.Sokolovsky@technologist.com>
* pe-dll.c (make_one): Do not generate code thunk for DATA * pe-dll.c (make_one): Do not generate code thunk for DATA

View File

@ -27,75 +27,64 @@
/* DEF storage definitions. Note that any ordinal may be zero, and /* DEF storage definitions. Note that any ordinal may be zero, and
any pointer may be NULL, if not defined by the DEF file. */ any pointer may be NULL, if not defined by the DEF file. */
typedef struct def_file_section typedef struct def_file_section {
{ char *name; /* always set */
char *name; /* always set */ char *class; /* may be NULL */
char *class; /* may be NULL */ char flag_read, flag_write, flag_execute, flag_shared;
char flag_read, flag_write, flag_execute, flag_shared; } def_file_section;
}
def_file_section;
typedef struct def_file_export typedef struct def_file_export {
{ char *name; /* always set */
char *name; /* always set */ char *internal_name; /* always set, may == name */
char *internal_name; /* always set, may == name */ int ordinal; /* -1 if not specified */
int ordinal; /* -1 if not specified */ int hint;
int hint; char flag_private, flag_constant, flag_noname, flag_data;
char flag_private, flag_constant, flag_noname, flag_data; } def_file_export;
}
def_file_export;
typedef struct def_file_module typedef struct def_file_module {
{ struct def_file_module *next;
struct def_file_module *next; void *user_data;
void *user_data; char name[1]; /* extended via malloc */
char name[1]; /* extended via malloc */ } def_file_module;
}
def_file_module;
typedef struct def_file_import typedef struct def_file_import {
{ char *internal_name; /* always set */
char *internal_name; /* always set */ def_file_module *module; /* always set */
def_file_module *module; /* always set */ char *name; /* may be NULL; either this or ordinal will be set */
char *name; /* may be NULL; either this or ordinal will be set */ int ordinal; /* may be -1 */
int ordinal; /* may be -1 */ } def_file_import;
}
def_file_import;
typedef struct def_file typedef struct def_file {
{ /* from the NAME or LIBRARY command */
char *name;
int is_dll; /* -1 if NAME/LIBRARY not given */
bfd_vma base_address; /* (bfd_vma)(-1) if unspecified */
/* from the NAME or LIBRARY command */ /* from the DESCRIPTION command */
char *name; char *description;
int is_dll; /* -1 if NAME/LIBRARY not given */
bfd_vma base_address; /* (bfd_vma)(-1) if unspecified */
/* from the DESCRIPTION command */ /* from the STACK/HEAP command, -1 if unspecified */
char *description; int stack_reserve, stack_commit;
int heap_reserve, heap_commit;
/* from the STACK/HEAP command, -1 if unspecified */ /* from the SECTION/SEGMENT commands */
int stack_reserve, stack_commit; int num_section_defs;
int heap_reserve, heap_commit; def_file_section *section_defs;
/* from the SECTION/SEGMENT commands */ /* from the EXPORTS commands */
int num_section_defs; int num_exports;
def_file_section *section_defs; def_file_export *exports;
/* from the EXPORTS commands */ /* used by imports for module names */
int num_exports; def_file_module *modules;
def_file_export *exports;
/* used by imports for module names */ /* from the IMPORTS commands */
def_file_module *modules; int num_imports;
def_file_import *imports;
/* from the IMPORTS commands */ /* from the VERSION command, -1 if not specified */
int num_imports; int version_major, version_minor;
def_file_import *imports; } def_file;
/* from the VERSION command, -1 if not specified */
int version_major, version_minor;
}
def_file;
extern def_file *def_file_empty PARAMS ((void)); extern def_file *def_file_empty PARAMS ((void));
@ -121,8 +110,7 @@ extern void def_file_add_directive PARAMS ((def_file * _def,
int len)); int len));
#ifdef DEF_FILE_PRINT #ifdef DEF_FILE_PRINT
extern void def_file_print PARAMS ((FILE * _file, extern void def_file_print PARAMS ((FILE * _file, def_file * _def));
def_file * _def));
#endif #endif
#endif /* DEFFILE_H */ #endif /* DEFFILE_H */

View File

@ -130,8 +130,7 @@ int parsing_defsym = 0;
/* The long options. This structure is used for both the option /* The long options. This structure is used for both the option
parsing and the help text. */ parsing and the help text. */
struct ld_option struct ld_option {
{
/* The long option information. */ /* The long option information. */
struct option opt; struct option opt;
/* The short option with the same meaning ('\0' if none). */ /* The short option with the same meaning ('\0' if none). */
@ -141,19 +140,17 @@ struct ld_option
/* The documentation string. If this is NULL, this is a synonym for /* The documentation string. If this is NULL, this is a synonym for
the previous option. */ the previous option. */
const char *doc; const char *doc;
enum enum {
{ /* Use one dash before long option name. */
/* Use one dash before long option name. */ ONE_DASH,
ONE_DASH, /* Use two dashes before long option name. */
/* Use two dashes before long option name. */ TWO_DASHES,
TWO_DASHES, /* Don't mention this option in --help output. */
/* Don't mention this option in --help output. */ NO_HELP
NO_HELP } control;
} control;
}; };
static const struct ld_option ld_options[] = static const struct ld_option ld_options[] = {
{
{ {NULL, required_argument, NULL, '\0'}, { {NULL, required_argument, NULL, '\0'},
'a', N_("KEYWORD"), N_("Shared library control for HP/UX compatibility"), 'a', N_("KEYWORD"), N_("Shared library control for HP/UX compatibility"),
ONE_DASH }, ONE_DASH },
@ -604,7 +601,7 @@ parse_args (argc, argv)
optarg); optarg);
cplus_demangle_set_style (style); cplus_demangle_set_style (style);
} }
break; break;
case OPTION_DYNAMIC_LINKER: case OPTION_DYNAMIC_LINKER:
command_line.interpreter = optarg; command_line.interpreter = optarg;
@ -873,7 +870,7 @@ parse_args (argc, argv)
xexit (1); xexit (1);
} }
optarg2 ++; optarg2++;
/* So far so good. Are all the args present? */ /* So far so good. Are all the args present? */
if ((*optarg == '\0') || (*optarg2 == '\0')) if ((*optarg == '\0') || (*optarg2 == '\0'))
@ -1050,24 +1047,24 @@ the GNU General Public License. This program has absolutely no warranty.\n"));
lang_leave_group (); lang_leave_group ();
ingroup = 0; ingroup = 0;
break; break;
case OPTION_MPC860C0: case OPTION_MPC860C0:
link_info.mpc860c0 = 20; /* default value (in bytes) */ link_info.mpc860c0 = 20; /* default value (in bytes) */
if (optarg) if (optarg)
{ {
unsigned words; unsigned words;
words = is_num (optarg, 1, 10, 0); words = is_num (optarg, 1, 10, 0);
if (words == 0) if (words == 0)
{ {
fprintf (stderr, fprintf (stderr,
_("%s: Invalid argument to option \"mpc860c0\"\n"), _("%s: Invalid argument to option \"mpc860c0\"\n"),
program_name); program_name);
xexit (1); xexit (1);
} }
link_info.mpc860c0 = words * 4; /* convert words to bytes */ link_info.mpc860c0 = words * 4; /* convert words to bytes */
} }
command_line.relax = true; command_line.relax = true;
break; break;
case OPTION_INIT: case OPTION_INIT:
link_info.init_function = optarg; link_info.init_function = optarg;

View File

@ -34,8 +34,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "ldgram.h" #include "ldgram.h"
#include "libiberty.h" #include "libiberty.h"
struct section_name_struct struct section_name_struct {
{
struct section_name_struct *next; struct section_name_struct *next;
CONST char *name; CONST char *name;
CONST char *alias; CONST char *alias;
@ -91,7 +90,7 @@ mri_add_to_list (list, name, vma, zalias, align, subalign)
etree_type *align; etree_type *align;
etree_type *subalign; etree_type *subalign;
{ {
struct section_name_struct **ptr = lookup (name,list); struct section_name_struct **ptr = lookup (name, list);
(*ptr)->name = name; (*ptr)->name = name;
(*ptr)->vma = vma; (*ptr)->vma = vma;
@ -107,7 +106,7 @@ mri_output_section (name, vma)
CONST char *name; CONST char *name;
etree_type *vma; etree_type *vma;
{ {
mri_add_to_list (& address, name, vma, 0,0,0); mri_add_to_list (&address, name, vma, 0, 0, 0);
} }
/* If any ABSOLUTE <name> are in the script, only load those files /* If any ABSOLUTE <name> are in the script, only load those files
@ -117,7 +116,7 @@ void
mri_only_load (name) mri_only_load (name)
CONST char *name; CONST char *name;
{ {
mri_add_to_list (&only_load, name, 0, 0,0,0); mri_add_to_list (&only_load, name, 0, 0, 0, 0);
} }
void void
@ -152,23 +151,22 @@ mri_draw_tree ()
/* Attatch the addresses of any which have addresses, /* Attatch the addresses of any which have addresses,
and add the ones not mentioned. */ and add the ones not mentioned. */
if (address != (struct section_name_struct *)NULL) if (address != (struct section_name_struct *) NULL)
{ {
struct section_name_struct *alist; struct section_name_struct *alist;
struct section_name_struct *olist; struct section_name_struct *olist;
if (order == (struct section_name_struct *)NULL) if (order == (struct section_name_struct *) NULL)
order = address; order = address;
for (alist = address; for (alist = address;
alist != (struct section_name_struct*)NULL; alist != (struct section_name_struct *) NULL;
alist = alist->next) alist = alist->next)
{ {
int done = 0; int done = 0;
for (olist = order; for (olist = order;
done == 0 && done == 0 && olist != (struct section_name_struct *) NULL;
olist != (struct section_name_struct *)NULL;
olist = olist->next) olist = olist->next)
{ {
if (strcmp (alist->name, olist->name) == 0) if (strcmp (alist->name, olist->name) == 0)
@ -181,19 +179,19 @@ mri_draw_tree ()
if (!done) if (!done)
{ {
/* Add this onto end of order list. */ /* Add this onto end of order list. */
mri_add_to_list (& order, alist->name, alist->vma, 0,0,0); mri_add_to_list (&order, alist->name, alist->vma, 0, 0, 0);
} }
} }
} }
/* If we're only supposed to load a subset of them in, then prune /* If we're only supposed to load a subset of them in, then prune
the list. */ the list. */
if (only_load != (struct section_name_struct *)NULL) if (only_load != (struct section_name_struct *) NULL)
{ {
struct section_name_struct *ptr1; struct section_name_struct *ptr1;
struct section_name_struct *ptr2; struct section_name_struct *ptr2;
if (order == (struct section_name_struct*)NULL) if (order == (struct section_name_struct *) NULL)
order = only_load; order = only_load;
/* See if this name is in the list, if it is then we can load it. */ /* See if this name is in the list, if it is then we can load it. */
@ -207,12 +205,12 @@ mri_draw_tree ()
/* No only load list, so everything is ok to load. */ /* No only load list, so everything is ok to load. */
struct section_name_struct *ptr; struct section_name_struct *ptr;
for (ptr = order; ptr; ptr=ptr->next) for (ptr = order; ptr; ptr = ptr->next)
ptr->ok_to_load = 1; ptr->ok_to_load = 1;
} }
/* Create the order of sections to load. */ /* Create the order of sections to load. */
if (order != (struct section_name_struct *)NULL) if (order != (struct section_name_struct *) NULL)
{ {
/* Been told to output the sections in a certain order. */ /* Been told to output the sections in a certain order. */
struct section_name_struct *p = order; struct section_name_struct *p = order;
@ -224,28 +222,28 @@ mri_draw_tree ()
etree_type *subalign = 0; etree_type *subalign = 0;
/* See if an alignment has been specified. */ /* See if an alignment has been specified. */
for (aptr = alignment; aptr; aptr= aptr->next) for (aptr = alignment; aptr; aptr = aptr->next)
if (strcmp (aptr->name, p->name) == 0) if (strcmp (aptr->name, p->name) == 0)
align = aptr->align; align = aptr->align;
for (aptr = subalignment; aptr; aptr= aptr->next) for (aptr = subalignment; aptr; aptr = aptr->next)
if (strcmp (aptr->name, p->name) == 0) if (strcmp (aptr->name, p->name) == 0)
subalign = aptr->subalign; subalign = aptr->subalign;
if (base == 0) if (base == 0)
base = p->vma ? p->vma :exp_nameop (NAME, "."); base = p->vma ? p->vma : exp_nameop (NAME, ".");
lang_enter_output_section_statement (p->name, base, lang_enter_output_section_statement (p->name, base,
p->ok_to_load ? 0 : noload_section, p->ok_to_load ? 0 : noload_section,
1, align, subalign, 1, align, subalign,
(etree_type *) NULL); (etree_type *) NULL);
base = 0; base = 0;
lang_add_wild (p->name, false, (char *)NULL, false, false, NULL); lang_add_wild (p->name, false, (char *) NULL, false, false, NULL);
/* If there is an alias for this section, add it too. */ /* If there is an alias for this section, add it too. */
for (aptr = alias; aptr; aptr = aptr->next) for (aptr = alias; aptr; aptr = aptr->next)
if (strcmp (aptr->alias, p->name) == 0) if (strcmp (aptr->alias, p->name) == 0)
lang_add_wild (aptr->name, false, (char *)NULL, false, false, NULL); lang_add_wild (aptr->name, false, (char *) NULL, false, false, NULL);
lang_leave_output_section_statement lang_leave_output_section_statement
(0, "*default*", (struct lang_output_section_phdr_list *) NULL, (0, "*default*", (struct lang_output_section_phdr_list *) NULL,
@ -264,9 +262,9 @@ mri_load (name)
{ {
base = 0; base = 0;
lang_add_input_file (name, lang_add_input_file (name,
lang_input_file_is_file_enum, (char *)NULL); lang_input_file_is_file_enum, (char *) NULL);
#if 0 #if 0
lang_leave_output_section_statement (0,"*default*"); lang_leave_output_section_statement (0, "*default*");
#endif #endif
} }
@ -274,7 +272,7 @@ void
mri_order (name) mri_order (name)
CONST char *name; CONST char *name;
{ {
mri_add_to_list (& order, name, 0, 0,0,0); mri_add_to_list (&order, name, 0, 0, 0, 0);
} }
void void
@ -296,7 +294,7 @@ mri_alias (want, is, isn)
abort (); abort ();
} }
mri_add_to_list (& alias, is, 0, want,0,0); mri_add_to_list (&alias, is, 0, want, 0, 0);
} }
void void
@ -336,7 +334,7 @@ mri_align (name, exp)
CONST char *name; CONST char *name;
etree_type *exp; etree_type *exp;
{ {
mri_add_to_list (& alignment, name, 0, 0, exp, 0); mri_add_to_list (&alignment, name, 0, 0, exp, 0);
} }
void void
@ -344,7 +342,7 @@ mri_alignmod (name, exp)
CONST char *name; CONST char *name;
etree_type *exp; etree_type *exp;
{ {
mri_add_to_list (& subalignment, name, 0, 0, 0, exp); mri_add_to_list (&subalignment, name, 0, 0, 0, exp);
} }
void void