More gcc lint.
authorIan Lance Taylor <ian@airs.com>
Sun, 12 Dec 1993 00:54:14 +0000 (00:54 +0000)
committerIan Lance Taylor <ian@airs.com>
Sun, 12 Dec 1993 00:54:14 +0000 (00:54 +0000)
ld/lderror.c
ld/ldindr.c
ld/ldlang.c
ld/ldlex.l
ld/ldmain.c
ld/ldsym.c
ld/relax.c
ld/relax.h

index 83eded5..d8231cd 100644 (file)
@@ -22,11 +22,17 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "../bfd/seclet.h"
 #include "ld.h"
 #include "ldmisc.h"
+#include "lderror.h"
 
 #define MAX_ERRORS_IN_A_ROW 5
 
 extern bfd_error_vector_type bfd_error_vector;
 
+static void ld_undefined_symbol PARAMS ((const arelent *,
+                                        const bfd_seclet_type *));
+static void ld_reloc_truncated PARAMS ((const arelent *,
+                                       bfd_seclet_type *));
+
 /* BFD has failed to link something, give a better error message */
 
 static void
@@ -75,6 +81,7 @@ ld_undefined_symbol (relent, seclet)
     einfo("%Xundefined reference to %s\n", (*(relent->sym_ptr_ptr))->name);
   }
 }
+
 static void
 ld_reloc_truncated (relent, seclet)
      CONST arelent *relent;
index 88152eb..a47a5d8 100644 (file)
@@ -1,4 +1,3 @@
-
 /* ldindr.c
    Handle indirect symbols.
 
@@ -45,6 +44,9 @@
 #include "ldsym.h"
 #include "ldmain.h"
 #include "ldmisc.h"
+#include "ldindr.h"
+
+static asymbol **move_it PARAMS ((asymbol **, asymbol **));
 
 static asymbol **
 move_it (a_list, b_list)
index 6635ca8..f9af727 100644 (file)
@@ -67,6 +67,87 @@ static CONST char *output_target;
 static int longest_section_name = 8;
 static lang_statement_list_type statement_list;
 
+static void print_size PARAMS ((size_t value));
+static void print_alignment PARAMS ((unsigned int value));
+static void print_fill PARAMS ((fill_type value));
+static void print_section PARAMS ((const char *name));
+static void lang_for_each_statement_worker
+  PARAMS ((void (*func) (lang_statement_union_type *),
+          lang_statement_union_type *s));
+static lang_input_statement_type *new_afile
+  PARAMS ((const char *name, lang_input_file_enum_type file_type,
+          const char *target));
+static void print_flags PARAMS ((int *ignore_flags));
+static void init_os PARAMS ((lang_output_section_statement_type *s));
+static void wild_doit PARAMS ((lang_statement_list_type *ptr,
+                              asection *section,
+                              lang_output_section_statement_type *output,
+                              lang_input_statement_type *file));
+static asection *our_bfd_get_section_by_name PARAMS ((bfd *abfd,
+                                                     const char *section));
+static void wild_section PARAMS ((lang_wild_statement_type *ptr,
+                                 const char *section,
+                                 lang_input_statement_type *file,
+                                 lang_output_section_statement_type *output));
+static lang_input_statement_type *lookup_name PARAMS ((const char *name));
+static void wild PARAMS ((lang_wild_statement_type *s,
+                         const char *section, const char *file,
+                         const char *target,
+                         lang_output_section_statement_type *output));
+static bfd *open_output PARAMS ((const char *name));
+static void ldlang_open_output PARAMS ((lang_statement_union_type *statement));
+static void open_input_bfds PARAMS ((lang_statement_union_type *statement));
+static void lang_reasonable_defaults PARAMS ((void));
+static void lang_place_undefineds PARAMS ((void));
+static void lang_create_output_section_statements PARAMS ((void));
+static void lang_init_script_file PARAMS ((void));
+static void map_input_to_output_sections
+  PARAMS ((lang_statement_union_type *s,
+          const char *target,
+          lang_output_section_statement_type *output_section_statement));
+static void print_output_section_statement
+  PARAMS ((lang_output_section_statement_type *output_section_statement));
+static void print_assignment
+  PARAMS ((lang_assignment_statement_type *assignment,
+          lang_output_section_statement_type *output_section));
+static void print_input_statement PARAMS ((lang_input_statement_type *statm));
+static void print_symbol PARAMS ((asymbol *q));
+static void print_input_section PARAMS ((lang_input_section_type *in));
+static void print_fill_statement PARAMS ((lang_fill_statement_type *fill));
+static void print_data_statement PARAMS ((lang_data_statement_type *data));
+static void print_padding_statement PARAMS ((lang_padding_statement_type *s));
+static void print_wild_statement
+  PARAMS ((lang_wild_statement_type *w,
+          lang_output_section_statement_type *os));
+static void print_statement PARAMS ((lang_statement_union_type *s,
+                                    lang_output_section_statement_type *os));
+static void print_statements PARAMS ((void));
+static bfd_vma insert_pad PARAMS ((lang_statement_union_type **this_ptr,
+                                  fill_type fill, unsigned int power,
+                                  asection *output_section_statement,
+                                  bfd_vma dot));
+static bfd_vma size_input_section
+  PARAMS ((lang_statement_union_type **this_ptr,
+          lang_output_section_statement_type *output_section_statement,
+          unsigned short fill, bfd_vma dot, boolean relax));
+static bfd_vma lang_size_sections
+  PARAMS ((lang_statement_union_type *s,
+          lang_output_section_statement_type *output_section_statement,
+          lang_statement_union_type **prev, unsigned short fill,
+          bfd_vma dot, boolean relax));
+static bfd_vma lang_do_assignments
+  PARAMS ((lang_statement_union_type * s,
+          lang_output_section_statement_type *output_section_statement,
+          unsigned short fill,
+          bfd_vma dot));
+static void lang_relocate_globals PARAMS ((void));
+static void lang_finish PARAMS ((void));
+static void lang_check PARAMS ((void));
+static void lang_common PARAMS ((void));
+static void lang_place_orphans PARAMS ((void));
+static int topower PARAMS ((int));
+static void reset_memory_regions PARAMS ((void));
+
 /* EXPORTS */
 boolean relaxing;
 lang_output_section_statement_type *abs_output_section;
