]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* ar.c (mri_mode): Make static.
authorBen Elliston <bje@au.ibm.com>
Fri, 29 Apr 2005 00:03:33 +0000 (00:03 +0000)
committerBen Elliston <bje@au.ibm.com>
Fri, 29 Apr 2005 00:03:33 +0000 (00:03 +0000)
* arsup.c (obfd, real_name, outfile): Likewise.
* binemul.c (ar_emul_create): Remove unused function.
(ar_emul_default_create): Likewise.
* binemul.h (ar_emul_create): Remove declaration.
(ar_emul_default_create): Likewise.
(struct bin_emulation_xfer_struct): Remove ar_create member.
* bucomm.c (report): Make static.
* bucomm.h (report): Remove declaration.
* cxxfilt.c (mbuffer): Make static.
(main): Use unsigned ints for some loop control variables.
* readelf.c: Make many global variables static.
* size.c (berkeley_format): Make static.
(long_options): Likewise.
* emul_aix.c (bin_aix_emulation): Remove ar_emul_default_create
structure initialiser.
(bin_aix5_emulation): Likewise.
* emul_vanilla.c (bin_vanilla_emulation): Likewise.

12 files changed:
binutils/ChangeLog
binutils/ar.c
binutils/arsup.c
binutils/binemul.c
binutils/binemul.h
binutils/bucomm.c
binutils/bucomm.h
binutils/cxxfilt.c
binutils/emul_aix.c
binutils/emul_vanilla.c
binutils/readelf.c
binutils/size.c

index c549addf2daf2f4aa63453e7fb391e7aa7c22e98..b3e93fcdca931510b05f247a91ac0afe3ce21aa4 100644 (file)
@@ -1,3 +1,24 @@
+2005-04-29  Ben Elliston  <bje@au.ibm.com>
+
+       * ar.c (mri_mode): Make static.
+       * arsup.c (obfd, real_name, outfile): Likewise.
+       * binemul.c (ar_emul_create): Remove unused function.
+       (ar_emul_default_create): Likewise.
+       * binemul.h (ar_emul_create): Remove declaration.
+       (ar_emul_default_create): Likewise.
+       (struct bin_emulation_xfer_struct): Remove ar_create member.
+       * bucomm.c (report): Make static.
+       * bucomm.h (report): Remove declaration.
+       * cxxfilt.c (mbuffer): Make static.
+       (main): Use unsigned ints for some loop control variables.
+       * readelf.c: Make many global variables static.
+       * size.c (berkeley_format): Make static.
+       (long_options): Likewise.
+       * emul_aix.c (bin_aix_emulation): Remove ar_emul_default_create
+       structure initialiser.
+       (bin_aix5_emulation): Likewise.
+       * emul_vanilla.c (bin_vanilla_emulation): Likewise.
+
 2005-04-27  Ben Elliston  <bje@au.ibm.com>
 
        * syslex.l: Adjust top-of-file comment: this file is part of GNU
index 7b0ff080a29eae59eb7ed84b456d7a76accb99c6..483be1038d595ab76fd14cbf4544afd3f2f634dc 100644 (file)
@@ -76,7 +76,7 @@ static void usage (int);
 \f
 /** Globals and flags */
 
