/[gcl]/gcl/o/unexec.c
ViewVC logotype

Diff of /gcl/o/unexec.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by camm, Thu Jan 31 19:17:47 2002 UTC revision 1.4 by camm, Sat Jul 20 07:10:56 2002 UTC
# Line 345  report_error (file, fd) Line 345  report_error (file, fd)
345  #define ERROR2(msg,x,y) report_error_1 (new, msg, x, y); return -1  #define ERROR2(msg,x,y) report_error_1 (new, msg, x, y); return -1
346    
347  static  static
348  report_error_1 (fd, msg, a1, a2)  report_error_1 (int fd, char *msg, int a1, int a2)
      int fd;  
      char *msg;  
      int a1, a2;  
349  {  {
350    close (fd);    close (fd);
351  #ifdef emacs  #ifdef emacs
# Line 359  report_error_1 (fd, msg, a1, a2) Line 356  report_error_1 (fd, msg, a1, a2)
356  #endif  #endif
357  }  }
358    
359  static int make_hdr ();  static int make_hdr (int new, int a_out, unsigned int data_start, unsigned int bss_start, unsigned int entry_address, char *a_name, char *new_name);
360  static int copy_text_and_data ();  static int copy_text_and_data (int new, int a_out);
361  static int copy_sym ();  static int copy_sym (int new, int a_out, char *a_name, char *new_name);
362  static void mark_x ();  static void mark_x (char *name);
363    
364  /* ****************************************************************  /* ****************************************************************
365   * unexec   * unexec
366   *   *
367   * driving logic.   * driving logic.
368   */   */
369  unexec (new_name, a_name, data_start, bss_start, entry_address)  unexec (char *new_name, char *a_name, unsigned int data_start, unsigned int bss_start, unsigned int entry_address)
      char *new_name, *a_name;  
      unsigned data_start, bss_start, entry_address;  
370  {  {
371    int new, a_out = -1;    int new, a_out = -1;
372    
# Line 413  unexec (new_name, a_name, data_start, bs Line 408  unexec (new_name, a_name, data_start, bs
408   * Modify the text and data sizes.   * Modify the text and data sizes.
409   */   */
410  static int  static int
411  make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name)  make_hdr (int new, int a_out, unsigned int data_start, unsigned int bss_start, unsigned int entry_address, char *a_name, char *new_name)
      int new, a_out;  
      unsigned data_start, bss_start, entry_address;  
      char *a_name;  
      char *new_name;  
412  {  {
413    int tem;    int tem;
414  #ifdef COFF  #ifdef COFF
# Line 815  make_hdr (new, a_out, data_start, bss_st Line 806  make_hdr (new, a_out, data_start, bss_st
806   * Copy the text and data segments from memory to the new a.out   * Copy the text and data segments from memory to the new a.out
807   */   */
808  static int  static int
809  copy_text_and_data (new, a_out)  copy_text_and_data (int new, int a_out)
      int new, a_out;  
810  {  {
811    register char *end;    register char *end;
812    register char *ptr;    register char *ptr;
# Line 1012  copy_text_and_data (new, a_out) Line 1002  copy_text_and_data (new, a_out)
1002    return 0;    return 0;
1003  }  }
1004    
1005  write_segment (new, ptr, end)  write_segment (int new, register char *ptr, register char *end)
      int new;  
      register char *ptr, *end;  
1006  {  {
1007    register int i, nwrite, ret;    register int i, nwrite, ret;
1008    char buf[80];    char buf[80];
# Line 1065  write_segment (new, ptr, end) Line 1053  write_segment (new, ptr, end)
1053   * Copy the relocation information and symbol table from the a.out to the new   * Copy the relocation information and symbol table from the a.out to the new
1054   */   */
1055  static int  static int
1056  copy_sym (new, a_out, a_name, new_name)  copy_sym (int new, int a_out, char *a_name, char *new_name)
      int new, a_out;  
      char *a_name, *new_name;  
1057  {  {
1058    char page[1024];    char page[1024];
1059    int n;    int n;
# Line 1107  copy_sym (new, a_out, a_name, new_name) Line 1093  copy_sym (new, a_out, a_name, new_name)
1093   * After successfully building the new a.out, mark it executable   * After successfully building the new a.out, mark it executable
1094   */   */
1095  static void  static void
1096  mark_x (name)  mark_x (char *name)
      char *name;  
1097  {  {
1098    struct stat sbuf;    struct stat sbuf;
1099    int um;    int um;

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26