@@ -97,37 +178,37 @@ etree_type *base; /* Relocation base - or null */
 
 #define outside_symbol_address(q) ((q)->value +   outside_section_address(q->section))
 
-void lang_add_data PARAMS ((int type, union etree_union * exp));
-
 PTR
 stat_alloc (size)
      size_t size;
 {
   return obstack_alloc (&stat_obstack, size);
 }
+
 static void
 print_size (value)
      size_t value;
 {
   fprintf (config.map_file, "%5x", (unsigned) value);
 }
+
 static void
 print_alignment (value)
      unsigned int value;
 {
   fprintf (config.map_file, "2**%1u", value);
 }
+
 static void
-DEFUN (print_fill, (value),
-     fill_type value)
+print_fill (value)
+     fill_type value;
 {
   fprintf (config.map_file, "%04x", (unsigned) value);
 }
 
-
 static void
 print_section (name)
-     CONST char *CONST name;
+     CONST char *name;
 {
   fprintf (config.map_file, "%*s", -longest_section_name, name);
 }
@@ -139,7 +220,7 @@ print_section (name)
 
 static void
 lang_for_each_statement_worker (func, s)
-     void (*func) ();
+     void (*func) (lang_statement_union_type *);
      lang_statement_union_type *s;
 {
   for (; s != (lang_statement_union_type *) NULL; s = s->next)
@@ -180,7 +261,7 @@ lang_for_each_statement_worker (func, s)
 
 void
 lang_for_each_statement (func)
-     void (*func) ();
+     void (*func) (lang_statement_union_type *);
 {
   lang_for_each_statement_worker (func,
                                  statement_list.head);
@@ -230,9 +311,9 @@ new_statement (type, size, list)
  */
 static lang_input_statement_type *
 new_afile (name, file_type, target)
-     CONST char *CONST name;
-     CONST lang_input_file_enum_type file_type;
-     CONST char *CONST target;
+     CONST char *name;
+     lang_input_file_enum_type file_type;
+     CONST char *target;
 {
 
   lang_input_statement_type *p = new_stat (lang_input_statement,
@@ -615,7 +696,8 @@ wild_doit (ptr, section, output, file)
     if ((section->flags & SEC_SHARED_LIBRARY) != 0)
       section->output_section->flags |= section->flags;
     else
-      section->output_section->flags |= section->flags & ~SEC_NEVER_LOAD;
+      section->output_section->flags |=
+       section->flags & (flagword) (~ SEC_NEVER_LOAD);
 
     if (!output->loadable) 
     {
@@ -687,7 +769,7 @@ wild_section (ptr, section, file, output)
 static
 lang_input_statement_type *
 lookup_name (name)
-     CONST char *CONST name;
+     CONST char *name;
 {
   lang_input_statement_type *search;
 
@@ -722,9 +804,9 @@ lookup_name (name)
 static void
 wild (s, section, file, target, output)
      lang_wild_statement_type * s;
-     CONST char *CONST section;
-     CONST char *CONST file;
-     CONST char *CONST target;
+     CONST char *section;
+     CONST char *file;
+     CONST char *target;
      lang_output_section_statement_type * output;
 {
   lang_input_statement_type *f;
@@ -762,7 +844,7 @@ wild (s, section, file, target, output)
 
 static bfd *
 open_output (name)
-     CONST char *CONST name;
+     CONST char *name;
 {
   bfd *output;
 
@@ -862,9 +944,6 @@ open_input_bfds (statement)
 static void
 lang_reasonable_defaults ()
 {
-
-
-
 #if 0
   lang_output_section_statement_lookup (".text");
   lang_output_section_statement_lookup (".data");
@@ -1046,10 +1125,6 @@ map_input_to_output_sections (s, target, output_section_statement)
     }
 }
 
-
-
-
-
 static void
 print_output_section_statement (output_section_statement)
      lang_output_section_statement_type * output_section_statement;
@@ -1422,12 +1497,12 @@ print_statements ()
 }
 
 static bfd_vma
-DEFUN (insert_pad, (this_ptr, fill, power, output_section_statement, dot),
-     lang_statement_union_type ** this_ptr AND
-     fill_type fill AND
-     unsigned int power AND
-     asection * output_section_statement AND
-     bfd_vma dot)
+insert_pad (this_ptr, fill, power, output_section_statement, dot)
+     lang_statement_union_type ** this_ptr;
+     fill_type fill;
+     unsigned int power;
+     asection * output_section_statement;
+     bfd_vma dot;
 {
   /* Align this section first to the
      input sections requirement, then
@@ -1469,12 +1544,12 @@ DEFUN (insert_pad, (this_ptr, fill, power, output_section_statement, dot),
 
 /* Work out how much this section will move the dot point */
 static bfd_vma
-DEFUN (size_input_section, (this_ptr, output_section_statement, fill, dot, relax),
-     lang_statement_union_type ** this_ptr AND
-     lang_output_section_statement_type * output_section_statement AND
-     unsigned short fill AND
-     bfd_vma dot AND
-     boolean relax)
+size_input_section (this_ptr, output_section_statement, fill, dot, relax)
+     lang_statement_union_type ** this_ptr;
+     lang_output_section_statement_type * output_section_statement;
+     unsigned short fill;
+     bfd_vma dot;
+     boolean relax;
 {
   lang_input_section_type *is = &((*this_ptr)->input_section);
   asection *i = is->section;
@@ -1528,13 +1603,13 @@ DEFUN (size_input_section, (this_ptr, output_section_statement, fill, dot, relax
 static boolean had_relax;
 
 static bfd_vma
-DEFUN (lang_size_sections, (s, output_section_statement, prev, fill, dot, relax),
-     lang_statement_union_type * s AND
-     lang_output_section_statement_type * output_section_statement AND
-     lang_statement_union_type ** prev AND
-     unsigned short fill AND
-     bfd_vma dot AND
-     boolean relax)
+lang_size_sections (s, output_section_statement, prev, fill, dot, relax)
+     lang_statement_union_type * s;
+     lang_output_section_statement_type * output_section_statement;
+     lang_statement_union_type ** prev;
+     unsigned short fill;
+     bfd_vma dot;
+     boolean relax;
 {
   /* Size up the sections from their constituent parts */
   for (; s != (lang_statement_union_type *) NULL; s = s->next)
@@ -1764,13 +1839,12 @@ DEFUN (lang_size_sections, (s, output_section_statement, prev, fill, dot, relax)
 }
 
 static bfd_vma
-DEFUN (lang_do_assignments, (s, output_section_statement, fill, dot),
-     lang_statement_union_type * s AND
-     lang_output_section_statement_type * output_section_statement AND
-     unsigned short fill AND
-     bfd_vma dot)
+lang_do_assignments (s, output_section_statement, fill, dot)
+     lang_statement_union_type * s;
+     lang_output_section_statement_type * output_section_statement;
+     unsigned short fill;
+     bfd_vma dot;
 {
-
   for (; s != (lang_statement_union_type *) NULL; s = s->next)
     {
       switch (s->header.type)
@@ -2273,6 +2347,9 @@ lang_for_each_file (func)
     }
 }
 
+#if 0
+
+/* Not used.  */
 
 void
 lang_for_each_input_section (func)
@@ -2295,7 +2372,7 @@ lang_for_each_input_section (func)
     }
 }
 
-
+#endif
 
 void
 ldlang_add_file (entry)
@@ -2324,7 +2401,7 @@ lang_add_output (name, from_script)
 static lang_output_section_statement_type *current_section;
 
 static int topower(x)
- int x;
    int x;
 {
   unsigned  int i = 1;
   int l;
@@ -2339,14 +2416,14 @@ static int topower(x)
 void
 lang_enter_output_section_statement (output_section_statement_name,
                                     address_exp, flags, block_value,
-                                    align, subalign, base)
+                                    align, subalign, ebase)
      const char *output_section_statement_name;
      etree_type * address_exp;
      int flags;
      bfd_vma block_value;
      etree_type *align;
      etree_type *subalign;
-     etree_type *base;
+     etree_type *ebase;
 {
   lang_output_section_statement_type *os;
 
@@ -2383,7 +2460,7 @@ lang_enter_output_section_statement (output_section_statement_name,
    exp_get_value_int(align, -1,
                     "section alignment", 0));
 
-  os->load_base = base;
+  os->load_base = ebase;
 }
 
 
@@ -2414,10 +2491,10 @@ reset_memory_regions ()
 
 
 asymbol *
-DEFUN (create_symbol, (name, flags, section),
-     CONST char *name AND
-     flagword flags AND
-     asection * section)
+create_symbol (name, flags, section)
+     CONST char *name;
+     flagword flags;
+     asection * section;
 {
   asymbol **def_ptr = (asymbol **) stat_alloc ((bfd_size_type) (sizeof (asymbol **)));
 
index 27be289..82ba046 100644 (file)
@@ -33,13 +33,12 @@ This was written by steve chamberlain
 #include "ldexp.h"
 #include "ldlang.h"
 #include "ldfile.h"
+#include "ldlex.h"
 
 int ldgram_in_defsym;
 
 int hex_mode;
 
-char *buystring();
-
 unsigned int lineno = 1;
 int old;
 
@@ -227,23 +226,23 @@ NOCFILENAMECHAR   [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~]
                        }
 
 <MRI,EXPRESSION>([0-9A-Fa-f])+(H|X|B|O|D) {
-                                  int base ;
+                                  int ibase ;
                                   switch (yytext[yyleng-1]) {
                                    case 'X': 
                                    case 'H':
-                                    base = 16;
+                                    ibase = 16;
                                     break;
                                    case 'O':
-                                    base = 8;
+                                    ibase = 8;
                                     break;
                                    case 'B':
-                                    base = 2;
+                                    ibase = 2;
                                     break;
                                    default:
-                                    base = 10;
+                                    ibase = 10;
                                   }
                                   yylval.integer = bfd_scan_vma (yytext+1, 0,
-                                                                 base);
+                                                                 ibase);
                                   return INT;
                                 }
 <SCRIPT,DEFSYMEXP,MRI,BOTH,EXPRESSION>"$"?"0x"?([0-9A-Fa-f])+(M|K|m|k)? {
index 8d50add..88cda23 100644 (file)
@@ -115,11 +115,28 @@ unsigned int total_files_seen;
 args_type command_line;
 
 ld_config_type config;
+
+static boolean check_for_scripts_dir PARAMS ((char *dir));
+static void read_entry_symbols
+  PARAMS ((bfd *desc, struct lang_input_statement_struct *entry));
+static void enter_file_symbols PARAMS ((lang_input_statement_type *entry));
+static void search_library PARAMS ((struct lang_input_statement_struct *));
+static lang_input_statement_type *decode_library_subfile
+  PARAMS ((struct lang_input_statement_struct *library_entry,
+          bfd *subfile_offset));
+static void linear_library PARAMS ((struct lang_input_statement_struct *));
+static void symdef_library PARAMS ((struct lang_input_statement_struct *));
+static void clear_syms PARAMS ((struct lang_input_statement_struct *entry,
+                               file_ptr offset));
+static boolean subfile_wanted_p
+  PARAMS ((struct lang_input_statement_struct *));
 \f
-void
+extern int main PARAMS ((int, char **));
+
+int
 main (argc, argv)
-     char **argv;
      int argc;
+     char **argv;
 {
   char *emulation;
 
@@ -267,6 +284,7 @@ main (argc, argv)
     }
 
   exit (0);
+  return 0;
 }
 
 /* We need to find any explicitly given emulation in order to initialize the
@@ -409,7 +427,7 @@ set_scripts_dir ()
   free (dir);                  /* Well, we tried.  */
 }
 
-void
+static void
 read_entry_symbols (desc, entry)
      bfd *desc;
      struct lang_input_statement_struct *entry;
@@ -730,15 +748,12 @@ enter_file_symbols (entry)
 
 /* Searching libraries */
 
-struct lang_input_statement_struct *decode_library_subfile ();
-void linear_library (), symdef_library ();
-
 /* Search the library ENTRY, already open on descriptor DESC.
    This means deciding which library members to load,
    making a chain of `struct lang_input_statement_struct' for those members,
    and entering their global symbols in the hash table.  */
 
-void
+static void
 search_library (entry)
      struct lang_input_statement_struct *entry;
 {
@@ -829,7 +844,7 @@ ldmain_open_file_read_symbol (entry)
    SUBFILE_OFFSET is the byte index in the library of this member's header.
    We store the length of the member into *LENGTH_LOC.  */
 
-lang_input_statement_type *
+static lang_input_statement_type *
 decode_library_subfile (library_entry, subfile_offset)
      struct lang_input_statement_struct *library_entry;
      bfd *subfile_offset;
@@ -869,16 +884,15 @@ decode_library_subfile (library_entry, subfile_offset)
   return subentry;
 }
 
-boolean subfile_wanted_p ();
-void
+static void
 clear_syms (entry, offset)
      struct lang_input_statement_struct *entry;
      file_ptr offset;
 {
   carsym *car;
-  unsigned long indx = bfd_get_next_mapent (entry->the_bfd,
-                                           BFD_NO_MORE_SYMBOLS,
-                                           &car);
+  symindex indx = bfd_get_next_mapent (entry->the_bfd,
+                                      BFD_NO_MORE_SYMBOLS,
+                                      &car);
 
   while (indx != BFD_NO_MORE_SYMBOLS)
     {
@@ -893,7 +907,7 @@ clear_syms (entry, offset)
 
 /* Search a library that has a map
  */
-void
+static void
 symdef_library (entry)
      struct lang_input_statement_struct *entry;
 
@@ -907,38 +921,38 @@ symdef_library (entry)
       carsym *exported_library_name;
       bfd *prev_archive_member_bfd = 0;
 
-      int idx = bfd_get_next_mapent (entry->the_bfd,
-                                    BFD_NO_MORE_SYMBOLS,
-                                    &exported_library_name);
+      symindex idx = bfd_get_next_mapent (entry->the_bfd,
+                                         BFD_NO_MORE_SYMBOLS,
+                                         &exported_library_name);
 
       not_finished = false;
 
       while (idx != BFD_NO_MORE_SYMBOLS && undefined_global_sym_count)
        {
-
          if (exported_library_name->name)
            {
-
              ldsym_type *sp = ldsym_get_soft (exported_library_name->name);
 
              /* If we find a symbol that appears to be needed, think carefully
-                about the archive member that the symbol is in.  */
+                about the archive member that the symbol is in.  */
              /* So - if it exists, and is referenced somewhere and is
-                undefined or */
+                undefined or */
              if (sp && sp->srefs_chain && !sp->sdefs_chain)
                {
-                 bfd *archive_member_bfd = bfd_get_elt_at_index (entry->the_bfd, idx);
+                 bfd *archive_member_bfd =
+                   bfd_get_elt_at_index (entry->the_bfd, (int) idx);
                  struct lang_input_statement_struct *archive_member_lang_input_statement_struct;
 
 #ifdef GNU960
-                 if (archive_member_bfd && gnu960_check_format (archive_member_bfd, bfd_object))
+                 if (archive_member_bfd
+                     && gnu960_check_format (archive_member_bfd, bfd_object))
 #else
-                 if (archive_member_bfd && bfd_check_format (archive_member_bfd, bfd_object))
+                 if (archive_member_bfd
+                     && bfd_check_format (archive_member_bfd, bfd_object))
 #endif
                    {
-
                      /* Don't think carefully about any archive member
-                        more than once in a given pass.  */
+                        more than once in a given pass.  */
                      if (prev_archive_member_bfd != archive_member_bfd)
                        {
 
@@ -949,15 +963,17 @@ symdef_library (entry)
                          if (archive_member_bfd->usrdata != (PTR) NULL)
                            {
 
-                             archive_member_lang_input_statement_struct = (lang_input_statement_type *) archive_member_bfd->usrdata;
+                             archive_member_lang_input_statement_struct =
+                               ((lang_input_statement_type *)
+                                archive_member_bfd->usrdata);
                            }
                          else
                            {
-
                              archive_member_lang_input_statement_struct =
-                               decode_library_subfile (entry, archive_member_bfd);
-                             archive_member_bfd->usrdata = (PTR) archive_member_lang_input_statement_struct;
-
+                               decode_library_subfile (entry,
+                                                       archive_member_bfd);
+                             archive_member_bfd->usrdata =
+                               (PTR) archive_member_lang_input_statement_struct;
                            }
 
                          if (archive_member_lang_input_statement_struct == 0)
@@ -968,18 +984,19 @@ symdef_library (entry)
 
                          if (archive_member_lang_input_statement_struct->loaded == false)
                            {
+                             read_entry_symbols (archive_member_bfd,
+                                                 archive_member_lang_input_statement_struct);
 
-                             read_entry_symbols (archive_member_bfd, archive_member_lang_input_statement_struct);
-                             /* Now scan the symbol table and decide whether to load.  */
-
-
-                             if (subfile_wanted_p (archive_member_lang_input_statement_struct) == true)
+                             /* Now scan the symbol table and decide
+                                whether to load.  */
+                             if (subfile_wanted_p (archive_member_lang_input_statement_struct)
+                                 == true)
 
                                {
                                  /* This member is needed; load it.
-                                    Since we are loading something on this pass,
-                                    we must make another pass through the symdef data.  */
-
+                                    Since we are loading something on
+                                    this pass, we must make another
+                                    pass through the symdef data.  */
                                  not_finished = true;
 
                                  enter_file_symbols (archive_member_lang_input_statement_struct);
@@ -993,9 +1010,12 @@ symdef_library (entry)
                                  prev = archive_member_lang_input_statement_struct;
 
 
-                                 /* Clear out this member's symbols from the symdef data
-                                    so that following passes won't waste time on them.  */
-                                 clear_syms (entry, exported_library_name->file_offset);
+                                 /* Clear out this member's symbols
+                                    from the symdef data so that
+                                    following passes won't waste time
+                                    on them.  */
+                                 clear_syms (entry,
+                                             exported_library_name->file_offset);
                                  archive_member_lang_input_statement_struct->loaded = true;
                                }
                            }
@@ -1003,12 +1023,13 @@ symdef_library (entry)
                    }
                }
            }
-         idx = bfd_get_next_mapent (entry->the_bfd, idx, &exported_library_name);
+         idx = bfd_get_next_mapent (entry->the_bfd, idx,
+                                    &exported_library_name);
        }
     }
 }
 
-void
+static void
 linear_library (entry)
      struct lang_input_statement_struct *entry;
 {
@@ -1087,7 +1108,7 @@ linear_library (entry)
     linker ymbol table
     Return nonzero if we ought to load this file */
 
-boolean
+static boolean
 subfile_wanted_p (entry)
      struct lang_input_statement_struct *entry;
 {
index 6b808d7..74f7956 100644 (file)
@@ -81,13 +81,19 @@ unsigned int global_symbol_count;
 #define        TABSIZE 1009
 static ldsym_type *global_symbol_hash_table[TABSIZE];
 
-/* Compute the hash code for symbol name KEY.  */
-static
-#ifdef __GNUC__
-  __inline
+#ifndef __GNUC__
+#define __inline
 #endif
 
-int
+static __inline int hash_string PARAMS ((const char *key));
+static __inline ldsym_type *search PARAMS ((const char *key, int hashval));
+static asymbol **process_keepsyms PARAMS ((asymbol **table, int size));
+static void print_file_stuff PARAMS ((lang_input_statement_type * f));
+static asymbol **write_file_locals PARAMS ((asymbol **output_buffer));
+static asymbol **write_file_globals PARAMS ((asymbol **symbol_table));
+
+/* Compute the hash code for symbol name KEY.  */
+static __inline int
 hash_string (key)
      CONST char *key;
 {
@@ -104,11 +110,7 @@ hash_string (key)
   return k;
 }
 
-static
-#ifdef __GNUC__
-  __inline
-#endif
-  ldsym_type *
+static __inline ldsym_type *
 search (key, hashval)
      CONST char *key;
      int hashval;
index 9aced76..c8f67af 100644 (file)
@@ -39,6 +39,9 @@ Tie together all the interseting blocks
 #include "ldsym.h"
 #include "ldgram.h"
 #include "relax.h"
+
+static void build_it PARAMS ((lang_statement_union_type *));
+
 static void
 build_it (statement)
      lang_statement_union_type * statement;
@@ -57,9 +60,9 @@ build_it (statement)
             i += SHORT_SIZE)
          {
            bfd_set_section_contents (output_bfd,
-                                  statement->fill_statement.output_section,
+                                     statement->fill_statement.output_section,
                                      play_area,
-                               statement->data_statement.output_offset + i,
+                                     statement->data_statement.output_offset + i,
                                      SHORT_SIZE);
 
          }
@@ -68,9 +71,9 @@ build_it (statement)
        if (i < statement->fill_statement.size)
          {
            bfd_set_section_contents (output_bfd,
-                                  statement->fill_statement.output_section,
+                                     statement->fill_statement.output_section,
                                      play_area,
-                               statement->data_statement.output_offset + i,
+                                     statement->data_statement.output_offset + i,
                                      1);
 
          }
@@ -80,9 +83,7 @@ build_it (statement)
       break;
 #endif
     case lang_data_statement_enum:
-
       {
-
        bfd_vma value = statement->data_statement.value;
        bfd_byte play_area[LONG_SIZE];
        unsigned int size = 0;
@@ -106,18 +107,16 @@ build_it (statement)
        bfd_set_section_contents (output_section->owner,
                                  statement->data_statement.output_section,
                                  play_area,
-                                 statement->data_statement.output_vma,
+                                 ((file_ptr)
+                                  statement->data_statement.output_vma),
                                  size);
-
-
-
       }
 
       break;
     case lang_input_section_enum:
       {
        /* Create a new seclet in the output section with this
-       attached */
+          attached */
        if (statement->input_section.ifile->just_syms_flag == false)
          {
            asection *i = statement->input_section.section;
@@ -129,7 +128,7 @@ build_it (statement)
            if (i->flags & SEC_NEVER_LOAD)
              {
                /* We've got a never load section inside one which is going
-             to be output, we'll change it into a fill seclet */
+                  to be output, we'll change it into a fill seclet */
                seclet->type = bfd_fill_seclet;
                seclet->u.fill.value = 0;
              }
@@ -151,11 +150,11 @@ build_it (statement)
       /* Make a new seclet with the right filler */
       {
        /* Create a new seclet in the output section with this
-       attached */
+          attached */
 
        bfd_seclet_type *seclet =
-       bfd_new_seclet (statement->padding_statement.output_section->owner,
-                       statement->padding_statement.output_section);
+         bfd_new_seclet (statement->padding_statement.output_section->owner,
+                         statement->padding_statement.output_section);
 
        seclet->type = bfd_fill_seclet;
        seclet->size = statement->padding_statement.size;
@@ -165,20 +164,12 @@ build_it (statement)
       }
       break;
 
-
-
-      break;
     default:
       /* All the other ones fall through */
       ;
-
     }
-
-
-
 }
 
-
 void
 write_relax (output_bfd, data, relocateable)
      bfd * output_bfd;
index 3d1221d..de729d8 100644 (file)
@@ -16,5 +16,5 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
-void write_relax PARAMS ((bfd *output_bfd, PTR data, boolean relocateable));
+void write_relax PARAMS ((bfd *, PTR data, boolean relocateable));
 boolean relax_section PARAMS ((lang_statement_union_type **this_ptr));