-int mri_mode;
+static int mri_mode;
 
 /* This flag distinguishes between ar and ranlib:
    1 means this is 'ranlib'; 0 means this is 'ar'.
index a932b32f774eb2dda03c0641518c233a68ed6d4e..f94ebb9b852667f392822eb21cb24aeafdd5052b 100644 (file)
@@ -38,6 +38,10 @@ static void ar_addlib_doer (bfd *, bfd *);
 
 extern int verbose;
 
+static bfd *obfd;
+static char *real_name;
+static FILE *outfile;
+
 static void
 map_over_list (bfd *arch, void (*function) (bfd *, bfd *), struct list *list)
 {
@@ -86,7 +90,6 @@ map_over_list (bfd *arch, void (*function) (bfd *, bfd *), struct list *list)
 }
 
 
-FILE *outfile;
 
 static void
 ar_directory_doer (bfd *abfd, bfd *ignore ATTRIBUTE_UNUSED)
@@ -141,9 +144,6 @@ maybequit (void)
 }
 
 
-bfd *obfd;
-char *real_name;
-
 void
 ar_open (char *name, int t)
 {
index 3f6ed6573d6c01a6636735b10723ddc77c70295d..3193a80d212844788ee39ba030f85645c2e68fdd 100644 (file)
@@ -89,47 +89,6 @@ ar_emul_default_replace (bfd **after_bfd, char *file_name,
   return TRUE;
 }
 
-bfd_boolean
-ar_emul_create (bfd **abfd_out, char *archive_file_name, char *file_name)
-{
-  if (bin_dummy_emulation.ar_create)
-    return bin_dummy_emulation.ar_create (abfd_out, archive_file_name,
-                                         file_name);
-
-  return FALSE;
-}
-
-bfd_boolean
-ar_emul_default_create (bfd **abfd_out, char *archive_file_name,
-                       char *file_name)
-{
-  char *target = NULL;
-
-  /* Try to figure out the target to use for the archive from the
-     first object on the list.  */
-  if (file_name != NULL)
-    {
-      bfd *obj;
-
-      obj = bfd_openr (file_name, NULL);
-      if (obj != NULL)
-       {
-         if (bfd_check_format (obj, bfd_object))
-           target = bfd_get_target (obj);
-         (void) bfd_close (obj);
-       }
-    }
-
-  /* Create an empty archive.  */
-  *abfd_out = bfd_openw (archive_file_name, target);
-  if (*abfd_out == NULL
-      || ! bfd_set_format (*abfd_out, bfd_archive)
-      || ! bfd_close (*abfd_out))
-    bfd_fatal (archive_file_name);
-
-  return TRUE;
-}
-
 bfd_boolean
 ar_emul_parse_arg (char *arg)
 {
index 59dc2bde20d860f5a8fc50c7e45b0aa069c580ad..5cfbde9386b61cdc3e050969893585b0d5449c1a 100644 (file)
@@ -30,8 +30,6 @@ extern bfd_boolean ar_emul_append (bfd **, char *, bfd_boolean);
 extern bfd_boolean ar_emul_default_append (bfd **, char *, bfd_boolean);
 extern bfd_boolean ar_emul_replace (bfd **, char *, bfd_boolean);
 extern bfd_boolean ar_emul_default_replace (bfd **, char *, bfd_boolean);
-extern bfd_boolean ar_emul_create (bfd **, char *, char *);
-extern bfd_boolean ar_emul_default_create (bfd **, char *, char *);
 extern bfd_boolean ar_emul_parse_arg (char *);
 extern bfd_boolean ar_emul_default_parse_arg (char *);
 
@@ -56,7 +54,6 @@ typedef struct bin_emulation_xfer_struct
   void (* ar_usage) (FILE *fp);
   bfd_boolean (* ar_append) (bfd **, char *, bfd_boolean);
   bfd_boolean (* ar_replace) (bfd **, char *, bfd_boolean);
-  bfd_boolean (* ar_create) (bfd **, char *, char *);
   bfd_boolean (* ar_parse_arg) (char *);
 }
 bin_emulation_xfer_type;
index 6573e2d9c7fa09ff610cd869bd2937048f706303..d469bc14985700d1983bef1fe8597bd3294b1ce9 100644 (file)
@@ -65,7 +65,7 @@ bfd_fatal (const char *string)
   xexit (1);
 }
 
