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

Diff of /gcl/o/unexlin.c

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

revision 1.1.1.1 by wfs, Mon Dec 6 22:44:14 1999 UTC revision 1.2 by camm, Sat Jul 20 07:10:56 2002 UTC
# Line 187  extern char *start_of_data ();         /* Start Line 187  extern char *start_of_data ();         /* Start
187  #define start_of_text() ( (char *) 0 )  #define start_of_text() ( (char *) 0 )
188  extern char etext;  extern char etext;
189    
190  static int make_hdr (), copy_text_and_data (), copy_sym ();  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), copy_text_and_data (int new, int a_out), copy_sym (int new, int a_out, char *a_name, char *new_name);
191  static int mark_x ();  static int mark_x (char *name);
192    
193  #ifdef COFF  #ifdef COFF
194  #ifndef USG  #ifndef USG
# Line 239  static EXEC_HDR_TYPE hdr, ohdr; Line 239  static EXEC_HDR_TYPE hdr, ohdr;
239    
240  #else /* not HPUX */  #else /* not HPUX */
241    
242  extern char *sbrk ();  extern char *sbrk (int n);
243    
244  #if defined (USG) && !defined (IBMRTAIX) && !defined (IRIS) && !defined(linux)  #if defined (USG) && !defined (IBMRTAIX) && !defined (IRIS) && !defined(linux)
245  static struct bhdr hdr, ohdr;  static struct bhdr hdr, ohdr;
# Line 294  report_error (file, fd) Line 294  report_error (file, fd)
294  #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
295    
296  static  static
297  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;  
298  {  {
299    close (fd);    close (fd);
300  #ifdef emacs  #ifdef emacs
# Line 313  report_error_1 (fd, msg, a1, a2) Line 310  report_error_1 (fd, msg, a1, a2)
310   *   *
311   * driving logic.   * driving logic.
312   */   */
313  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;  
314  {  {
315    int new, a_out = -1;    int new, a_out = -1;
316    
# Line 354  unexec (new_name, a_name, data_start, bs Line 349  unexec (new_name, a_name, data_start, bs
349   * Modify the text and data sizes.   * Modify the text and data sizes.
350   */   */
351  static int  static int
352  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;  
353  {  {
354    int tem;    int tem;
355  #ifdef COFF  #ifdef COFF
# Line 686  make_hdr (new, a_out, data_start, bss_st Line 677  make_hdr (new, a_out, data_start, bss_st
677   * 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
678   */   */
679  static int  static int
680  copy_text_and_data (new, a_out)  copy_text_and_data (int new, int a_out)
      int new, a_out;  
681  {  {
682    register char *end;    register char *end;
683    register char *ptr;    register char *ptr;
# Line 804  copy_text_and_data (new, a_out) Line 794  copy_text_and_data (new, a_out)
794    return 0;    return 0;
795  }  }
796    
797  write_segment (new, ptr, end)  write_segment (int new, register char *ptr, register char *end)
      int new;  
      register char *ptr, *end;  
798  {  {
799    register int i, nwrite, ret;    register int i, nwrite, ret;
800    char buf[80];    char buf[80];
# Line 846  write_segment (new, ptr, end) Line 834  write_segment (new, ptr, end)
834   * 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
835   */   */
836  static int  static int
837  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;  
838  {  {
839    char page[1024];    char page[1024];
840    int n;    int n;
# Line 888  copy_sym (new, a_out, a_name, new_name) Line 874  copy_sym (new, a_out, a_name, new_name)
874   * After succesfully building the new a.out, mark it executable   * After succesfully building the new a.out, mark it executable
875   */   */
876  static int  static int
877  mark_x (name)  mark_x (char *name)
      char *name;  
878  {  {
879    struct stat sbuf;    struct stat sbuf;
880    int um;    int um;

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.2

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