/* DEF storage definitions. Note that any ordinal may be zero, and
any pointer may be NULL, if not defined by the DEF file. */
-typedef struct def_file_section
- {
- char *name; /* always set */
- char *class; /* may be NULL */
- char flag_read, flag_write, flag_execute, flag_shared;
- }
-def_file_section;
-
-typedef struct def_file_export
- {
- char *name; /* always set */
- char *internal_name; /* always set, may == name */
- int ordinal; /* -1 if not specified */
- int hint;
- char flag_private, flag_constant, flag_noname, flag_data;
- }
-def_file_export;
-
-typedef struct def_file_module
- {
- struct def_file_module *next;
- void *user_data;
- char name[1]; /* extended via malloc */
- }
-def_file_module;
-
-typedef struct def_file_import
- {
- char *internal_name; /* always set */
- def_file_module *module; /* always set */
- char *name; /* may be NULL; either this or ordinal will be set */
- int ordinal; /* may be -1 */
- }
-def_file_import;
-
-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 DESCRIPTION command */
- char *description;
-
- /* from the STACK/HEAP command, -1 if unspecified */
- int stack_reserve, stack_commit;
- int heap_reserve, heap_commit;
-
- /* from the SECTION/SEGMENT commands */
- int num_section_defs;
- def_file_section *section_defs;
-
- /* from the EXPORTS commands */
- int num_exports;
- def_file_export *exports;
-
- /* used by imports for module names */
- def_file_module *modules;
-
- /* from the IMPORTS commands */
- int num_imports;
- def_file_import *imports;
-
- /* from the VERSION command, -1 if not specified */
- int version_major, version_minor;
- }
-def_file;
+typedef struct def_file_section {
+ char *name; /* always set */
+ char *class; /* may be NULL */
+ char flag_read, flag_write, flag_execute, flag_shared;
+} def_file_section;
+
+typedef struct def_file_export {
+ char *name; /* always set */
+ char *internal_name; /* always set, may == name */
+ int ordinal; /* -1 if not specified */
+ int hint;
+ char flag_private, flag_constant, flag_noname, flag_data;
+} def_file_export;
+
+typedef struct def_file_module {
+ struct def_file_module *next;
+ void *user_data;
+ char name[1]; /* extended via malloc */
+} def_file_module;
+
+typedef struct def_file_import {
+ char *internal_name; /* always set */
+ def_file_module *module; /* always set */
+ char *name; /* may be NULL; either this or ordinal will be set */
+ int ordinal; /* may be -1 */
+} def_file_import;
+
+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 DESCRIPTION command */
+ char *description;
+
+ /* from the STACK/HEAP command, -1 if unspecified */
+ int stack_reserve, stack_commit;
+ int heap_reserve, heap_commit;
+
+ /* from the SECTION/SEGMENT commands */
+ int num_section_defs;
+ def_file_section *section_defs;
+
+ /* from the EXPORTS commands */
+ int num_exports;
+ def_file_export *exports;
+
+ /* used by imports for module names */
+ def_file_module *modules;
+
+ /* from the IMPORTS commands */
+ int num_imports;
+ def_file_import *imports;
+
+ /* from the VERSION command, -1 if not specified */
+ int version_major, version_minor;
+} def_file;
extern def_file *def_file_empty PARAMS ((void));
int len));
#ifdef DEF_FILE_PRINT
-extern void def_file_print PARAMS ((FILE * _file,
- def_file * _def));
+extern void def_file_print PARAMS ((FILE * _file, def_file * _def));
#endif
#endif /* DEFFILE_H */
/* The long options. This structure is used for both the option
parsing and the help text. */
-struct ld_option
-{
+struct ld_option {
/* The long option information. */
struct option opt;
/* The short option with the same meaning ('\0' if none). */
/* The documentation string. If this is NULL, this is a synonym for
the previous option. */
const char *doc;
- enum
- {
- /* Use one dash before long option name. */
- ONE_DASH,
- /* Use two dashes before long option name. */
- TWO_DASHES,
- /* Don't mention this option in --help output. */
- NO_HELP
- } control;
+ enum {
+ /* Use one dash before long option name. */
+ ONE_DASH,
+ /* Use two dashes before long option name. */
+ TWO_DASHES,
+ /* Don't mention this option in --help output. */
+ NO_HELP
+ } control;
};
-static const struct ld_option ld_options[] =
-{
+static const struct ld_option ld_options[] = {
{ {NULL, required_argument, NULL, '\0'},
'a', N_("KEYWORD"), N_("Shared library control for HP/UX compatibility"),
ONE_DASH },
optarg);
cplus_demangle_set_style (style);
- }
+ }
break;
case OPTION_DYNAMIC_LINKER:
command_line.interpreter = optarg;
xexit (1);
}
- optarg2 ++;
+ optarg2++;
/* So far so good. Are all the args present? */
if ((*optarg == '\0') || (*optarg2 == '\0'))
lang_leave_group ();
ingroup = 0;
break;
- case OPTION_MPC860C0:
- link_info.mpc860c0 = 20; /* default value (in bytes) */
- if (optarg)
- {
- unsigned words;
+ case OPTION_MPC860C0:
+ link_info.mpc860c0 = 20; /* default value (in bytes) */
+ if (optarg)
+ {
+ unsigned words;
- words = is_num (optarg, 1, 10, 0);
- if (words == 0)
- {
- fprintf (stderr,
+ words = is_num (optarg, 1, 10, 0);
+ if (words == 0)
+ {
+ fprintf (stderr,
_("%s: Invalid argument to option \"mpc860c0\"\n"),
program_name);
- xexit (1);
- }
- link_info.mpc860c0 = words * 4; /* convert words to bytes */
- }
- command_line.relax = true;
- break;
+ xexit (1);
+ }
+ link_info.mpc860c0 = words * 4; /* convert words to bytes */
+ }
+ command_line.relax = true;
+ break;
case OPTION_INIT:
link_info.init_function = optarg;
#include "ldgram.h"
#include "libiberty.h"
-struct section_name_struct
-{
+struct section_name_struct {
struct section_name_struct *next;
CONST char *name;
CONST char *alias;
etree_type *align;
etree_type *subalign;
{
- struct section_name_struct **ptr = lookup (name,list);
+ struct section_name_struct **ptr = lookup (name, list);
(*ptr)->name = name;
(*ptr)->vma = vma;
CONST char *name;
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
mri_only_load (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
/* Attatch the addresses of any which have addresses,
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 *olist;
- if (order == (struct section_name_struct *)NULL)
+ if (order == (struct section_name_struct *) NULL)
order = address;
for (alist = address;
- alist != (struct section_name_struct*)NULL;
+ alist != (struct section_name_struct *) NULL;
alist = alist->next)
{
int done = 0;
for (olist = order;
- done == 0 &&
- olist != (struct section_name_struct *)NULL;
+ done == 0 && olist != (struct section_name_struct *) NULL;
olist = olist->next)
{
if (strcmp (alist->name, olist->name) == 0)
if (!done)
{
/* 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
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 *ptr2;
- if (order == (struct section_name_struct*)NULL)
+ if (order == (struct section_name_struct *) NULL)
order = only_load;
/* See if this name is in the list, if it is then we can load it. */
/* No only load list, so everything is ok to load. */
struct section_name_struct *ptr;
- for (ptr = order; ptr; ptr=ptr->next)
+ for (ptr = order; ptr; ptr = ptr->next)
ptr->ok_to_load = 1;
- }
+ }
/* 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. */
struct section_name_struct *p = order;
etree_type *subalign = 0;
/* 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)
- 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)
- subalign = aptr->subalign;
+ subalign = aptr->subalign;
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,
p->ok_to_load ? 0 : noload_section,
1, align, subalign,
(etree_type *) NULL);
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. */
for (aptr = alias; aptr; aptr = aptr->next)
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
(0, "*default*", (struct lang_output_section_phdr_list *) NULL,
{
base = 0;
lang_add_input_file (name,
- lang_input_file_is_file_enum, (char *)NULL);
+ lang_input_file_is_file_enum, (char *) NULL);
#if 0
- lang_leave_output_section_statement (0,"*default*");
+ lang_leave_output_section_statement (0, "*default*");
#endif
}
mri_order (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
abort ();
}
- mri_add_to_list (& alias, is, 0, want,0,0);
+ mri_add_to_list (&alias, is, 0, want, 0, 0);
}
void
CONST char *name;
etree_type *exp;
{
- mri_add_to_list (& alignment, name, 0, 0, exp, 0);
+ mri_add_to_list (&alignment, name, 0, 0, exp, 0);
}
void
CONST char *name;
etree_type *exp;
{
- mri_add_to_list (& subalignment, name, 0, 0, 0, exp);
+ mri_add_to_list (&subalignment, name, 0, 0, 0, exp);
}
void