]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* ldlang.c: Fix some indentation and comments.
authorIan Lance Taylor <ian@airs.com>
Wed, 27 Mar 1996 17:34:15 +0000 (17:34 +0000)
committerIan Lance Taylor <ian@airs.com>
Wed, 27 Mar 1996 17:34:15 +0000 (17:34 +0000)
ld/ChangeLog
ld/ldlang.c

index 61b91bf50f83cd5877fa4bd4c324fa9bd25bd604..c01cb83b413ba8f66dc92feffa675e732d062776 100644 (file)
@@ -1,3 +1,7 @@
+Wed Mar 27 12:33:24 1996  Ian Lance Taylor  <ian@cygnus.com>
+
+       * ldlang.c: Fix some indentation and comments.
+
 Tue Mar 26 18:14:49 1996  Ian Lance Taylor  <ian@cygnus.com>
 
        * ldmain.c (main): Call bfd_set_error_program_name.
index dc3eaeeab61a794e92507a6c8304f03260e77679..c134d0df0dc077866d36ca33d274e719dbf64053 100644 (file)
@@ -624,68 +624,64 @@ init_os (s)
   get_userdata (s->bfd_section) = (PTR) new;
 
 }
+\f
+/* The wild routines.
 
-/***********************************************************************
-  The wild routines.
+   These expand statements like *(.text) and foo.o to a list of
+   explicit actions, like foo.o(.text), bar.o(.text) and
+   foo.o(.text, .data).  */
 
-  These expand statements like *(.text) and foo.o to a list of
-  explicit actions, like foo.o(.text), bar.o(.text) and
-  foo.o(.text,.data) .
-
-  The toplevel routine, wild, takes a statement, section, file and
-  target. If either the section or file is null it is taken to be the
-  wildcard. Seperate lang_input_section statements are created for
-  each part of the expanstion, and placed after the statement provided.
-
-*/
+/* Add SECTION to the output section OUTPUT.  Do this by creating a
+   lang_input_section statement which is placed at PTR.  FILE is the
+   input file which holds SECTION.  */
 
 void
 wild_doit (ptr, section, output, file)
-     lang_statement_list_type * ptr;
-     asection * section;
-     lang_output_section_statement_type * output;
-     lang_input_statement_type * file;
+     lang_statement_list_type *ptr;
+     asection *section;
+     lang_output_section_statement_type *output;
+     lang_input_statement_type *file;
 {
-  if (output->bfd_section == (asection *) NULL)
+  if (output->bfd_section == NULL)
     init_os (output);
 
-  if (section != (asection *) NULL
-      && section->output_section == (asection *) NULL)
-  {
-    /* Add a section reference to the list */
-    lang_input_section_type *new = new_stat (lang_input_section, ptr);
+  if (section != NULL && section->output_section == NULL)
+    {
+      /* Add a section reference to the list */
+      lang_input_section_type *new = new_stat (lang_input_section, ptr);
 
-    new->section = section;
-    new->ifile = file;
-    section->output_section = output->bfd_section;
+      new->section = section;
+      new->ifile = file;
+      section->output_section = output->bfd_section;
 
-    /* We don't copy the SEC_NEVER_LOAD flag from an input section to
-       an output section, because we want to be able to include a
-       SEC_NEVER_LOAD section in the middle of an otherwise loaded
-       section (I don't know why we want to do this, but we do).
-       build_link_order in ldwrite.c handles this case by turning the
-       embedded SEC_NEVER_LOAD section into a fill.  */
-    section->output_section->flags |=
-      section->flags & (flagword) (~ SEC_NEVER_LOAD);
+      /* We don't copy the SEC_NEVER_LOAD flag from an input section
+        to an output section, because we want to be able to include a
+        SEC_NEVER_LOAD section in the middle of an otherwise loaded
+        section (I don't know why we want to do this, but we do).
+        build_link_order in ldwrite.c handles this case by turning
+        the embedded SEC_NEVER_LOAD section into a fill.  */
+      section->output_section->flags |=
+       section->flags & (flagword) (~ SEC_NEVER_LOAD);
 
-    if (!output->loadable) 
-    {
-      /* Turn off load flag */
-      output->bfd_section->flags &= ~SEC_LOAD;
-      output->bfd_section->flags |= SEC_NEVER_LOAD;
-    }
-    if (section->alignment_power > output->bfd_section->alignment_power)
-    {
-      output->bfd_section->alignment_power = section->alignment_power;
-    }
-    /* If supplied an aligmnet, then force it */
-    if (output->section_alignment != -1)
-    {
-      output->bfd_section->alignment_power = output->section_alignment;
+      if (! output->loadable) 
+       {
+         /* Turn off load flag */
+         output->bfd_section->flags &= ~SEC_LOAD;
+         output->bfd_section->flags |= SEC_NEVER_LOAD;
+       }
+
+      if (section->alignment_power > output->bfd_section->alignment_power)
+       output->bfd_section->alignment_power = section->alignment_power;
+
+      /* If supplied an aligment, then force it */
+      if (output->section_alignment != -1)
+       output->bfd_section->alignment_power = output->section_alignment;
     }
-  }
 }
 
+/* Expand a wild statement for a particular FILE.  SECTION may be
+   NULL, in which case it is a wild card.  */
+
 static void
 wild_section (ptr, section, file, output)
      lang_wild_statement_type *ptr;
@@ -715,16 +711,13 @@ wild_section (ptr, section, file, output)
     }
 }
 