-void
+static void
 report (const char * format, va_list args)
 {
   fprintf (stderr, "%s: ", program_name);
index d7245868d62b22565cac1fb0a18e1ada9f0f3b69..61a64bffa88af6da7684495530f1ae837dce49b5 100644 (file)
@@ -152,8 +152,6 @@ void bfd_nonfatal (const char *);
 
 void bfd_fatal (const char *) ATTRIBUTE_NORETURN;
 
-void report (const char *, va_list);
-
 void fatal (const char *, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
 
 void non_fatal (const char *, ...) ATTRIBUTE_PRINTF_1;
index 1b297fd9da378c15be04a6975d748d58f73182eb..3fe1fd5d138992dc8fcc3dfee96aafaaa60f8428 100644 (file)
@@ -92,8 +92,7 @@ Usage: %s [-_] [-n] [--strip-underscores] [--no-strip-underscores]\n\
   exit (status);
 }
 
-#define MBUF_SIZE 32767
-char mbuffer[MBUF_SIZE];
+static char mbuffer[32767];
 
 int strip_underscore = 0;
 
@@ -243,19 +242,19 @@ main (int argc, char **argv)
 
       for (;;)
        {
-         int i = 0;
+         unsigned i = 0;
          c = getchar ();
          /* Try to read a label.  */
          while (c != EOF && (ISALNUM (c) || strchr (valid_symbols, c)))
            {
-             if (i >= MBUF_SIZE-1)
+             if (i >= sizeof (mbuffer) - 1)
                break;
              mbuffer[i++] = c;
              c = getchar ();
            }
          if (i > 0)
            {
-             int skip_first = 0;
+             unsigned skip_first = 0;
 
              mbuffer[i] = 0;
              if (mbuffer[0] == '.' || mbuffer[0] == '$')
index e7150aebaeb330f8eb333806a2a5788944dfea95..c58846fa9670d67f90e4c2d13ced97842d51cf65 100644 (file)
@@ -161,7 +161,6 @@ struct bin_emulation_xfer_struct bin_aix_emulation =
   ar_emul_aix_usage,
   ar_emul_aix_append,
   ar_emul_aix_replace,
-  ar_emul_default_create,
   ar_emul_aix_parse_arg,
 };
 
@@ -170,6 +169,5 @@ struct bin_emulation_xfer_struct bin_aix5_emulation =
   ar_emul_aix_usage,
   ar_emul_aix5_append,
   ar_emul_aix5_replace,
-  ar_emul_default_create,
   ar_emul_aix_parse_arg,
 };
index d6cfebda98dac78cf36ee4ec1970fef091f8191c..753d746d8cd9a6af9046752e25d1b48e368f9a06 100644 (file)
@@ -25,6 +25,5 @@ struct bin_emulation_xfer_struct bin_vanilla_emulation =
   ar_emul_default_usage,
   ar_emul_default_append,
   ar_emul_default_replace,
-  ar_emul_default_create,
   ar_emul_default_parse_arg,
 };
index 5d2f6394a5be6daeb5e6c8adae44ee7b8761f358..7ff2c6eed73798e7269a9e9748994013aa562ada 100644 (file)
 #include "libiberty.h"
 
 char *program_name = "readelf";
