+2012-12-20  Yao Qi  <yao@codesourcery.com>
+
+       * maint.c (_initialize_maint_cmds): Move code to ...
+       * psymtab.c (_initialize_psymtab): ... here.  New.
+       Include "gdbcmd.h".
+       (maintenance_print_psymbols): Make it static.
+       (maintenance_info_psymtabs, maintenance_check_symtabs): Likewise.
+       * symtab.h (maintenance_print_psymbols): Remove declaration.
+       (maintenance_check_symtabs, maintenance_info_psymtabs): Likewise.
+
 2012-12-19  Maxim Kuvyrkov  <maxim@codesourcery.com>
 
        * MAINTAINERS: Add myself to write-after-approval maintainers.
 
 If a SOURCE file is specified, dump only that file's minimal symbols."),
           &maintenanceprintlist);
 
-  add_cmd ("psymbols", class_maintenance, maintenance_print_psymbols, _("\
-Print dump of current partial symbol definitions.\n\
-Entries in the partial symbol table are dumped to file OUTFILE.\n\
-If a SOURCE file is specified, dump only that file's partial symbols."),
-          &maintenanceprintlist);
-
   add_cmd ("objfiles", class_maintenance, maintenance_print_objfiles,
           _("Print dump of current object file definitions."),
           &maintenanceprintlist);
 With an argument REGEXP, list the symbol tables whose names that match that."),
           &maintenanceinfolist);
 
-  add_cmd ("psymtabs", class_maintenance, maintenance_info_psymtabs, _("\
-List the partial symbol tables for all object files.\n\
-This does not include information about individual partial symbols,\n\
-just the symbol table structures themselves."),
-          &maintenanceinfolist);
-
   add_cmd ("statistics", class_maintenance, maintenance_print_statistics,
           _("Print statistics about internal gdb state."),
           &maintenanceprintlist);
 Takes an optional file parameter."),
           &maintenanceprintlist);
 
-  add_cmd ("check-symtabs", class_maintenance, maintenance_check_symtabs,
-          _("Check consistency of psymtabs and symtabs."),
-          &maintenancelist);
-
   add_cmd ("translate-address", class_maintenance,
           maintenance_translate_address,
           _("Translate a section name and address to a symbol."),
 
 #include "dictionary.h"
 #include "language.h"
 #include "cp-support.h"
+#include "gdbcmd.h"
 
 #ifndef DEV_TTY
 #define DEV_TTY "/dev/tty"
 
 \f
 
-void
+static void
 maintenance_print_psymbols (char *args, int from_tty)
 {
   char **argv;
 }
 
 /* List all the partial symbol tables whose names match REGEXP (optional).  */
-void
+static void
 maintenance_info_psymtabs (char *regexp, int from_tty)
 {
   struct program_space *pspace;
 
 /* Check consistency of psymtabs and symtabs.  */
 
-void
+static void
 maintenance_check_symtabs (char *ignore, int from_tty)
 {
   struct symbol *sym;
                                             need_fullname);
   }
 }
+
+extern initialize_file_ftype _initialize_psymtab;
+
+void
+_initialize_psymtab (void)
+{
+  add_cmd ("psymbols", class_maintenance, maintenance_print_psymbols, _("\
+Print dump of current partial symbol definitions.\n\
+Entries in the partial symbol table are dumped to file OUTFILE.\n\
+If a SOURCE file is specified, dump only that file's partial symbols."),
+          &maintenanceprintlist);
+
+  add_cmd ("psymtabs", class_maintenance, maintenance_info_psymtabs, _("\
+List the partial symbol tables for all object files.\n\
+This does not include information about individual partial symbols,\n\
+just the symbol table structures themselves."),
+          &maintenanceinfolist);
+
+  add_cmd ("check-symtabs", class_maintenance, maintenance_check_symtabs,
+          _("Check consistency of psymtabs and symtabs."),
+          &maintenancelist);
+}
 
 
 void maintenance_print_symbols (char *, int);
 
-void maintenance_print_psymbols (char *, int);
-
 void maintenance_print_msymbols (char *, int);
 
 void maintenance_print_objfiles (char *, int);
 
 void maintenance_info_symtabs (char *, int);
 
-void maintenance_info_psymtabs (char *, int);
-
-void maintenance_check_symtabs (char *, int);
-
 /* Symbol-reading stuff in symfile.c and solib.c.  */
 
 extern void clear_solib (void);