-/* passed a file name (which must have been seen already and added to
-   the statement tree. We will see if it has been opened already and
-   had its symbols read. If not then we'll read it.
+/* This is passed a file name which must have been seen already and
+   added to the statement tree.  We will see if it has been opened
+   already and had its symbols read.  If not then we'll read it.  */
 
-   Archives are pecuilar here. We may open them once, but if they do
-   not define anything we need at the time, they won't have all their
-   symbols read. If we need them later, we'll have to redo it.  */
 static lang_input_statement_type *
 lookup_name (name)
-     CONST char *name;
+     const char *name;
 {
   lang_input_statement_type *search;
 
@@ -792,11 +785,16 @@ load_symbols (entry, place)
               || place == NULL)
        einfo ("%F%B: file not recognized: %E\n", entry->the_bfd);
 
-      /* Try to interpret the file as a linker script.  */
-
       bfd_close (entry->the_bfd);
       entry->the_bfd = NULL;
 
+      /* See if the emulation has some special knowledge.  */
+
+      if (ldemul_unrecognized_file (entry))
+       return;
+
+      /* Try to interpret the file as a linker script.  */
+
       ldfile_open_command_file (entry->filename);
 
       hold = stat_ptr;
@@ -858,13 +856,18 @@ load_symbols (entry, place)
   entry->loaded = true;
 }
 
+/* Handle a wild statement.  SECTION or FILE or both may be NULL,
+   indicating that it is a wildcard.  Separate lang_input_section
+   statements are created for each part of the expansion; they are
+   added after the wild statement S.  OUTPUT is the output section.  */
+
 static void
 wild (s, section, file, target, output)
-     lang_wild_statement_type * s;
-     CONST char *section;
-     CONST char *file;
-     CONST char *target;
-     lang_output_section_statement_type * output;
+     lang_wild_statement_type *s;
+     const char *section;
+     const char *file;
+     const char *target;
+     lang_output_section_statement_type *output;
 {
   lang_input_statement_type *f;
 
@@ -910,23 +913,22 @@ wild (s, section, file, target, output)
            }
        }
     }
+
   if (section != (char *) NULL
       && strcmp (section, "COMMON") == 0
-   && default_common_section == (lang_output_section_statement_type *) NULL)
+      && default_common_section == NULL)
     {
-      /* Remember the section that common is going to incase we later
-         get something which doesn't know where to put it */
+      /* Remember the section that common is going to in case we later
+         get something which doesn't know where to put it */
       default_common_section = output;
     }
 }
 
-/*
-  read in all the files
-  */
+/* Open the output file.  */
 
 static bfd *
 open_output (name)
-     CONST char *name;
+     const char *name;
 {
   bfd *output;