-long archive_file_offset;
-unsigned long archive_file_size;
-unsigned long dynamic_addr;
-bfd_size_type dynamic_size;
-unsigned int dynamic_nent;
-char *dynamic_strings;
-unsigned long dynamic_strings_length;
-char *string_table;
-unsigned long string_table_length;
-unsigned long num_dynamic_syms;
-Elf_Internal_Sym *dynamic_symbols;
-Elf_Internal_Syminfo *dynamic_syminfo;
-unsigned long dynamic_syminfo_offset;
-unsigned int dynamic_syminfo_nent;
-char program_interpreter[64];
-bfd_vma dynamic_info[DT_JMPREL + 1];
-bfd_vma version_info[16];
-Elf_Internal_Ehdr elf_header;
-Elf_Internal_Shdr *section_headers;
-Elf_Internal_Phdr *program_headers;
-Elf_Internal_Dyn *dynamic_section;
-Elf_Internal_Shdr *symtab_shndx_hdr;
-int show_name;
-int do_dynamic;
-int do_syms;
-int do_reloc;
-int do_sections;
-int do_section_groups;
-int do_full_section_name;
-int do_segments;
-int do_unwind;
-int do_using_dynamic;
-int do_header;
-int do_dump;
-int do_version;
-int do_wide;
-int do_histogram;
-int do_debugging;
-int do_debug_info;
-int do_debug_abbrevs;
-int do_debug_lines;
-int do_debug_pubnames;
-int do_debug_aranges;
-int do_debug_ranges;
-int do_debug_frames;
-int do_debug_frames_interp;
-int do_debug_macinfo;
-int do_debug_str;
-int do_debug_loc;
-int do_arch;
-int do_notes;
-int is_32bit_elf;
-int have_frame_base;
-int need_base_address;
-bfd_vma eh_addr_size;
+static long archive_file_offset;
+static unsigned long archive_file_size;
+static unsigned long dynamic_addr;
+static bfd_size_type dynamic_size;
+static unsigned int dynamic_nent;
+static char *dynamic_strings;
+static unsigned long dynamic_strings_length;
+static char *string_table;
+static unsigned long string_table_length;
+static unsigned long num_dynamic_syms;
+static Elf_Internal_Sym *dynamic_symbols;
+static Elf_Internal_Syminfo *dynamic_syminfo;
+static unsigned long dynamic_syminfo_offset;
+static unsigned int dynamic_syminfo_nent;
+static char program_interpreter[64];
+static bfd_vma dynamic_info[DT_JMPREL + 1];
+static bfd_vma version_info[16];
+static Elf_Internal_Ehdr elf_header;
+static Elf_Internal_Shdr *section_headers;
+static Elf_Internal_Phdr *program_headers;
+static Elf_Internal_Dyn *dynamic_section;
+static Elf_Internal_Shdr *symtab_shndx_hdr;
+static int show_name;
+static int do_dynamic;
+static int do_syms;
+static int do_reloc;
+static int do_sections;
+static int do_section_groups;
+static int do_full_section_name;
+static int do_segments;
+static int do_unwind;
+static int do_using_dynamic;
+static int do_header;
+static int do_dump;
+static int do_version;
+static int do_wide;
+static int do_histogram;
+static int do_debugging;
+static int do_debug_info;
+static int do_debug_abbrevs;
+static int do_debug_lines;
+static int do_debug_pubnames;
+static int do_debug_aranges;
+static int do_debug_ranges;
+static int do_debug_frames;
+static int do_debug_frames_interp;
+static int do_debug_macinfo;
+static int do_debug_str;
+static int do_debug_loc;
+static int do_arch;
+static int do_notes;
+static int is_32bit_elf;
+static int have_frame_base;
+static int need_base_address;
+static bfd_vma eh_addr_size;
 
 struct group_list
 {
@@ -185,10 +185,9 @@ struct group
   unsigned int group_index;
 };
 
-struct group *section_groups;
-size_t group_count;
-
-struct group **section_headers_groups;
+static size_t group_count;
+static struct group *section_groups;
+static struct group **section_headers_groups;
 
 /* A dynamic array of flags indicating for which sections a hex dump
    has been requested (via the -x switch) and/or a disassembly dump
@@ -2577,7 +2576,7 @@ get_section_type_name (unsigned int sh_type)
 
 #define OPTION_DEBUG_DUMP      512
 
-struct option options[] =
+static struct option options[] =
 {
   {"all",             no_argument, 0, 'a'},
   {"file-header",      no_argument, 0, 'h'},
@@ -4244,7 +4243,7 @@ process_section_groups (FILE *file)
   return 1;
 }
 
-struct
+static struct
 {
   const char *name;
   int reloc;
@@ -10790,7 +10789,7 @@ display_debug_not_supported (Elf_Internal_Shdr *section,
 
 /* A structure containing the name of a debug section
    and a pointer to a function that can decode it.  */
-struct
+static struct
 {
   const char *const name;
   int (*display) (Elf_Internal_Shdr *, unsigned char *, FILE *);
index 615e7863762607e4ccd261ab545ce9f45ad9e409..1e1dc39b419427ea1e8bde3bb02da3692c3cd22e 100644 (file)
@@ -45,7 +45,9 @@ enum
   }
 radix = decimal;
 
-int berkeley_format = BSD_DEFAULT;     /* 0 means use AT&T-style output.  */
+/* 0 means use AT&T-style output.  */
+static int berkeley_format = BSD_DEFAULT;
+
 int show_version = 0;
 int show_help = 0;
 int show_totals = 0;
@@ -100,7 +102,7 @@ usage (FILE *stream, int status)
   exit (status);
 }
 
-struct option long_options[] =
+static struct option long_options[] =
 {
   {"format", required_argument, 0, 200},
   {"radix", required_argument, 0, 201},