home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / lucid / lemacs-19.6 / src / unexsunos4.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-13  |  18.2 KB  |  629 lines

  1. /* Code to do an unexec for Sun O/S 4.1 for a temacs linked -Bdynamic.
  2.    Copyright (C) 1992 Free Software Foundation, Inc.
  3.  
  4. This file is part of GNU Emacs.
  5.  
  6. GNU Emacs is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2, or (at your option)
  9. any later version.
  10.  
  11. GNU Emacs is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with GNU Emacs; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. Created 29-Oct-92 by Harlan Sexton
  21.  */
  22.  
  23. /********************** Included .h Files **************************/
  24.  
  25. #include "config.h"
  26.  
  27. /* I don't understand this, but it's necessary to get some slots in struct exec
  28.    from /usr/include/sys/exec.h when running LCC in strict ANSI mode.  We don't
  29.    need this in K&R mode...
  30.  */
  31. #if defined(__lucid) && defined(__sparc) && !defined(sun)
  32. # define sun 1
  33. #endif
  34.  
  35. #include <sys/param.h>
  36. #include <sys/mman.h>
  37. #include <sys/file.h>
  38. #include <sys/stat.h>
  39. #include <sys/types.h>
  40. #include <string.h>
  41. #include <stdio.h>
  42. #include <a.out.h>
  43. #include <unistd.h>
  44. #include <ctype.h>
  45. #include <stab.h>
  46. #include <sys/dir.h>
  47. #include <link.h>
  48.  
  49. /********************** Macros *************************************/
  50.  
  51. #define SYS_ERR \
  52.  ((errno > 0)?((errno < sys_nerr)?(sys_errlist[errno]):\
  53.                "unknown system error"): "unknown error")
  54.  
  55. #define MASK_UP(x,p_of_two) \
  56.  ((((unsigned long) (x)) + ((p_of_two) - 1)) & (~((p_of_two) - 1)))
  57.  
  58. #define MASK_DOWN(x,p_of_two) (((unsigned long) (x)) & (~((p_of_two) - 1)))
  59.  
  60. #define relocation_info reloc_info_sparc     
  61.  
  62. /********************** Typedefs and Structs ***********************/
  63.  
  64. struct translation_struct
  65. {
  66.   long txtaddr;
  67.   long txtoff;
  68.   long dataddr;
  69.   long datoff;
  70.   long bssaddr;
  71. };
  72.  
  73. /********************** Function Prototypes/Declarations ***********/
  74.  
  75. static void unexec_error (char *m, int use_errno, 
  76.                           char *a1, char *a2, char *a3);
  77. static int unexec_open (char *filename, int flag, int mode);
  78. static caddr_t unexec_mmap (int fd, size_t len, int prot, int flags);
  79. static long unexec_seek (int fd, long position);
  80. static void unexec_read (int fd, long position, char *buf, int bytes);
  81. static void unexec_write (int fd, long position, char *buf, int bytes);
  82. static void unexec_pad (int fd, int bytes);
  83. static void unexec_fstat (int fd, struct stat *statptr);
  84. static void unexec_fchmod (int fd, int mode);
  85. static long unexec_addr_to_offset (long addr, struct translation_struct *ts);
  86. static void copy_relocation_site (struct relocation_info *ri, 
  87.                                   caddr_t from_base_addr, 
  88.                                   caddr_t to_base_addr, 
  89.                                   struct translation_struct *ts);
  90. static void reset_symtab (struct nlist *start, struct nlist *end, 
  91.                           char *strtab, long edata_value, long end_value,
  92.                           int ld_so_table, int shlib_image);
  93. int run_time_remap (char *dummy);
  94.  
  95. /********************** Variables **********************************/
  96.  
  97. /* for reporting error messages from system calls */
  98. extern int sys_nerr;
  99. extern char *sys_errlist[];
  100. extern int errno;
  101. extern int _DYNAMIC;
  102. extern char **environ;             
  103.  
  104. static unsigned long mprotect_bottom_addr;
  105. static unsigned long mprotect_top_addr;
  106.  
  107. static unsigned long sbrk_of_0_at_unexec;
  108.              
  109. /*******************************************************************/
  110.  
  111. static void
  112. unexec_error (char *m, int use_errno, char *a1, char *a2, char *a3)
  113. {
  114.   char *err_msg = SYS_ERR;
  115.  
  116.   fprintf (stderr, "unexec - ");
  117.   fprintf (stderr, m, a1, a2, a3);
  118.   if (use_errno) fprintf (stderr, ": %s", err_msg);
  119.   fprintf (stderr, "\n");
  120.   exit (1);
  121.   return;
  122. }
  123.  
  124. static int
  125. unexec_open (char *filename, int flag, int mode)
  126. {
  127.   int fd;
  128.  
  129.   errno = 0;
  130.  
  131.   fd = open (filename, flag, mode);
  132.  
  133.   if (fd < 0)
  134.     unexec_error ("Failure opening file %s", 1, (void *) filename, 0, 0);
  135.   else
  136.     return fd;
  137. }
  138.  
  139. static caddr_t
  140. unexec_mmap (int fd, size_t len, int prot, int flags)
  141. {
  142.   caddr_t return_val;
  143.  
  144.   unexec_seek (fd, 0);
  145.   errno = 0;
  146.   return_val = mmap (0, len, prot, flags, fd, 0);
  147.  
  148.   if (return_val == (caddr_t) -1)
  149.     unexec_error ("Failure mmap'ing file", 1, 0, 0, 0);
  150.   else
  151.     return return_val;
  152. }
  153.  
  154.  
  155. static long
  156. unexec_seek (int fd, long position)
  157. {
  158.   long seek_value;
  159.  
  160.   if (fd <= 0)
  161.     unexec_error ("No file open in which to seek", 0, 0, 0, 0);
  162.  
  163.   errno = 0;
  164.  
  165.   if (position < 0)
  166.     seek_value = (long) lseek (fd, 0, L_INCR);
  167.   else
  168.     seek_value = (long) lseek (fd, position, L_SET);
  169.  
  170.   if (seek_value < 0)
  171.     unexec_error ("Failed to do a seek to 0x%x in %s", 1,
  172.                   (char *) position, "unexec() output file", 0);
  173.  
  174.   return seek_value;
  175. }
  176.  
  177. static void
  178. unexec_read (int fd, long position, char *buf, int bytes)
  179. {
  180.   int n_read;
  181.   int remains = bytes;
  182.   position = unexec_seek (fd, position);
  183.  
  184.   if (bytes < 0)
  185.     unexec_error ("Attempted read of %d bytes", 0, (char *) bytes, 0, 0);
  186.  
  187.   errno = 0;
  188.  
  189.   while (remains > 0)
  190.     {
  191.       n_read = read (fd, buf, remains);
  192.       if (n_read <= 0)
  193.         unexec_error ("Read failed for 0x%x bytes at offset 0x%x in %s",
  194.                       1, (char *) bytes, (char *) position,
  195.                       "unexec() output file");
  196.       buf += n_read;
  197.       remains -= n_read;
  198.     }
  199.  
  200.   return;
  201. }
  202.  
  203. static void
  204. unexec_write (int fd, long position, char *buf, int bytes)
  205. {
  206.   int n_written;
  207.   int remains = bytes;
  208.   position = unexec_seek (fd, position);
  209.  
  210.   if (bytes < 0)
  211.     unexec_error ("Attempted write of %d bytes in %s",
  212.                   0, (char *) bytes, "unexec() output file", 0);
  213.  
  214.   errno = 0;
  215.  
  216.   while (remains > 0)
  217.     {
  218.       n_written = write (fd, buf, remains);
  219.       if (n_written <= 0)
  220.         unexec_error ("Write failed for 0x%x bytes at offset 0x%x in %s",
  221.                       1, (char *) bytes, (char *) position,
  222.                       "unexec() output file");
  223.       buf += n_written;
  224.       remains -= n_written;
  225.     }
  226.  
  227.   return;
  228. }
  229.  
  230. static void 
  231. unexec_pad (int fd, int bytes)
  232. {
  233.   if (bytes > 0)
  234.     {
  235.       char buf[1024];
  236.       int remaining = bytes;
  237.  
  238.       bzero (buf, sizeof(buf));
  239.   
  240.       while (remaining > 0)
  241.         {
  242.           int this_write = (remaining > sizeof(buf))?sizeof(buf):remaining;
  243.           unexec_write (fd, -1, buf, this_write);
  244.           remaining -= this_write;
  245.         }
  246.     }
  247. }
  248.  
  249. static void
  250. unexec_fstat (int fd, struct stat *statptr)
  251. {
  252.   errno = 0;
  253.   if (-1 == fstat (fd, statptr))
  254.     unexec_error ("fstat() failed for descriptor %d", 1, (char *) fd, 0, 0);
  255.   return;
  256. }
  257.  
  258. static void
  259. unexec_fchmod (int fd, int mode)
  260. {
  261.   errno = 0;
  262.   if (-1 == fchmod (fd, mode))
  263.     unexec_error ("fchmod() failed for descriptor %d", 1, (char *) fd, 0, 0);
  264.   return;
  265. }
  266.  
  267. static long
  268. unexec_addr_to_offset (long addr, struct translation_struct *ts)
  269.                              
  270. {
  271.   if ((addr < ts->txtaddr) || (addr >= ts->bssaddr))
  272.     unexec_error ("bad address 0x%x to addr_to_offset()", 
  273.                   0, (char *) addr, 0, 0);
  274.   else if (addr >= ts->dataddr)
  275.     return ((long) ((addr - ts->dataddr) + ts->datoff));
  276.   else 
  277.     return ((long) ((addr - ts->txtaddr) + ts->txtoff));
  278. }
  279.  
  280.  
  281. /*
  282.  * "LD.SO" DATA AND SYMBOL TABLE OPERATIONS 
  283.  */
  284.  
  285.  
  286. static void
  287. copy_relocation_site (struct relocation_info *ri, 
  288.                       caddr_t from_base_addr,
  289.                       caddr_t to_base_addr,
  290.                       struct translation_struct *ts)
  291. {
  292.   long offset = unexec_addr_to_offset (ri->r_address, ts);
  293.   caddr_t from = from_base_addr + offset;
  294.   caddr_t to = to_base_addr + offset;
  295.      
  296.   switch (ri->r_type)
  297.     {
  298.     case RELOC_8:
  299.     case RELOC_DISP8:
  300.       *((char *) to) = *((char *) from);
  301.       break;
  302.     case RELOC_16:
  303.     case RELOC_DISP16:
  304.       *((short *) to) = *((short *) from);
  305.       break;     
  306.     case RELOC_LO10:
  307.     case RELOC_13:     
  308.     case RELOC_22:     
  309.     case RELOC_HI22:
  310.     case RELOC_WDISP22:
  311.     case RELOC_WDISP30:
  312.     case RELOC_32:
  313.     case RELOC_DISP32:
  314.     case RELOC_GLOB_DAT:
  315.       *((long *) to) = *((long *) from);
  316.       break;
  317.     case RELOC_JMP_SLOT:
  318.       {
  319.         long *target = (long *) to;
  320.         long *source = (long *) from;
  321.         *target = *source;
  322.         target++;
  323.         source++;
  324.         *target = *source;
  325.         target++;
  326.         source++;
  327.         *target = *source;
  328.       }
  329.       break;
  330.  
  331.     default:
  332.       unexec_error ("unknown reloc type %d seen during unexec()",
  333.                     0, (char *) ri->r_type, 0, 0);
  334.       break;
  335.     }
  336.   return;
  337. }
  338.  
  339.  
  340. static void
  341. reset_symtab (struct nlist *start, struct nlist *end, char *strtab,
  342.               long edata_value, long end_value, int ld_so_table,
  343.               int shlib_image)
  344. {
  345.   struct nlist *tmp = start;
  346.   int found_edata = 0;
  347.   int found_end = 0;
  348.      
  349.   while (tmp < end)
  350.     {
  351.       int type = tmp->n_type;
  352.       int named = (ld_so_table)?1:(tmp->n_un.n_strx);
  353.  
  354.       if ((type == (N_UNDF | N_EXT)) &&
  355.           (tmp->n_value != 0))
  356.         unexec_error ("unexec'ing image has COMMON symbols in it -- we quit!",
  357.                       0, 0, 0, 0);
  358.      
  359.       if (!(type & N_STAB))
  360.         {
  361.           if (!found_edata &&
  362.               (type == (N_EXT | N_DATA)) &&
  363.               named &&
  364.               !strcmp ("_edata", strtab + tmp->n_un.n_strx))
  365.             {
  366.               tmp->n_value = edata_value;
  367.               found_edata = 1;
  368.             }
  369.  
  370.  
  371.           if ((type & N_TYPE) == N_BSS)
  372.             {
  373.               if (!found_end &&
  374.                   (type == (N_EXT | N_BSS)) &&
  375.                   named &&
  376.                   !strcmp ("_end", strtab + tmp->n_un.n_strx))
  377.                 {
  378.                   tmp->n_value = end_value;
  379.                   found_end = 1;
  380.                 }
  381.               else if (type & N_EXT)
  382.                 tmp->n_type = N_DATA | N_EXT;
  383.               else
  384.                 tmp->n_type = N_DATA;
  385.             }
  386.  
  387.           /* the way things are being handled here, having sbrk() in the
  388.              image is fatal for an image linked with shared lib's (although 
  389.              the code could be modified to support it), but this should 
  390.              never happen anyway */
  391.           if (shlib_image &&
  392.               (type == (N_EXT | N_TEXT)) &&
  393.               named &&
  394.               !strcmp ("_sbrk", strtab + tmp->n_un.n_strx))
  395.             unexec_error ("unexec'd shlib image has sbrk() in it -- we quit!",
  396.                           0, 0, 0, 0);
  397.         }
  398.  
  399.       tmp++;
  400.     }
  401.      
  402. extern int getpagesize (void);
  403.  
  404. /*
  405.  * EXPORTED FUNCTIONS 
  406.  */
  407.  
  408. /* this has to be a global variable to prevent the optimizers from
  409.  * assuming that it can not be 0.  
  410. */
  411. static void *dynamic_addr = (void *) &_DYNAMIC;
  412.  
  413. int
  414. unexec (char *new_name, char *old_name,
  415.         unsigned int emacs_edata, unsigned int dummy1, unsigned int dummy2)
  416. {
  417.   /* ld.so data */
  418.   struct link_dynamic *ld = 0;
  419.   struct link_dynamic_2 *ld2 = 0;
  420.   /* old and new state */
  421.   int old_fd;
  422.   int new_fd;
  423.   caddr_t old_base_addr;
  424.   caddr_t new_base_addr;
  425.   struct exec old_hdr;
  426.   struct exec new_hdr;
  427.   struct stat old_buf;
  428.   struct stat new_buf;
  429.   /* some process specific "constants" */
  430.   unsigned long n_pagsiz;
  431.   long page_size = getpagesize ();
  432.   caddr_t plt_end;
  433.   caddr_t current_break = (caddr_t) sbrk (0);
  434.  
  435.   if (!page_size)
  436.     unexec_error ("unexec() failed because we can't get the size of a page!",
  437.                   0, 0, 0, 0);
  438.  
  439.   /* see if this is a -Bdynamic image -- if so, find ld.so structures */
  440.   if (dynamic_addr)
  441.     {
  442.       ld = (struct link_dynamic *) dynamic_addr;
  443.       ld2 = ld->ld_un.ld_2;
  444.       if (ld->ld_version < 2)
  445.         unexec_error ("%s linked with obsolete version of ld -- we quit!",
  446.                       0, old_name, 0, 0);
  447.     }
  448.  
  449.   /* open the old and new files, figuring out how big the old one is
  450.      so that we can map it in */
  451.   old_fd = unexec_open (old_name, O_RDONLY, 0);
  452.   new_fd = unexec_open (new_name, O_RDWR | O_CREAT | O_TRUNC, 0666);
  453.  
  454.   /* setup the header and the statbuf for old_fd */
  455.   unexec_read (old_fd, 0, (char *) &old_hdr, sizeof (old_hdr));
  456.   unexec_fstat (old_fd, &old_buf);
  457.  
  458.  
  459.   /* set up some important constants */
  460.   n_pagsiz = N_PAGSIZ (old_hdr);
  461.   if (dynamic_addr)
  462.     plt_end = (caddr_t) MASK_UP (ld2->ld_plt + ld2->ld_plt_sz, sizeof (double));
  463.   else
  464.     plt_end = (caddr_t) N_DATADDR (old_hdr);
  465.  
  466.   /* never write protect the variable "environ", defined in /lib/crt0.o, and
  467.      set in process.c and callproc.c */
  468.   mprotect_bottom_addr = ((unsigned long) &environ) + sizeof (char **);
  469.   /* never protect ABOVE the end of data emacs_edata specified */
  470.   mprotect_top_addr = MIN (emacs_edata, N_DATADDR (old_hdr) + old_hdr.a_data);
  471.  
  472.   /* Set up the image of the old file */
  473.   old_base_addr = unexec_mmap (old_fd, old_buf.st_size, PROT_READ, MAP_PRIVATE);
  474.   close (old_fd);
  475.  
  476.   /* set up the new exec */
  477.   new_hdr = old_hdr;
  478.   new_hdr.a_data = (((unsigned long) MASK_UP (current_break, n_pagsiz)) - 
  479.                     ((unsigned long) N_DATADDR (old_hdr)));
  480.   new_hdr.a_bss  = 0;
  481.  
  482.   /* set up this variable, in case we want to reset "the break" 
  483.      when restarting */
  484.   sbrk_of_0_at_unexec = ((unsigned long) MASK_UP (current_break, n_pagsiz));
  485.      
  486.   /* Write out the first approximation to the new file. The sizes of
  487.      each section will be correct, but there will be a number of 
  488.      corrections that will need to be made. */
  489.   {
  490.     long old_datoff = N_DATOFF (old_hdr);
  491.     long old_dataddr = N_DATADDR (old_hdr);
  492.     long new_treloff = N_TRELOFF (new_hdr);
  493.     long old_treloff = N_TRELOFF (old_hdr);
  494.     long ld_so_size = ((unsigned long) plt_end) - old_dataddr;
  495.     long real_data_size = current_break - plt_end;
  496.     long pad_size = 
  497.       MASK_UP (current_break, n_pagsiz) - ((unsigned long) current_break);
  498.  
  499.  
  500.     /* First, write the text segment with new header -- copy everything until
  501.        the start of the data segment from the old file, and then go back and 
  502.        write the new header. */
  503.     unexec_write (new_fd, 0, old_base_addr, old_datoff + ld_so_size);
  504.     unexec_write (new_fd, 0, (char *) &new_hdr, sizeof (new_hdr));
  505.  
  506.     /* Copy the rest of the data segment from the running image. */
  507.     unexec_write (new_fd, old_datoff + ld_so_size, 
  508.                   plt_end, real_data_size);
  509.  
  510.     /* pad out the data segment */
  511.     unexec_pad (new_fd, pad_size);
  512.     
  513.     /* Finally, copy the symbol table information from the old file. */
  514.     unexec_write (new_fd, new_treloff,
  515.                   old_base_addr + old_treloff,
  516.                   old_buf.st_size - old_treloff);
  517.   }
  518.      
  519.      
  520.   /* Next, map in the output file so that we can jump around fixing it
  521.      up. We retain the old file so that we can refer to it. */
  522.   unexec_fstat (new_fd, &new_buf);
  523.   new_base_addr = unexec_mmap (new_fd, 
  524.                                MASK_UP (new_buf.st_size, page_size),
  525.                                PROT_READ | PROT_WRITE, MAP_SHARED);
  526.  
  527.  
  528.  
  529.   /* We need to do 2 things. First, make sure that _edata and _end (and
  530.      hence, curbrk) are set to the correct values. At the same time, for
  531.      neatness and to help with debugging, mark all the types of all ld.so
  532.      and nm BSS symbols in the new file to be DATA, and make sure that
  533.      there are no COMMON symbols in the output file, as any references to
  534.      these can lose really big. Second, reset all of the ld.so "relocation
  535.      sites" in the new file to have the values that appear in the old file
  536.      -- the failure to do this was the biggest loser in the old version of
  537.      this code. */
  538.  
  539.   /* STEP 1 */
  540.   {
  541.     /* Reset the regular symbol table first. */
  542.     reset_symtab ((struct nlist *) (new_base_addr + N_SYMOFF(new_hdr)),
  543.                   (struct nlist *) (new_base_addr + N_SYMOFF(new_hdr) +
  544.                                     new_hdr.a_syms),
  545.                   (char *) (new_base_addr + N_STROFF(new_hdr)),
  546.                   N_DATADDR (new_hdr) + new_hdr.a_data,
  547.                   N_BSSADDR (new_hdr) + new_hdr.a_bss,
  548.                   0, !!dynamic_addr);
  549.     /* Now reset the ld.so symbol table. */
  550.     if (dynamic_addr)
  551.       reset_symtab ((struct nlist *) (new_base_addr + ld2->ld_stab),
  552.                     (struct nlist *) (new_base_addr + ld2->ld_symbols),
  553.                     (char *) (new_base_addr + ld2->ld_symbols),
  554.                     N_DATADDR (new_hdr) + new_hdr.a_data,
  555.                     N_BSSADDR (new_hdr) + new_hdr.a_bss,
  556.                     1, !!dynamic_addr);
  557.   }
  558.  
  559.   /* STEP 2 */
  560.   if (dynamic_addr)
  561.     {
  562.       struct translation_struct ts;
  563.       struct relocation_info *tmp = 
  564.         (struct relocation_info *) (old_base_addr + ld2->ld_rel);
  565.       struct relocation_info *end = 
  566.         (struct relocation_info *)(old_base_addr + ld2->ld_hash);
  567.       
  568.       /* set up the structure that we use to translate addresses in the
  569.          old file into file offsets */
  570.       ts.txtaddr = N_TXTADDR (old_hdr);
  571.       ts.txtoff = N_TXTOFF (old_hdr);
  572.       ts.dataddr = N_DATADDR (old_hdr);
  573.       ts.datoff = N_DATOFF (old_hdr);
  574.       ts.bssaddr = N_BSSADDR (old_hdr);
  575.     
  576.       while (tmp < end)
  577.         {
  578.           copy_relocation_site (tmp, old_base_addr, new_base_addr, &ts);
  579.           tmp++;
  580.         }
  581.     }
  582.   
  583.      
  584.   /* get rid of the mmap-ed file space and make the output file 
  585.      executable -- then quit */
  586.   munmap (new_base_addr, MASK_UP (new_buf.st_size, page_size));
  587.   munmap (old_base_addr, MASK_UP (old_buf.st_size, page_size));
  588.   unexec_fchmod (new_fd, 0755);
  589.   close (new_fd);
  590.   return 0;
  591. }
  592.  
  593.  
  594. int
  595. run_time_remap (char *dummy)
  596. {
  597.   long page_size = getpagesize();
  598.   unsigned long base_addr = MASK_UP (mprotect_bottom_addr, page_size);
  599.   unsigned long top_addr = MASK_DOWN (mprotect_top_addr, page_size);
  600.   long len = top_addr - base_addr;
  601.  
  602.   if (!dynamic_addr)
  603.     {
  604.       unsigned long current_sbrk = (unsigned long) sbrk (0);
  605.  
  606.       if (sbrk_of_0_at_unexec < current_sbrk)
  607.         fprintf (stderr, "Absurd new brk addr = 0x%x (current = 0x%x)\n", 
  608.                  sbrk_of_0_at_unexec, current_sbrk);
  609.       else
  610.         {
  611.           errno = 0;
  612.           if (brk ((caddr_t) sbrk_of_0_at_unexec))
  613.             fprintf (stderr, "failed to change brk addr to 0x%x: %s\n", 
  614.                      sbrk_of_0_at_unexec, SYS_ERR);
  615.         }
  616.     }
  617.  
  618.   if (len > 0)
  619.     {
  620.       errno = 0;
  621.       if (mprotect ((caddr_t) base_addr, len, PROT_READ | PROT_EXEC))
  622.         fprintf (stderr, "failed to change protection on data pages: %s\n",
  623.                  SYS_ERR);
  624.     }
  625.              
  626.   return 0;
  627. }
  628.