From owner-pc532%daver@mips.com Tue Apr 24 16:10:30 1990
X-Path: convex.com!loeliger
From: Jon Loeliger <loeliger@convex.com>
To: pc532@daver.bungi.com
Subject: Poll + some extract diffs
Date: Tue, 24 Apr 90 13:39:54 CDT
Reply-To: pc532@bungi.com
Precedence: bulk

I have a couple of questions for the group.

Who *is* using the FSF's GNU code for their development environment?

Who is planning on using the FSF's GNU code for their development
environment?

Has anyone gotten the GNU loader to successfully glue together the
pi.c and libso/libc code recently posted?



Here are some hacks (ok, they're diffs) that allow Bruce's extract.c
be compiled into extract{t,d} that understands (in the liberal sense
of the word) GNU's a.out.h.  It is all conditional on USE_FSF_A_OUT_H.


Hey, have fun out there,
jdl




*** /newtools/utl/extract.c	Wed Apr  4 12:29:09 1990
--- /tmp/extract.c	Tue Apr 24 13:34:54 1990
***************
*** 8,16 ****
  
  #include <fcntl.h>
  #include <stdio.h>
  #include "../include/magic.h"
  #include "../include/conv.h"
- 
  #ifdef MSDOS
  #  include "../include/a_out.h"
  #else
--- 8,18 ----
  
  #include <fcntl.h>
  #include <stdio.h>
+ 
+ #ifndef USE_FSF_A_OUT_H
+ 
  #include "../include/magic.h"
  #include "../include/conv.h"
  #ifdef MSDOS
  #  include "../include/a_out.h"
  #else
***************
*** 17,22 ****
--- 19,42 ----
  #  include "../include/a.out.h"
  #endif
  
+ #define N_MAGIC_FIELD		a_magic
+ #define N_MAGIC(x)		x.a_magic
+ #define N_SET_MAGIC(x, m)	x.a_magic = (m)
+ 
+ #else /* USE_FSF_A_OUT_H */
+ 
+ #include "a.out.h"
+ #include "conv.h"
+ 
+ #define EXEC_MAGIC	ZMAGIC
+ #define RELOC_MAGIC	OMAGIC
+ #define TEXTPOS(x)	N_TXTOFF(x)
+ #define DATAPOS(x)	N_DATOFF(x)
+ 
+ #define N_MAGIC_FIELD		a_info
+ 
+ #endif /* USE_FSF_A_OUT_H */
+ 
  #ifdef EXTRACTT				/* use -D option when compiling */
  #  define PROGNAME "EXTRACTT"
  #  define POS(x) TEXTPOS(x)
***************
*** 57,69 ****
  long *size, *pos;
  {
    struct exec exec;
  
    if (sizeof (struct exec) != read (in, &exec, sizeof (struct exec)))
      error ("Can not read input file");
!   CM2L(exec.a_magic);
    CM2L(exec.a_text);
    CM2L(exec.a_data);
!   if (exec.a_magic != EXEC_MAGIC && exec.a_magic != RELOC_MAGIC)
      error ("Input file is not executable or relocatable file");
    *size = SIZE(exec);
    *pos = POS(exec);
--- 77,91 ----
  long *size, *pos;
  {
    struct exec exec;
+   long magic;
  
    if (sizeof (struct exec) != read (in, &exec, sizeof (struct exec)))
      error ("Can not read input file");
!   magic = WM2L(exec.N_MAGIC_FIELD);
!   N_SET_MAGIC(exec, magic);
    CM2L(exec.a_text);
    CM2L(exec.a_data);
!   if (magic != EXEC_MAGIC && magic != RELOC_MAGIC)
      error ("Input file is not executable or relocatable file");
    *size = SIZE(exec);
    *pos = POS(exec);

